apiv2_client

package
v2.0.0-...-733cdc8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 8 Imported by: 7

Documentation

Overview

Package apiv2_client provides an experimental combined client for interacting with the various RPC services that comprise the BigQuery v2 API surface. It simplifies interactions with the bigquery service by allowing the user to only manage a single unified client rather than instantiating multiple clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents the aggregate client which manages the various per-RPC service clients.

func NewClient

func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)

NewClient creates a new Client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.

func NewRESTClient

func NewRESTClient(ctx context.Context, opts ...option.ClientOption) (*Client, error)

NewRESTClient creates a new Client based on REST. The returned client must be Closed when it is done being used to clean up its underlying connections.

func (*Client) BatchDeleteRowAccessPolicies

func (mc *Client) BatchDeleteRowAccessPolicies(ctx context.Context, req *bigquerypb.BatchDeleteRowAccessPoliciesRequest, opts ...gax.CallOption) error

BatchDeleteRowAccessPolicies deletes provided row access policies.

func (*Client) CancelJob

CancelJob requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.

func (*Client) Close

func (mc *Client) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*Client) Connection deprecated

func (c *Client) Connection() *grpc.ClientConn

Deprecated: Connection() always returns nil. This method exists solely to satisfy the underlying per-RPC service interface(s) and should not be used.

func (*Client) CreateRowAccessPolicy

func (mc *Client) CreateRowAccessPolicy(ctx context.Context, req *bigquerypb.CreateRowAccessPolicyRequest, opts ...gax.CallOption) (*bigquerypb.RowAccessPolicy, error)

CreateRowAccessPolicy creates a row access policy.

func (*Client) DeleteDataset

func (mc *Client) DeleteDataset(ctx context.Context, req *bigquerypb.DeleteDatasetRequest, opts ...gax.CallOption) error

DeleteDataset deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.

func (*Client) DeleteJob

func (mc *Client) DeleteJob(ctx context.Context, req *bigquerypb.DeleteJobRequest, opts ...gax.CallOption) error

DeleteJob requests the deletion of the metadata of a job. This call returns when the job’s metadata is deleted.

func (*Client) DeleteModel

func (mc *Client) DeleteModel(ctx context.Context, req *bigquerypb.DeleteModelRequest, opts ...gax.CallOption) error

DeleteModel deletes the model specified by modelId from the dataset.

func (*Client) DeleteRoutine

func (mc *Client) DeleteRoutine(ctx context.Context, req *bigquerypb.DeleteRoutineRequest, opts ...gax.CallOption) error

DeleteRoutine deletes the routine specified by routineId from the dataset.

func (*Client) DeleteRowAccessPolicy

func (mc *Client) DeleteRowAccessPolicy(ctx context.Context, req *bigquerypb.DeleteRowAccessPolicyRequest, opts ...gax.CallOption) error

DeleteRowAccessPolicy deletes a row access policy.

func (*Client) DeleteTable

func (mc *Client) DeleteTable(ctx context.Context, req *bigquerypb.DeleteTableRequest, opts ...gax.CallOption) error

DeleteTable deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.

func (*Client) GetDataset

func (mc *Client) GetDataset(ctx context.Context, req *bigquerypb.GetDatasetRequest, opts ...gax.CallOption) (*bigquerypb.Dataset, error)

GetDataset returns the dataset specified by datasetID.

func (*Client) GetJob

func (mc *Client) GetJob(ctx context.Context, req *bigquerypb.GetJobRequest, opts ...gax.CallOption) (*bigquerypb.Job, error)

GetJob returns information about a specific job. Job information is available for a six month period after creation. Requires that you’re the person who ran the job, or have the Is Owner project role.

func (*Client) GetModel

func (mc *Client) GetModel(ctx context.Context, req *bigquerypb.GetModelRequest, opts ...gax.CallOption) (*bigquerypb.Model, error)

GetModel gets the specified model resource by model ID.

func (*Client) GetQueryResults

GetQueryResults rPC to get the results of a query job.

func (*Client) GetRoutine

func (mc *Client) GetRoutine(ctx context.Context, req *bigquerypb.GetRoutineRequest, opts ...gax.CallOption) (*bigquerypb.Routine, error)

GetRoutine gets the specified routine resource by routine ID.

