Retail v2 API - Class ModelServiceClientImpl (2.8.0)

public sealed class ModelServiceClientImpl : ModelServiceClient

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

ModelService client wrapper implementation, for convenient use.

Inheritance

object > ModelServiceClient > ModelServiceClientImpl

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.

Constructors

ModelServiceClientImpl(ModelServiceClient, ModelServiceSettings, ILogger)

public ModelServiceClientImpl(ModelService.ModelServiceClient grpcClient, ModelServiceSettings settings, ILogger logger)

Constructs a client wrapper for the ModelService service, with the specified gRPC client and settings.

Parameters
Name Description
grpcClient ModelServiceModelServiceClient

The underlying gRPC client.

settings ModelServiceSettings

The base ModelServiceSettings used within this client.

logger ILogger

Optional ILogger to use within this client.

Properties

CreateModelOperationsClient

public override OperationsClient CreateModelOperationsClient { get; }

The long-running operations client for CreateModel.

Property Value
Type Description
OperationsClient
Overrides

GrpcClient

public override ModelService.ModelServiceClient GrpcClient { get; }

The underlying gRPC ModelService client

Property Value
Type Description
ModelServiceModelServiceClient
Overrides

LocationsClient

public override LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient
Overrides

TuneModelOperationsClient

public override OperationsClient TuneModelOperationsClient { get; }

The long-running operations client for TuneModel.

Property Value
Type Description
OperationsClient
Overrides

Methods

CreateModel(CreateModelRequest, CallSettings)

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

Creates a new model.

Parameters
Name Description
request CreateModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationModelCreateModelMetadata

The RPC response.

Overrides

CreateModelAsync(CreateModelRequest, CallSettings)

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

Creates a new model.

Parameters
Name Description
request CreateModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationModelCreateModelMetadata

A Task containing the RPC response.

Overrides

DeleteModel(DeleteModelRequest, CallSettings)

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

Deletes an existing model.

Parameters
Name Description
request DeleteModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Overrides

DeleteModelAsync(DeleteModelRequest, CallSettings)

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

Deletes an existing model.

Parameters
Name Description
request DeleteModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Overrides

GetModel(GetModelRequest, CallSettings)

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

Gets a model.

Parameters
Name Description
request GetModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Model

The RPC response.

Overrides

GetModelAsync(GetModelRequest, CallSettings)

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

Gets a model.

Parameters
Name Description
request GetModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskModel

A Task containing the RPC response.

Overrides

ListModels(ListModelsRequest, CallSettings)

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

Lists all the models linked to this event store.

Parameters
Name Description
request ListModelsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListModelsResponseModel

A pageable sequence of Model resources.

Overrides

ListModelsAsync(ListModelsRequest, CallSettings)

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

Lists all the models linked to this event store.

Parameters
Name Description
request ListModelsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListModelsResponseModel

A pageable asynchronous sequence of Model resources.

Overrides

PauseModel(PauseModelRequest, CallSettings)

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

Pauses the training of an existing model.

Parameters
Name Description
request PauseModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Model

The RPC response.

Overrides

PauseModelAsync(PauseModelRequest, CallSettings)

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

Pauses the training of an existing model.

Parameters
Name Description
request PauseModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskModel

A Task containing the RPC response.

Overrides

ResumeModel(ResumeModelRequest, CallSettings)

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

Resumes the training of an existing model.

Parameters
Name Description
request ResumeModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Model

The RPC response.

Overrides

ResumeModelAsync(ResumeModelRequest, CallSettings)

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

Resumes the training of an existing model.

Parameters
Name Description
request ResumeModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskModel

A Task containing the RPC response.

Overrides

TuneModel(TuneModelRequest, CallSettings)

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

Tunes an existing model.

Parameters
Name Description
request TuneModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationTuneModelResponseTuneModelMetadata

The RPC response.

Overrides

TuneModelAsync(TuneModelRequest, CallSettings)

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

Tunes an existing model.

Parameters
Name Description
request TuneModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationTuneModelResponseTuneModelMetadata

A Task containing the RPC response.

Overrides

UpdateModel(UpdateModelRequest, CallSettings)

public override 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
Name Description
request UpdateModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Model

The RPC response.

Overrides

UpdateModelAsync(UpdateModelRequest, CallSettings)

public override 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
Name Description
request UpdateModelRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskModel

A Task containing the RPC response.

Overrides