Retail v2 API - Class ModelServiceClient (2.8.0)

public abstract class ModelServiceClient

Reference documentation and code samples for the Retail v2 API class ModelServiceClient.

ModelService client wrapper, for convenient use.

Inheritance

object > ModelServiceClient

Derived Types

Namespace

Google.Cloud.Retail.V2

Assembly

Google.Cloud.Retail.V2.dll

Remarks

Service for performing CRUD operations on models. Recommendation models contain all the metadata necessary to generate a set of models for the Predict() API. A model is queried indirectly via a ServingConfig, which associates a model with a given Placement (e.g. Frequently Bought Together on Home Page).

This service allows you to do the following:

  • Initiate training of a model.
  • Pause training of an existing model.
  • List all the available models along with their metadata.
  • Control their tuning schedule.

Properties

CreateModelOperationsClient

public virtual OperationsClient CreateModelOperationsClient { get; }

The long-running operations client for CreateModel.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the ModelService service, which is a host of "retail.googleapis.com" and a port of 443.

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default ModelService scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default ModelService scopes are:

GrpcClient

public virtual ModelService.ModelServiceClient GrpcClient { get; }

The underlying gRPC ModelService client

Property Value
TypeDescription
ModelServiceModelServiceClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
TypeDescription
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

TuneModelOperationsClient

public virtual OperationsClient TuneModelOperationsClient { get; }

The long-running operations client for TuneModel.

Property Value
TypeDescription
OperationsClient

Methods

Create()

public static ModelServiceClient Create()

Synchronously creates a ModelServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ModelServiceClientBuilder.

Returns
TypeDescription
ModelServiceClient

The created ModelServiceClient.

CreateAsync(CancellationToken)

public static Task<ModelServiceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a ModelServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ModelServiceClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskModelServiceClient

The task representing the created ModelServiceClient.

CreateModel(CatalogName, Model, CallSettings)

public virtual Operation<Model, CreateModelMetadata> CreateModel(CatalogName parent, Model model, CallSettings callSettings = null)

Creates a new model.

Parameters
NameDescription
parentCatalogName

Required. The parent resource under which to create the model. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

modelModel

Required. The payload of the [Model][google.cloud.retail.v2.Model] to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationModelCreateModelMetadata

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
Model model = new Model();
// Make the request
Operation<Model, CreateModelMetadata> response = modelServiceClient.CreateModel(parent, model);

// Poll until the returned long-running operation is complete
Operation<Model, CreateModelMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Model result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Model, CreateModelMetadata> retrievedResponse = modelServiceClient.PollOnceCreateModel(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Model retrievedResult = retrievedResponse.Result;
}

CreateModel(CreateModelRequest, CallSettings)

public virtual Operation<Model, CreateModelMetadata> CreateModel(CreateModelRequest request, CallSettings callSettings = null)

Creates a new model.

Parameters
NameDescription
requestCreateModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationModelCreateModelMetadata

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
CreateModelRequest request = new CreateModelRequest
{
    ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
    Model = new Model(),
    DryRun = false,
};
// Make the request
Operation<Model, CreateModelMetadata> response = modelServiceClient.CreateModel(request);

// Poll until the returned long-running operation is complete
Operation<Model, CreateModelMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Model result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Model, CreateModelMetadata> retrievedResponse = modelServiceClient.PollOnceCreateModel(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Model retrievedResult = retrievedResponse.Result;
}

CreateModel(string, Model, CallSettings)

public virtual Operation<Model, CreateModelMetadata> CreateModel(string parent, Model model, CallSettings callSettings = null)

Creates a new model.

Parameters
NameDescription
parentstring

Required. The parent resource under which to create the model. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

modelModel

Required. The payload of the [Model][google.cloud.retail.v2.Model] to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationModelCreateModelMetadata

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
Model model = new Model();
// Make the request
Operation<Model, CreateModelMetadata> response = modelServiceClient.CreateModel(parent, model);

// Poll until the returned long-running operation is complete
Operation<Model, CreateModelMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Model result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Model, CreateModelMetadata> retrievedResponse = modelServiceClient.PollOnceCreateModel(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Model retrievedResult = retrievedResponse.Result;
}

CreateModelAsync(CatalogName, Model, CallSettings)

public virtual Task<Operation<Model, CreateModelMetadata>> CreateModelAsync(CatalogName parent, Model model, CallSettings callSettings = null)

Creates a new model.

Parameters
NameDescription
parentCatalogName

Required. The parent resource under which to create the model. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

modelModel

Required. The payload of the [Model][google.cloud.retail.v2.Model] to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationModelCreateModelMetadata

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
Model model = new Model();
// Make the request
Operation<Model, CreateModelMetadata> response = await modelServiceClient.CreateModelAsync(parent, model);

// Poll until the returned long-running operation is complete
Operation<Model, CreateModelMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Model result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Model, CreateModelMetadata> retrievedResponse = await modelServiceClient.PollOnceCreateModelAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Model retrievedResult = retrievedResponse.Result;
}

CreateModelAsync(CatalogName, Model, CancellationToken)

public virtual Task<Operation<Model, CreateModelMetadata>> CreateModelAsync(CatalogName parent, Model model, CancellationToken cancellationToken)

Creates a new model.

Parameters
NameDescription
parentCatalogName

Required. The parent resource under which to create the model. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

modelModel

Required. The payload of the [Model][google.cloud.retail.v2.Model] to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationModelCreateModelMetadata

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
Model model = new Model();
// Make the request
Operation<Model, CreateModelMetadata> response = await modelServiceClient.CreateModelAsync(parent, model);

// Poll until the returned long-running operation is complete
Operation<Model, CreateModelMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Model result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Model, CreateModelMetadata> retrievedResponse = await modelServiceClient.PollOnceCreateModelAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Model retrievedResult = retrievedResponse.Result;
}

CreateModelAsync(CreateModelRequest, CallSettings)

public virtual Task<Operation<Model, CreateModelMetadata>> CreateModelAsync(CreateModelRequest request, CallSettings callSettings = null)

Creates a new model.

Parameters
NameDescription
requestCreateModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationModelCreateModelMetadata

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
CreateModelRequest request = new CreateModelRequest
{
    ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
    Model = new Model(),
    DryRun = false,
};
// Make the request
Operation<Model, CreateModelMetadata> response = await modelServiceClient.CreateModelAsync(request);

// Poll until the returned long-running operation is complete
Operation<Model, CreateModelMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Model result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Model, CreateModelMetadata> retrievedResponse = await modelServiceClient.PollOnceCreateModelAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Model retrievedResult = retrievedResponse.Result;
}

CreateModelAsync(CreateModelRequest, CancellationToken)

public virtual Task<Operation<Model, CreateModelMetadata>> CreateModelAsync(CreateModelRequest request, CancellationToken cancellationToken)

Creates a new model.

Parameters
NameDescription
requestCreateModelRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationModelCreateModelMetadata

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
CreateModelRequest request = new CreateModelRequest
{
    ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
    Model = new Model(),
    DryRun = false,
};
// Make the request
Operation<Model, CreateModelMetadata> response = await modelServiceClient.CreateModelAsync(request);

// Poll until the returned long-running operation is complete
Operation<Model, CreateModelMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Model result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Model, CreateModelMetadata> retrievedResponse = await modelServiceClient.PollOnceCreateModelAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Model retrievedResult = retrievedResponse.Result;
}

CreateModelAsync(string, Model, CallSettings)

public virtual Task<Operation<Model, CreateModelMetadata>> CreateModelAsync(string parent, Model model, CallSettings callSettings = null)

Creates a new model.

Parameters
NameDescription
parentstring

Required. The parent resource under which to create the model. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

modelModel

Required. The payload of the [Model][google.cloud.retail.v2.Model] to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationModelCreateModelMetadata

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
Model model = new Model();
// Make the request
Operation<Model, CreateModelMetadata> response = await modelServiceClient.CreateModelAsync(parent, model);

// Poll until the returned long-running operation is complete
Operation<Model, CreateModelMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Model result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Model, CreateModelMetadata> retrievedResponse = await modelServiceClient.PollOnceCreateModelAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Model retrievedResult = retrievedResponse.Result;
}

CreateModelAsync(string, Model, CancellationToken)

public virtual Task<Operation<Model, CreateModelMetadata>> CreateModelAsync(string parent, Model model, CancellationToken cancellationToken)

Creates a new model.

Parameters
NameDescription
parentstring

Required. The parent resource under which to create the model. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

modelModel

Required. The payload of the [Model][google.cloud.retail.v2.Model] to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationModelCreateModelMetadata

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
Model model = new Model();
// Make the request
Operation<Model, CreateModelMetadata> response = await modelServiceClient.CreateModelAsync(parent, model);

// Poll until the returned long-running operation is complete
Operation<Model, CreateModelMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Model result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Model, CreateModelMetadata> retrievedResponse = await modelServiceClient.PollOnceCreateModelAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Model retrievedResult = retrievedResponse.Result;
}

DeleteModel(DeleteModelRequest, CallSettings)

public virtual void DeleteModel(DeleteModelRequest request, CallSettings callSettings = null)

Deletes an existing model.

Parameters
NameDescription
requestDeleteModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
DeleteModelRequest request = new DeleteModelRequest
{
    ModelName = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"),
};
// Make the request
modelServiceClient.DeleteModel(request);

DeleteModel(ModelName, CallSettings)

public virtual void DeleteModel(ModelName name, CallSettings callSettings = null)

Deletes an existing model.

Parameters
NameDescription
nameModelName

Required. The resource name of the [Model][google.cloud.retail.v2.Model] to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
// Make the request
modelServiceClient.DeleteModel(name);

DeleteModel(string, CallSettings)

public virtual void DeleteModel(string name, CallSettings callSettings = null)

Deletes an existing model.

Parameters
NameDescription
namestring

Required. The resource name of the [Model][google.cloud.retail.v2.Model] to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/models/[MODEL]";
// Make the request
modelServiceClient.DeleteModel(name);

DeleteModelAsync(DeleteModelRequest, CallSettings)

public virtual Task DeleteModelAsync(DeleteModelRequest request, CallSettings callSettings = null)

Deletes an existing model.

Parameters
NameDescription
requestDeleteModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteModelRequest request = new DeleteModelRequest
{
    ModelName = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"),
};
// Make the request
await modelServiceClient.DeleteModelAsync(request);

DeleteModelAsync(DeleteModelRequest, CancellationToken)

public virtual Task DeleteModelAsync(DeleteModelRequest request, CancellationToken cancellationToken)

Deletes an existing model.

Parameters
NameDescription
requestDeleteModelRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteModelRequest request = new DeleteModelRequest
{
    ModelName = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"),
};
// Make the request
await modelServiceClient.DeleteModelAsync(request);

DeleteModelAsync(ModelName, CallSettings)

public virtual Task DeleteModelAsync(ModelName name, CallSettings callSettings = null)

Deletes an existing model.

Parameters
NameDescription
nameModelName

Required. The resource name of the [Model][google.cloud.retail.v2.Model] to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
// Make the request
await modelServiceClient.DeleteModelAsync(name);

DeleteModelAsync(ModelName, CancellationToken)

public virtual Task DeleteModelAsync(ModelName name, CancellationToken cancellationToken)

Deletes an existing model.

Parameters
NameDescription
nameModelName

Required. The resource name of the [Model][google.cloud.retail.v2.Model] to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
// Make the request
await modelServiceClient.DeleteModelAsync(name);

DeleteModelAsync(string, CallSettings)

public virtual Task DeleteModelAsync(string name, CallSettings callSettings = null)

Deletes an existing model.

Parameters
NameDescription
namestring

Required. The resource name of the [Model][google.cloud.retail.v2.Model] to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/models/[MODEL]";
// Make the request
await modelServiceClient.DeleteModelAsync(name);

DeleteModelAsync(string, CancellationToken)

public virtual Task DeleteModelAsync(string name, CancellationToken cancellationToken)

Deletes an existing model.

Parameters
NameDescription
namestring

Required. The resource name of the [Model][google.cloud.retail.v2.Model] to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/models/[MODEL]";
// Make the request
await modelServiceClient.DeleteModelAsync(name);

GetModel(GetModelRequest, CallSettings)

public virtual Model GetModel(GetModelRequest request, CallSettings callSettings = null)

Gets a model.

Parameters
NameDescription
requestGetModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Model

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
GetModelRequest request = new GetModelRequest
{
    ModelName = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"),
};
// Make the request
Model response = modelServiceClient.GetModel(request);

GetModel(ModelName, CallSettings)

public virtual Model GetModel(ModelName name, CallSettings callSettings = null)

Gets a model.

Parameters
NameDescription
nameModelName

Required. The resource name of the [Model][google.cloud.retail.v2.Model] to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Model

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
// Make the request
Model response = modelServiceClient.GetModel(name);

GetModel(string, CallSettings)

public virtual Model GetModel(string name, CallSettings callSettings = null)

Gets a model.

Parameters
NameDescription
namestring

Required. The resource name of the [Model][google.cloud.retail.v2.Model] to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Model

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/models/[MODEL]";
// Make the request
Model response = modelServiceClient.GetModel(name);

GetModelAsync(GetModelRequest, CallSettings)

public virtual Task<Model> GetModelAsync(GetModelRequest request, CallSettings callSettings = null)

Gets a model.

Parameters
NameDescription
requestGetModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
GetModelRequest request = new GetModelRequest
{
    ModelName = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"),
};
// Make the request
Model response = await modelServiceClient.GetModelAsync(request);

GetModelAsync(GetModelRequest, CancellationToken)

public virtual Task<Model> GetModelAsync(GetModelRequest request, CancellationToken cancellationToken)

Gets a model.

Parameters
NameDescription
requestGetModelRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
GetModelRequest request = new GetModelRequest
{
    ModelName = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"),
};
// Make the request
Model response = await modelServiceClient.GetModelAsync(request);

GetModelAsync(ModelName, CallSettings)

public virtual Task<Model> GetModelAsync(ModelName name, CallSettings callSettings = null)

Gets a model.

Parameters
NameDescription
nameModelName

Required. The resource name of the [Model][google.cloud.retail.v2.Model] to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
// Make the request
Model response = await modelServiceClient.GetModelAsync(name);

GetModelAsync(ModelName, CancellationToken)

public virtual Task<Model> GetModelAsync(ModelName name, CancellationToken cancellationToken)

Gets a model.

Parameters
NameDescription
nameModelName

Required. The resource name of the [Model][google.cloud.retail.v2.Model] to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
// Make the request
Model response = await modelServiceClient.GetModelAsync(name);

GetModelAsync(string, CallSettings)

public virtual Task<Model> GetModelAsync(string name, CallSettings callSettings = null)

Gets a model.

Parameters
NameDescription
namestring

Required. The resource name of the [Model][google.cloud.retail.v2.Model] to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/models/[MODEL]";
// Make the request
Model response = await modelServiceClient.GetModelAsync(name);

GetModelAsync(string, CancellationToken)

public virtual Task<Model> GetModelAsync(string name, CancellationToken cancellationToken)

Gets a model.

Parameters
NameDescription
namestring