func (*Client) GetRowAccessPolicy

GetRowAccessPolicy gets the specified row access policy by policy ID.

func (*Client) GetServiceAccount

GetServiceAccount rPC to get the service account for a project used for interactions with Google Cloud KMS

func (*Client) GetTable

func (mc *Client) GetTable(ctx context.Context, req *bigquerypb.GetTableRequest, opts ...gax.CallOption) (*bigquerypb.Table, error)

GetTable gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.

func (*Client) InsertDataset

func (mc *Client) InsertDataset(ctx context.Context, req *bigquerypb.InsertDatasetRequest, opts ...gax.CallOption) (*bigquerypb.Dataset, error)

InsertDataset creates a new empty dataset.

func (*Client) InsertJob

func (mc *Client) InsertJob(ctx context.Context, req *bigquerypb.InsertJobRequest, opts ...gax.CallOption) (*bigquerypb.Job, error)

InsertJob starts a new asynchronous job.

This API has two different kinds of endpoint URIs, as this method supports a variety of use cases.

The Metadata URI is used for most interactions, as it accepts the job
configuration directly.

The Upload URI is ONLY for the case when you’re sending both a load job
configuration and a data stream together.  In this case, the Upload URI
accepts the job configuration and the data as two distinct multipart MIME
parts.

func (*Client) InsertRoutine

func (mc *Client) InsertRoutine(ctx context.Context, req *bigquerypb.InsertRoutineRequest, opts ...gax.CallOption) (*bigquerypb.Routine, error)

InsertRoutine creates a new routine in the dataset.

func (*Client) InsertTable

func (mc *Client) InsertTable(ctx context.Context, req *bigquerypb.InsertTableRequest, opts ...gax.CallOption) (*bigquerypb.Table, error)

InsertTable creates a new, empty table in the dataset.

func (*Client) ListDatasets

ListDatasets lists all datasets in the specified project to which the user has been granted the READER dataset role.

func (*Client) ListJobs

ListJobs lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.

func (*Client) ListModels

ListModels lists all models in the specified dataset. Requires the READER dataset role. After retrieving the list of models, you can get information about a particular model by calling the models.get method.

func (*Client) ListRoutines

ListRoutines lists all routines in the specified dataset. Requires the READER dataset role.

func (*Client) ListRowAccessPolicies

ListRowAccessPolicies lists all row access policies on the specified table.

func (*Client) ListTables

ListTables lists all tables in the specified dataset. Requires the READER dataset role.

func (*Client) PatchDataset

PatchDataset updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports RFC5789 patch semantics.

func (*Client) PatchModel

func (mc *Client) PatchModel(ctx context.Context, req *bigquerypb.PatchModelRequest, opts ...gax.CallOption) (*bigquerypb.Model, error)

PatchModel patch specific fields in the specified model.

func (*Client) PatchTable

PatchTable updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports RFC5789 patch semantics.

func (*Client) Query

Query runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.

func (*Client) UndeleteDataset

func (mc *Client) UndeleteDataset(ctx context.Context, req *bigquerypb.UndeleteDatasetRequest, opts ...gax.CallOption) (*bigquerypb.Dataset, error)

UndeleteDataset undeletes a dataset which is within time travel window based on datasetId. If a time is specified, the dataset version deleted at that time is undeleted, else the last live version is undeleted.

func (*Client) UpdateDataset

UpdateDataset updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource.

func (*Client) UpdateRoutine

func (mc *Client) UpdateRoutine(ctx context.Context, req *bigquerypb.UpdateRoutineRequest, opts ...gax.CallOption) (*bigquerypb.Routine, error)

UpdateRoutine updates information in an existing routine. The update method replaces the entire Routine resource.

func (*Client) UpdateRowAccessPolicy

func (mc *Client) UpdateRowAccessPolicy(ctx context.Context, req *bigquerypb.UpdateRowAccessPolicyRequest, opts ...gax.CallOption) (*bigquerypb.RowAccessPolicy, error)

UpdateRowAccessPolicy updates a row access policy.

func (*Client) UpdateTable

UpdateTable updates information in an existing table. The update method replaces the entire Table resource, whereas the patch method only replaces fields that are provided in the submitted Table resource.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL