Google BigQuery v2 API - Class BigQueryModel (3.8.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
NameDescription
clientBigQueryClient

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

resourceModel

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
TypeDescription
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
TypeDescription
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
NameDescription
destinationUrisIEnumerablestring

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

optionsCreateModelExtractJobOptions

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

Returns
TypeDescription
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
NameDescription
destinationUristring

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

optionsCreateModelExtractJobOptions

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

Returns
TypeDescription
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
NameDescription
destinationUrisIEnumerablestring

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

optionsCreateModelExtractJobOptions

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

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
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
NameDescription
destinationUristring

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

optionsCreateModelExtractJobOptions

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

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
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
NameDescription
optionsDeleteModelOptions

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
NameDescription
optionsDeleteModelOptions

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

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
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
NameDescription
resourceModel

The resource to patch with. Must not be null.

matchETagbool

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

optionsPatchModelOptions

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

Returns
TypeDescription
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
NameDescription
resourceModel

The resource to patch with. Must not be null.

matchETagbool

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

optionsPatchModelOptions

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

cancellationTokenCancellationToken

The token to monitor for cancellation requests.

Returns
TypeDescription
TaskBigQueryModel

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

Remarks