Google BigQuery v2 API - Class BigQueryModel (3.10.0)

public sealed class BigQueryModel

Reference documentation and code samples for the Google BigQuery v2 API class BigQueryModel.

A model within a BigQuery dataset.

Inheritance

object > BigQueryModel

Namespace

Google.Cloud.BigQuery.V2

Assembly

Google.Cloud.BigQuery.V2.dll

Remarks

This class wraps the underlying REST API resource and retains a reference to the original client, allowing for simpler model-oriented operations.

Constructors

BigQueryModel(BigQueryClient, Model)

public BigQueryModel(BigQueryClient client, Model resource)

Constructs a new model.

Parameters
Name Description
client BigQueryClient

The client to use for operations on the model. Must not be null.

resource Model

The REST-ful resource representing the model. Must not be null.

Remarks

This is public to allow tests to construct instances for production code to consume; production code should not normally construct instances itself.

Properties

Reference

public ModelReference Reference { get; }

The fully-qualified identifier for the model, as an object which can be used for other operations within this API.

Property Value
Type Description
ModelReference
Remarks

The properties within the reference can be used to determine the project ID, dataset ID and model ID components.

Resource

public Model Resource { get; }

The underlying REST-ful resource for the model.

Property Value
Type Description
Model
Remarks

The data within the resource may be incomplete, depending on how it was obtained. (ListModels operations return less data than GetModel operations.)

Methods

CreateModelExtractJob(IEnumerable<string>, CreateModelExtractJobOptions)

public BigQueryJob CreateModelExtractJob(IEnumerable<string> destinationUris, CreateModelExtractJobOptions options = null)

Creates a job to extract this model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs. This method just creates a ModelReference and delegates to CreateModelExtractJob(ModelReference, IEnumerable<string>, CreateModelExtractJobOptions).

Parameters
Name Description
destinationUris IEnumerablestring

The Google Cloud Storage URIs (possibly including a wildcard) to extract the model to. Must not be null or empty.

options CreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
Type Description
BigQueryJob

The job created for the extract operation.

CreateModelExtractJob(string, CreateModelExtractJobOptions)

public BigQueryJob CreateModelExtractJob(string destinationUri, CreateModelExtractJobOptions options = null)

Creates a job to extract this model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs. This method just creates a ModelReference and delegates to CreateModelExtractJob(ModelReference, string, CreateModelExtractJobOptions).

Parameters
Name Description
destinationUri string

The Google Cloud Storage URI (possibly including a wildcard) to extract the model to. Must not be null.

options CreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
Type Description
BigQueryJob

The job created for the extract operation.

CreateModelExtractJobAsync(IEnumerable<string>, CreateModelExtractJobOptions, CancellationToken)

public Task<BigQueryJob> CreateModelExtractJobAsync(IEnumerable<string> destinationUris, CreateModelExtractJobOptions options = null, CancellationToken cancellationToken = default)

Asynchronously creates a job to extract this model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs. This method just creates a ModelReference and delegates to CreateModelExtractJobAsync(ModelReference, IEnumerable<string>, CreateModelExtractJobOptions, CancellationToken).

Parameters
Name Description
destinationUris IEnumerablestring

The Google Cloud Storage URIs (possibly including a wildcard) to extract the model to. Must not be null or empty.

options CreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns
Type Description
TaskBigQueryJob

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

CreateModelExtractJobAsync(string, CreateModelExtractJobOptions, CancellationToken)

public Task<BigQueryJob> CreateModelExtractJobAsync(string destinationUri, CreateModelExtractJobOptions options = null, CancellationToken cancellationToken = default)

Asynchronously creates a job to extract this model to Google Cloud Storage. See the BigQuery documentation for more information on model extract jobs. This method just creates a ModelReference and delegates to CreateModelExtractJobAsync(ModelReference, string, CreateModelExtractJobOptions, CancellationToken).

Parameters
Name Description
destinationUri string

The Google Cloud Storage URI (possibly including a wildcard) to extract the model to. Must not be null or empty.

options CreateModelExtractJobOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns
Type Description
TaskBigQueryJob

A task representing the asynchronous operation. When complete, the result is the job created for the extract operation.

Delete(DeleteModelOptions)

public void Delete(DeleteModelOptions options = null)

Deletes this model. This method just creates a ModelReference and delegates to DeleteModel(ModelReference, DeleteModelOptions).

Parameter
Name Description
options DeleteModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

DeleteAsync(DeleteModelOptions, CancellationToken)

public Task DeleteAsync(DeleteModelOptions options = null, CancellationToken cancellationToken = default)

Asynchronously deletes this model. This method just creates a ModelReference and delegates to DeleteModelAsync(ModelReference, DeleteModelOptions, CancellationToken).

Parameters
Name Description
options DeleteModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns
Type Description
Task

A task representing the asynchronous operation.

Patch(Model, bool, PatchModelOptions)

public BigQueryModel Patch(Model resource, bool matchETag, PatchModelOptions options = null)

Patches this model with fields in the specified resource.

Parameters
Name Description
resource Model

The resource to patch with. Must not be null.

matchETag bool

If true, the etag from Resource is propagated into resource for optimistic concurrency. Otherwise, resource is left unchanged.

options PatchModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

Returns
Type Description
BigQueryModel

The updated model.

Remarks

PatchAsync(Model, bool, PatchModelOptions, CancellationToken)

public Task<BigQueryModel> PatchAsync(Model resource, bool matchETag, PatchModelOptions options = null, CancellationToken cancellationToken = default)

Asynchronously patches this model with fields in the specified resource.

Parameters
Name Description
resource Model

The resource to patch with. Must not be null.

matchETag bool

If true, the etag from Resource is propagated into resource for optimistic concurrency. Otherwise, resource is left unchanged.

options PatchModelOptions

The options for the operation. May be null, in which case defaults will be supplied.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns
Type Description
TaskBigQueryModel

A task representing the asynchronous operation. When complete, the result is the updated model.

Remarks