# Google BigQuery v2 API - Class BigQueryModel (3.12.0)

3.12.0 (latest) 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.4.0 2.3.0 2.2.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](https://learn.microsoft.com/dotnet/api/system.object) \> BigQueryModel

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.BigQuery.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient` The client to use for operations on the model. Must not be null. |
| `resource` | `https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.Model.html` 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** |
| `https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.ModelReference.html` |   |

**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** |
| `https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.Model.html` |   |

**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](https://cloud.google.com/bigquery-ml/docs/exporting-models) for more information on model extract jobs.
This method just creates a [ModelReference](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.ModelReference.html) and delegates to [CreateModelExtractJob(ModelReference, IEnumerable\<string\>, CreateModelExtractJobOptions)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient#Google_Cloud_BigQuery_V2_BigQueryClient_CreateModelExtractJob_Google_Apis_Bigquery_v2_Data_ModelReference_System_Collections_Generic_IEnumerable_System_String__Google_Cloud_BigQuery_V2_CreateModelExtractJobOptions_).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `destinationUris` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://learn.microsoft.com/dotnet/api/system.string` The Google Cloud Storage URIs (possibly including a wildcard) to extract the model to. Must not be null or empty. |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.CreateModelExtractJobOptions` The options for the operation. May be null, in which case defaults will be supplied. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.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](https://cloud.google.com/bigquery-ml/docs/exporting-models) for more information on model extract jobs.
This method just creates a [ModelReference](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.ModelReference.html) and delegates to [CreateModelExtractJob(ModelReference, string, CreateModelExtractJobOptions)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient#Google_Cloud_BigQuery_V2_BigQueryClient_CreateModelExtractJob_Google_Apis_Bigquery_v2_Data_ModelReference_System_String_Google_Cloud_BigQuery_V2_CreateModelExtractJobOptions_).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `destinationUri` | `https://learn.microsoft.com/dotnet/api/system.string` The Google Cloud Storage URI (possibly including a wildcard) to extract the model to. Must not be null. |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.CreateModelExtractJobOptions` The options for the operation. May be null, in which case defaults will be supplied. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.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](https://cloud.google.com/bigquery-ml/docs/exporting-models) for more information on model extract jobs.
This method just creates a [ModelReference](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.ModelReference.html) and delegates to [CreateModelExtractJobAsync(ModelReference, IEnumerable\<string\>, CreateModelExtractJobOptions, CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient#Google_Cloud_BigQuery_V2_BigQueryClient_CreateModelExtractJobAsync_Google_Apis_Bigquery_v2_Data_ModelReference_System_Collections_Generic_IEnumerable_System_String__Google_Cloud_BigQuery_V2_CreateModelExtractJobOptions_System_Threading_CancellationToken_).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `destinationUris` | `https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1https://learn.microsoft.com/dotnet/api/system.string` The Google Cloud Storage URIs (possibly including a wildcard) to extract the model to. Must not be null or empty. |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.CreateModelExtractJobOptions` The options for the operation. May be null, in which case defaults will be supplied. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The token to monitor for cancellation requests. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryJob` | 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](https://cloud.google.com/bigquery-ml/docs/exporting-models) for more information on model extract jobs.
This method just creates a [ModelReference](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.ModelReference.html) and delegates to [CreateModelExtractJobAsync(ModelReference, string, CreateModelExtractJobOptions, CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient#Google_Cloud_BigQuery_V2_BigQueryClient_CreateModelExtractJobAsync_Google_Apis_Bigquery_v2_Data_ModelReference_System_String_Google_Cloud_BigQuery_V2_CreateModelExtractJobOptions_System_Threading_CancellationToken_).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `destinationUri` | `https://learn.microsoft.com/dotnet/api/system.string` The Google Cloud Storage URI (possibly including a wildcard) to extract the model to. Must not be null or empty. |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.CreateModelExtractJobOptions` The options for the operation. May be null, in which case defaults will be supplied. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The token to monitor for cancellation requests. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryJob` | 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](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.ModelReference.html) and delegates to [DeleteModel(ModelReference, DeleteModelOptions)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient#Google_Cloud_BigQuery_V2_BigQueryClient_DeleteModel_Google_Apis_Bigquery_v2_Data_ModelReference_Google_Cloud_BigQuery_V2_DeleteModelOptions_).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.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](https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.ModelReference.html) and delegates to [DeleteModelAsync(ModelReference, DeleteModelOptions, CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient#Google_Cloud_BigQuery_V2_BigQueryClient_DeleteModelAsync_Google_Apis_Bigquery_v2_Data_ModelReference_Google_Cloud_BigQuery_V2_DeleteModelOptions_System_Threading_CancellationToken_).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.DeleteModelOptions` The options for the operation. May be null, in which case defaults will be supplied. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The token to monitor for cancellation requests. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.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` | `https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.Model.html` The resource to patch with. Must not be null. |
| `matchETag` | `https://learn.microsoft.com/dotnet/api/system.boolean` If true, the etag from [Resource](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryModel#Google_Cloud_BigQuery_V2_BigQueryModel_Resource) is propagated into `resource` for optimistic concurrency. Otherwise, `resource` is left unchanged. |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.PatchModelOptions` The options for the operation. May be null, in which case defaults will be supplied. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryModel` | The updated model. |

**Remarks** This method delegates to [PatchModel(ModelReference, Model, PatchModelOptions)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient#Google_Cloud_BigQuery_V2_BigQueryClient_PatchModel_Google_Apis_Bigquery_v2_Data_ModelReference_Google_Apis_Bigquery_v2_Data_Model_Google_Cloud_BigQuery_V2_PatchModelOptions_).

### 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` | `https://googleapis.dev/dotnet/Google.Apis.Bigquery.v2/1.74.0.4090/api/Google.Apis.Bigquery.v2.Data.Model.html` The resource to patch with. Must not be null. |
| `matchETag` | `https://learn.microsoft.com/dotnet/api/system.boolean` If true, the etag from [Resource](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryModel#Google_Cloud_BigQuery_V2_BigQueryModel_Resource) is propagated into `resource` for optimistic concurrency. Otherwise, `resource` is left unchanged. |
| `options` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.PatchModelOptions` The options for the operation. May be null, in which case defaults will be supplied. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The token to monitor for cancellation requests. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryModel` | A task representing the asynchronous operation. When complete, the result is the updated model. |

**Remarks** This method delegates to [PatchModelAsync(ModelReference, Model, PatchModelOptions, CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BigQuery.V2/latest/Google.Cloud.BigQuery.V2.BigQueryClient#Google_Cloud_BigQuery_V2_BigQueryClient_PatchModelAsync_Google_Apis_Bigquery_v2_Data_ModelReference_Google_Apis_Bigquery_v2_Data_Model_Google_Cloud_BigQuery_V2_PatchModelOptions_System_Threading_CancellationToken_).