Required. The resource name of the [Model][google.cloud.retail.v2.Model] to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog}/models/{model_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/models/[MODEL]";
// Make the request
Model response = await modelServiceClient.GetModelAsync(name);

ListModels(CatalogName, string, int?, CallSettings)

public virtual PagedEnumerable<ListModelsResponse, Model> ListModels(CatalogName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all the models linked to this event store.

Parameters
NameDescription
parentCatalogName

Required. The parent for which to list models. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListModelsResponseModel

A pageable sequence of Model resources.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
// Make the request
PagedEnumerable<ListModelsResponse, Model> response = modelServiceClient.ListModels(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Model item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListModelsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Model item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Model> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Model item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListModels(ListModelsRequest, CallSettings)

public virtual PagedEnumerable<ListModelsResponse, Model> ListModels(ListModelsRequest request, CallSettings callSettings = null)

Lists all the models linked to this event store.

Parameters
NameDescription
requestListModelsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListModelsResponseModel

A pageable sequence of Model resources.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
ListModelsRequest request = new ListModelsRequest
{
    ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
};
// Make the request
PagedEnumerable<ListModelsResponse, Model> response = modelServiceClient.ListModels(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Model item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListModelsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Model item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Model> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Model item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListModels(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListModelsResponse, Model> ListModels(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all the models linked to this event store.

Parameters
NameDescription
parentstring

Required. The parent for which to list models. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListModelsResponseModel

A pageable sequence of Model resources.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
// Make the request
PagedEnumerable<ListModelsResponse, Model> response = modelServiceClient.ListModels(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Model item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListModelsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Model item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Model> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Model item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListModelsAsync(CatalogName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListModelsResponse, Model> ListModelsAsync(CatalogName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all the models linked to this event store.

Parameters
NameDescription
parentCatalogName

Required. The parent for which to list models. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListModelsResponseModel

A pageable asynchronous sequence of Model resources.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
// Make the request
PagedAsyncEnumerable<ListModelsResponse, Model> response = modelServiceClient.ListModelsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Model item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListModelsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Model item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Model> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Model item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListModelsAsync(ListModelsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListModelsResponse, Model> ListModelsAsync(ListModelsRequest request, CallSettings callSettings = null)

Lists all the models linked to this event store.

Parameters
NameDescription
requestListModelsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListModelsResponseModel

A pageable asynchronous sequence of Model resources.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
ListModelsRequest request = new ListModelsRequest
{
    ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
};
// Make the request
PagedAsyncEnumerable<ListModelsResponse, Model> response = modelServiceClient.ListModelsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Model item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListModelsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Model item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Model> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Model item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListModelsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListModelsResponse, Model> ListModelsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all the models linked to this event store.

Parameters
NameDescription
parentstring

Required. The parent for which to list models. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListModelsResponseModel

A pageable asynchronous sequence of Model resources.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
// Make the request
PagedAsyncEnumerable<ListModelsResponse, Model> response = modelServiceClient.ListModelsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Model item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListModelsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Model item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Model> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Model item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

PauseModel(ModelName, CallSettings)

public virtual Model PauseModel(ModelName name, CallSettings callSettings = null)

Pauses the training of an existing model.

Parameters
NameDescription
nameModelName

Required. The name of the model to pause. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Model

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
// Make the request
Model response = modelServiceClient.PauseModel(name);

PauseModel(PauseModelRequest, CallSettings)

public virtual Model PauseModel(PauseModelRequest request, CallSettings callSettings = null)

Pauses the training of an existing model.

Parameters
NameDescription
requestPauseModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Model

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
PauseModelRequest request = new PauseModelRequest
{
    ModelName = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"),
};
// Make the request
Model response = modelServiceClient.PauseModel(request);

PauseModel(string, CallSettings)

public virtual Model PauseModel(string name, CallSettings callSettings = null)

Pauses the training of an existing model.

Parameters
NameDescription
namestring

Required. The name of the model to pause. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Model

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/models/[MODEL]";
// Make the request
Model response = modelServiceClient.PauseModel(name);

PauseModelAsync(ModelName, CallSettings)

public virtual Task<Model> PauseModelAsync(ModelName name, CallSettings callSettings = null)

Pauses the training of an existing model.

Parameters
NameDescription
nameModelName

Required. The name of the model to pause. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
// Make the request
Model response = await modelServiceClient.PauseModelAsync(name);

PauseModelAsync(ModelName, CancellationToken)

public virtual Task<Model> PauseModelAsync(ModelName name, CancellationToken cancellationToken)

Pauses the training of an existing model.

Parameters
NameDescription
nameModelName

Required. The name of the model to pause. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
// Make the request
Model response = await modelServiceClient.PauseModelAsync(name);

PauseModelAsync(PauseModelRequest, CallSettings)

public virtual Task<Model> PauseModelAsync(PauseModelRequest request, CallSettings callSettings = null)

Pauses the training of an existing model.

Parameters
NameDescription
requestPauseModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
PauseModelRequest request = new PauseModelRequest
{
    ModelName = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"),
};
// Make the request
Model response = await modelServiceClient.PauseModelAsync(request);

PauseModelAsync(PauseModelRequest, CancellationToken)

public virtual Task<Model> PauseModelAsync(PauseModelRequest request, CancellationToken cancellationToken)

Pauses the training of an existing model.

Parameters
NameDescription
requestPauseModelRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
PauseModelRequest request = new PauseModelRequest
{
    ModelName = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"),
};
// Make the request
Model response = await modelServiceClient.PauseModelAsync(request);

PauseModelAsync(string, CallSettings)

public virtual Task<Model> PauseModelAsync(string name, CallSettings callSettings = null)

Pauses the training of an existing model.

Parameters
NameDescription
namestring

Required. The name of the model to pause. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/models/[MODEL]";
// Make the request
Model response = await modelServiceClient.PauseModelAsync(name);

PauseModelAsync(string, CancellationToken)

public virtual Task<Model> PauseModelAsync(string name, CancellationToken cancellationToken)

Pauses the training of an existing model.

Parameters
NameDescription
namestring

Required. The name of the model to pause. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/models/[MODEL]";
// Make the request
Model response = await modelServiceClient.PauseModelAsync(name);

PollOnceCreateModel(string, CallSettings)

public virtual Operation<Model, CreateModelMetadata> PollOnceCreateModel(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of CreateModel.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationModelCreateModelMetadata

The result of polling the operation.

PollOnceCreateModelAsync(string, CallSettings)

public virtual Task<Operation<Model, CreateModelMetadata>> PollOnceCreateModelAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of CreateModel.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationModelCreateModelMetadata

A task representing the result of polling the operation.

PollOnceTuneModel(string, CallSettings)

public virtual Operation<TuneModelResponse, TuneModelMetadata> PollOnceTuneModel(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of TuneModel.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationTuneModelResponseTuneModelMetadata

The result of polling the operation.

PollOnceTuneModelAsync(string, CallSettings)

public virtual Task<Operation<TuneModelResponse, TuneModelMetadata>> PollOnceTuneModelAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of TuneModel.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationTuneModelResponseTuneModelMetadata

A task representing the result of polling the operation.

ResumeModel(ResumeModelRequest, CallSettings)

public virtual Model ResumeModel(ResumeModelRequest request, CallSettings callSettings = null)

Resumes the training of an existing model.

Parameters
NameDescription
requestResumeModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Model

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
ResumeModelRequest request = new ResumeModelRequest { Name = "", };
// Make the request
Model response = modelServiceClient.ResumeModel(request);

ResumeModel(string, CallSettings)

public virtual Model ResumeModel(string name, CallSettings callSettings = null)

Resumes the training of an existing model.

Parameters
NameDescription
namestring

Required. The name of the model to resume. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Model

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
string name = "";
// Make the request
Model response = modelServiceClient.ResumeModel(name);

ResumeModelAsync(ResumeModelRequest, CallSettings)

public virtual Task<Model> ResumeModelAsync(ResumeModelRequest request, CallSettings callSettings = null)

Resumes the training of an existing model.

Parameters
NameDescription
requestResumeModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
ResumeModelRequest request = new ResumeModelRequest { Name = "", };
// Make the request
Model response = await modelServiceClient.ResumeModelAsync(request);

ResumeModelAsync(ResumeModelRequest, CancellationToken)

public virtual Task<Model> ResumeModelAsync(ResumeModelRequest request, CancellationToken cancellationToken)

Resumes the training of an existing model.

Parameters
NameDescription
requestResumeModelRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
ResumeModelRequest request = new ResumeModelRequest { Name = "", };
// Make the request
Model response = await modelServiceClient.ResumeModelAsync(request);

ResumeModelAsync(string, CallSettings)

public virtual Task<Model> ResumeModelAsync(string name, CallSettings callSettings = null)

Resumes the training of an existing model.

Parameters
NameDescription
namestring

Required. The name of the model to resume. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
Model response = await modelServiceClient.ResumeModelAsync(name);

ResumeModelAsync(string, CancellationToken)

public virtual Task<Model> ResumeModelAsync(string name, CancellationToken cancellationToken)

Resumes the training of an existing model.

Parameters
NameDescription
namestring

Required. The name of the model to resume. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
// Make the request
Model response = await modelServiceClient.ResumeModelAsync(name);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

TuneModel(ModelName, CallSettings)

public virtual Operation<TuneModelResponse, TuneModelMetadata> TuneModel(ModelName name, CallSettings callSettings = null)

Tunes an existing model.

Parameters
NameDescription
nameModelName

Required. The resource name of the model to tune. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationTuneModelResponseTuneModelMetadata

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
// Make the request
Operation<TuneModelResponse, TuneModelMetadata> response = modelServiceClient.TuneModel(name);

// Poll until the returned long-running operation is complete
Operation<TuneModelResponse, TuneModelMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
TuneModelResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TuneModelResponse, TuneModelMetadata> retrievedResponse = modelServiceClient.PollOnceTuneModel(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TuneModelResponse retrievedResult = retrievedResponse.Result;
}

TuneModel(TuneModelRequest, CallSettings)

public virtual Operation<TuneModelResponse, TuneModelMetadata> TuneModel(TuneModelRequest request, CallSettings callSettings = null)

Tunes an existing model.

Parameters
NameDescription
requestTuneModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationTuneModelResponseTuneModelMetadata

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
TuneModelRequest request = new TuneModelRequest
{
    ModelName = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"),
};
// Make the request
Operation<TuneModelResponse, TuneModelMetadata> response = modelServiceClient.TuneModel(request);

// Poll until the returned long-running operation is complete
Operation<TuneModelResponse, TuneModelMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
TuneModelResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TuneModelResponse, TuneModelMetadata> retrievedResponse = modelServiceClient.PollOnceTuneModel(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TuneModelResponse retrievedResult = retrievedResponse.Result;
}

TuneModel(string, CallSettings)

public virtual Operation<TuneModelResponse, TuneModelMetadata> TuneModel(string name, CallSettings callSettings = null)

Tunes an existing model.

Parameters
NameDescription
namestring

Required. The resource name of the model to tune. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationTuneModelResponseTuneModelMetadata

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/models/[MODEL]";
// Make the request
Operation<TuneModelResponse, TuneModelMetadata> response = modelServiceClient.TuneModel(name);

// Poll until the returned long-running operation is complete
Operation<TuneModelResponse, TuneModelMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
TuneModelResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TuneModelResponse, TuneModelMetadata> retrievedResponse = modelServiceClient.PollOnceTuneModel(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TuneModelResponse retrievedResult = retrievedResponse.Result;
}

TuneModelAsync(ModelName, CallSettings)

public virtual Task<Operation<TuneModelResponse, TuneModelMetadata>> TuneModelAsync(ModelName name, CallSettings callSettings = null)

Tunes an existing model.

Parameters
NameDescription
nameModelName

Required. The resource name of the model to tune. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationTuneModelResponseTuneModelMetadata

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
// Make the request
Operation<TuneModelResponse, TuneModelMetadata> response = await modelServiceClient.TuneModelAsync(name);

// Poll until the returned long-running operation is complete
Operation<TuneModelResponse, TuneModelMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TuneModelResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TuneModelResponse, TuneModelMetadata> retrievedResponse = await modelServiceClient.PollOnceTuneModelAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TuneModelResponse retrievedResult = retrievedResponse.Result;
}

TuneModelAsync(ModelName, CancellationToken)

public virtual Task<Operation<TuneModelResponse, TuneModelMetadata>> TuneModelAsync(ModelName name, CancellationToken cancellationToken)

Tunes an existing model.

Parameters
NameDescription
nameModelName

Required. The resource name of the model to tune. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationTuneModelResponseTuneModelMetadata

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
// Make the request
Operation<TuneModelResponse, TuneModelMetadata> response = await modelServiceClient.TuneModelAsync(name);

// Poll until the returned long-running operation is complete
Operation<TuneModelResponse, TuneModelMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TuneModelResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TuneModelResponse, TuneModelMetadata> retrievedResponse = await modelServiceClient.PollOnceTuneModelAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TuneModelResponse retrievedResult = retrievedResponse.Result;
}

TuneModelAsync(TuneModelRequest, CallSettings)

public virtual Task<Operation<TuneModelResponse, TuneModelMetadata>> TuneModelAsync(TuneModelRequest request, CallSettings callSettings = null)

Tunes an existing model.

Parameters
NameDescription
requestTuneModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationTuneModelResponseTuneModelMetadata

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
TuneModelRequest request = new TuneModelRequest
{
    ModelName = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"),
};
// Make the request
Operation<TuneModelResponse, TuneModelMetadata> response = await modelServiceClient.TuneModelAsync(request);

// Poll until the returned long-running operation is complete
Operation<TuneModelResponse, TuneModelMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TuneModelResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TuneModelResponse, TuneModelMetadata> retrievedResponse = await modelServiceClient.PollOnceTuneModelAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TuneModelResponse retrievedResult = retrievedResponse.Result;
}

TuneModelAsync(TuneModelRequest, CancellationToken)

public virtual Task<Operation<TuneModelResponse, TuneModelMetadata>> TuneModelAsync(TuneModelRequest request, CancellationToken cancellationToken)

Tunes an existing model.

Parameters
NameDescription
requestTuneModelRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationTuneModelResponseTuneModelMetadata

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
TuneModelRequest request = new TuneModelRequest
{
    ModelName = ModelName.FromProjectLocationCatalogModel("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"),
};
// Make the request
Operation<TuneModelResponse, TuneModelMetadata> response = await modelServiceClient.TuneModelAsync(request);

// Poll until the returned long-running operation is complete
Operation<TuneModelResponse, TuneModelMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TuneModelResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TuneModelResponse, TuneModelMetadata> retrievedResponse = await modelServiceClient.PollOnceTuneModelAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TuneModelResponse retrievedResult = retrievedResponse.Result;
}

TuneModelAsync(string, CallSettings)

public virtual Task<Operation<TuneModelResponse, TuneModelMetadata>> TuneModelAsync(string name, CallSettings callSettings = null)

Tunes an existing model.

Parameters
NameDescription
namestring

Required. The resource name of the model to tune. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationTuneModelResponseTuneModelMetadata

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/models/[MODEL]";
// Make the request
Operation<TuneModelResponse, TuneModelMetadata> response = await modelServiceClient.TuneModelAsync(name);

// Poll until the returned long-running operation is complete
Operation<TuneModelResponse, TuneModelMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TuneModelResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TuneModelResponse, TuneModelMetadata> retrievedResponse = await modelServiceClient.PollOnceTuneModelAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TuneModelResponse retrievedResult = retrievedResponse.Result;
}

TuneModelAsync(string, CancellationToken)

public virtual Task<Operation<TuneModelResponse, TuneModelMetadata>> TuneModelAsync(string name, CancellationToken cancellationToken)

Tunes an existing model.

Parameters
NameDescription
namestring

Required. The resource name of the model to tune. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationTuneModelResponseTuneModelMetadata

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/models/[MODEL]";
// Make the request
Operation<TuneModelResponse, TuneModelMetadata> response = await modelServiceClient.TuneModelAsync(name);

// Poll until the returned long-running operation is complete
Operation<TuneModelResponse, TuneModelMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
TuneModelResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<TuneModelResponse, TuneModelMetadata> retrievedResponse = await modelServiceClient.PollOnceTuneModelAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    TuneModelResponse retrievedResult = retrievedResponse.Result;
}

UpdateModel(Model, FieldMask, CallSettings)

public virtual Model UpdateModel(Model model, FieldMask updateMask, CallSettings callSettings = null)

Update of model metadata. Only fields that currently can be updated are: filtering_option and periodic_tuning_state. If other values are provided, this API method ignores them.

Parameters
NameDescription
modelModel

Required. The body of the updated [Model][google.cloud.retail.v2.Model].

updateMaskFieldMask

Optional. Indicates which fields in the provided 'model' to update. If not set, by default updates all fields.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Model

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
Model model = new Model();
FieldMask updateMask = new FieldMask();
// Make the request
Model response = modelServiceClient.UpdateModel(model, updateMask);

UpdateModel(UpdateModelRequest, CallSettings)

public virtual Model UpdateModel(UpdateModelRequest request, CallSettings callSettings = null)

Update of model metadata. Only fields that currently can be updated are: filtering_option and periodic_tuning_state. If other values are provided, this API method ignores them.

Parameters
NameDescription
requestUpdateModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Model

The RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = ModelServiceClient.Create();
// Initialize request argument(s)
UpdateModelRequest request = new UpdateModelRequest
{
    Model = new Model(),
    UpdateMask = new FieldMask(),
};
// Make the request
Model response = modelServiceClient.UpdateModel(request);

UpdateModelAsync(Model, FieldMask, CallSettings)

public virtual Task<Model> UpdateModelAsync(Model model, FieldMask updateMask, CallSettings callSettings = null)

Update of model metadata. Only fields that currently can be updated are: filtering_option and periodic_tuning_state. If other values are provided, this API method ignores them.

Parameters
NameDescription
modelModel

Required. The body of the updated [Model][google.cloud.retail.v2.Model].

updateMaskFieldMask

Optional. Indicates which fields in the provided 'model' to update. If not set, by default updates all fields.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
Model model = new Model();
FieldMask updateMask = new FieldMask();
// Make the request
Model response = await modelServiceClient.UpdateModelAsync(model, updateMask);

UpdateModelAsync(Model, FieldMask, CancellationToken)

public virtual Task<Model> UpdateModelAsync(Model model, FieldMask updateMask, CancellationToken cancellationToken)

Update of model metadata. Only fields that currently can be updated are: filtering_option and periodic_tuning_state. If other values are provided, this API method ignores them.

Parameters
NameDescription
modelModel

Required. The body of the updated [Model][google.cloud.retail.v2.Model].

updateMaskFieldMask

Optional. Indicates which fields in the provided 'model' to update. If not set, by default updates all fields.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
Model model = new Model();
FieldMask updateMask = new FieldMask();
// Make the request
Model response = await modelServiceClient.UpdateModelAsync(model, updateMask);

UpdateModelAsync(UpdateModelRequest, CallSettings)

public virtual Task<Model> UpdateModelAsync(UpdateModelRequest request, CallSettings callSettings = null)

Update of model metadata. Only fields that currently can be updated are: filtering_option and periodic_tuning_state. If other values are provided, this API method ignores them.

Parameters
NameDescription
requestUpdateModelRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateModelRequest request = new UpdateModelRequest
{
    Model = new Model(),
    UpdateMask = new FieldMask(),
};
// Make the request
Model response = await modelServiceClient.UpdateModelAsync(request);

UpdateModelAsync(UpdateModelRequest, CancellationToken)

public virtual Task<Model> UpdateModelAsync(UpdateModelRequest request, CancellationToken cancellationToken)

Update of model metadata. Only fields that currently can be updated are: filtering_option and periodic_tuning_state. If other values are provided, this API method ignores them.

Parameters
NameDescription
requestUpdateModelRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskModel

A Task containing the RPC response.

Example
// Create client
ModelServiceClient modelServiceClient = await ModelServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateModelRequest request = new UpdateModelRequest
{
    Model = new Model(),
    UpdateMask = new FieldMask(),
};
// Make the request
Model response = await modelServiceClient.UpdateModelAsync(request);