Retail v2 API - Class ServingConfigServiceClient (2.3.0)

public abstract class ServingConfigServiceClient

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

ServingConfigService client wrapper, for convenient use.

Inheritance

Object > ServingConfigServiceClient

Namespace

Google.Cloud.Retail.V2

Assembly

Google.Cloud.Retail.V2.dll

Remarks

Service for modifying ServingConfig.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
System.String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default ServingConfigService scopes.

Property Value
TypeDescription
IReadOnlyList<System.String>
Remarks

The default ServingConfigService scopes are:

GrpcClient

public virtual ServingConfigService.ServingConfigServiceClient GrpcClient { get; }

The underlying gRPC ServingConfigService client

Property Value
TypeDescription
ServingConfigService.ServingConfigServiceClient

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

Methods

AddControl(AddControlRequest, CallSettings)

public virtual ServingConfig AddControl(AddControlRequest request, CallSettings callSettings = null)

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

Parameters
NameDescription
requestAddControlRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
AddControlRequest request = new AddControlRequest
{
    ServingConfigAsServingConfigName = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"),
    ControlId = "",
};
// Make the request
ServingConfig response = servingConfigServiceClient.AddControl(request);

AddControl(ServingConfigName, CallSettings)

public virtual ServingConfig AddControl(ServingConfigName servingConfig, CallSettings callSettings = null)

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

Parameters
NameDescription
servingConfigServingConfigName

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
ServingConfigName servingConfig = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
// Make the request
ServingConfig response = servingConfigServiceClient.AddControl(servingConfig);

AddControl(String, CallSettings)

public virtual ServingConfig AddControl(string servingConfig, CallSettings callSettings = null)

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

Parameters
NameDescription
servingConfigSystem.String

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
string servingConfig = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/servingConfigs/[SERVING_CONFIG]";
// Make the request
ServingConfig response = servingConfigServiceClient.AddControl(servingConfig);

AddControlAsync(AddControlRequest, CallSettings)

public virtual Task<ServingConfig> AddControlAsync(AddControlRequest request, CallSettings callSettings = null)

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

Parameters
NameDescription
requestAddControlRequest

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<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
AddControlRequest request = new AddControlRequest
{
    ServingConfigAsServingConfigName = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"),
    ControlId = "",
};
// Make the request
ServingConfig response = await servingConfigServiceClient.AddControlAsync(request);

AddControlAsync(AddControlRequest, CancellationToken)

public virtual Task<ServingConfig> AddControlAsync(AddControlRequest request, CancellationToken cancellationToken)

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

Parameters
NameDescription
requestAddControlRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
AddControlRequest request = new AddControlRequest
{
    ServingConfigAsServingConfigName = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"),
    ControlId = "",
};
// Make the request
ServingConfig response = await servingConfigServiceClient.AddControlAsync(request);

AddControlAsync(ServingConfigName, CallSettings)

public virtual Task<ServingConfig> AddControlAsync(ServingConfigName servingConfig, CallSettings callSettings = null)

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

Parameters
NameDescription
servingConfigServingConfigName

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
ServingConfigName servingConfig = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
// Make the request
ServingConfig response = await servingConfigServiceClient.AddControlAsync(servingConfig);

AddControlAsync(ServingConfigName, CancellationToken)

public virtual Task<ServingConfig> AddControlAsync(ServingConfigName servingConfig, CancellationToken cancellationToken)

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

Parameters
NameDescription
servingConfigServingConfigName

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
ServingConfigName servingConfig = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
// Make the request
ServingConfig response = await servingConfigServiceClient.AddControlAsync(servingConfig);

AddControlAsync(String, CallSettings)

public virtual Task<ServingConfig> AddControlAsync(string servingConfig, CallSettings callSettings = null)

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

Parameters
NameDescription
servingConfigSystem.String

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
string servingConfig = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/servingConfigs/[SERVING_CONFIG]";
// Make the request
ServingConfig response = await servingConfigServiceClient.AddControlAsync(servingConfig);

AddControlAsync(String, CancellationToken)

public virtual Task<ServingConfig> AddControlAsync(string servingConfig, CancellationToken cancellationToken)

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

Parameters
NameDescription
servingConfigSystem.String

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
string servingConfig = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/servingConfigs/[SERVING_CONFIG]";
// Make the request
ServingConfig response = await servingConfigServiceClient.AddControlAsync(servingConfig);

Create()

public static ServingConfigServiceClient Create()

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

Returns
TypeDescription
ServingConfigServiceClient

The created ServingConfigServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<ServingConfigServiceClient>

The task representing the created ServingConfigServiceClient.

CreateServingConfig(CatalogName, ServingConfig, String, CallSettings)

public virtual ServingConfig CreateServingConfig(CatalogName parent, ServingConfig servingConfig, string servingConfigId, CallSettings callSettings = null)

Creates a ServingConfig.

A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a FAILED_PRECONDITION error is returned.

Parameters
NameDescription
parentCatalogName

Required. Full resource name of parent. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

servingConfigServingConfig

Required. The ServingConfig to create.

servingConfigIdSystem.String

Required. The ID to use for the ServingConfig, which will become the final component of the ServingConfig's resource name.

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
ServingConfig servingConfig = new ServingConfig();
string servingConfigId = "";
// Make the request
ServingConfig response = servingConfigServiceClient.CreateServingConfig(parent, servingConfig, servingConfigId);

CreateServingConfig(CreateServingConfigRequest, CallSettings)

public virtual ServingConfig CreateServingConfig(CreateServingConfigRequest request, CallSettings callSettings = null)

Creates a ServingConfig.

A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a FAILED_PRECONDITION error is returned.

Parameters
NameDescription
requestCreateServingConfigRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
CreateServingConfigRequest request = new CreateServingConfigRequest
{
    ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
    ServingConfig = new ServingConfig(),
    ServingConfigId = "",
};
// Make the request
ServingConfig response = servingConfigServiceClient.CreateServingConfig(request);

CreateServingConfig(String, ServingConfig, String, CallSettings)

public virtual ServingConfig CreateServingConfig(string parent, ServingConfig servingConfig, string servingConfigId, CallSettings callSettings = null)

Creates a ServingConfig.

A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a FAILED_PRECONDITION error is returned.

Parameters
NameDescription
parentSystem.String

Required. Full resource name of parent. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

servingConfigServingConfig

Required. The ServingConfig to create.

servingConfigIdSystem.String

Required. The ID to use for the ServingConfig, which will become the final component of the ServingConfig's resource name.

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
ServingConfig servingConfig = new ServingConfig();
string servingConfigId = "";
// Make the request
ServingConfig response = servingConfigServiceClient.CreateServingConfig(parent, servingConfig, servingConfigId);

CreateServingConfigAsync(CatalogName, ServingConfig, String, CallSettings)

public virtual Task<ServingConfig> CreateServingConfigAsync(CatalogName parent, ServingConfig servingConfig, string servingConfigId, CallSettings callSettings = null)

Creates a ServingConfig.

A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a FAILED_PRECONDITION error is returned.

Parameters
NameDescription
parentCatalogName

Required. Full resource name of parent. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

servingConfigServingConfig

Required. The ServingConfig to create.

servingConfigIdSystem.String

Required. The ID to use for the ServingConfig, which will become the final component of the ServingConfig's resource name.

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
ServingConfig servingConfig = new ServingConfig();
string servingConfigId = "";
// Make the request
ServingConfig response = await servingConfigServiceClient.CreateServingConfigAsync(parent, servingConfig, servingConfigId);

CreateServingConfigAsync(CatalogName, ServingConfig, String, CancellationToken)

public virtual Task<ServingConfig> CreateServingConfigAsync(CatalogName parent, ServingConfig servingConfig, string servingConfigId, CancellationToken cancellationToken)

Creates a ServingConfig.

A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a FAILED_PRECONDITION error is returned.

Parameters
NameDescription
parentCatalogName

Required. Full resource name of parent. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

servingConfigServingConfig

Required. The ServingConfig to create.

servingConfigIdSystem.String

Required. The ID to use for the ServingConfig, which will become the final component of the ServingConfig's resource name.

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
ServingConfig servingConfig = new ServingConfig();
string servingConfigId = "";
// Make the request
ServingConfig response = await servingConfigServiceClient.CreateServingConfigAsync(parent, servingConfig, servingConfigId);

CreateServingConfigAsync(CreateServingConfigRequest, CallSettings)

public virtual Task<ServingConfig> CreateServingConfigAsync(CreateServingConfigRequest request, CallSettings callSettings = null)

Creates a ServingConfig.

A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a FAILED_PRECONDITION error is returned.

Parameters
NameDescription
requestCreateServingConfigRequest

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<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
CreateServingConfigRequest request = new CreateServingConfigRequest
{
    ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
    ServingConfig = new ServingConfig(),
    ServingConfigId = "",
};
// Make the request
ServingConfig response = await servingConfigServiceClient.CreateServingConfigAsync(request);

CreateServingConfigAsync(CreateServingConfigRequest, CancellationToken)

public virtual Task<ServingConfig> CreateServingConfigAsync(CreateServingConfigRequest request, CancellationToken cancellationToken)

Creates a ServingConfig.

A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a FAILED_PRECONDITION error is returned.

Parameters
NameDescription
requestCreateServingConfigRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
CreateServingConfigRequest request = new CreateServingConfigRequest
{
    ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
    ServingConfig = new ServingConfig(),
    ServingConfigId = "",
};
// Make the request
ServingConfig response = await servingConfigServiceClient.CreateServingConfigAsync(request);

CreateServingConfigAsync(String, ServingConfig, String, CallSettings)

public virtual Task<ServingConfig> CreateServingConfigAsync(string parent, ServingConfig servingConfig, string servingConfigId, CallSettings callSettings = null)

Creates a ServingConfig.

A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a FAILED_PRECONDITION error is returned.

Parameters
NameDescription
parentSystem.String

Required. Full resource name of parent. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

servingConfigServingConfig

Required. The ServingConfig to create.

servingConfigIdSystem.String

Required. The ID to use for the ServingConfig, which will become the final component of the ServingConfig's resource name.

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
ServingConfig servingConfig = new ServingConfig();
string servingConfigId = "";
// Make the request
ServingConfig response = await servingConfigServiceClient.CreateServingConfigAsync(parent, servingConfig, servingConfigId);

CreateServingConfigAsync(String, ServingConfig, String, CancellationToken)

public virtual Task<ServingConfig> CreateServingConfigAsync(string parent, ServingConfig servingConfig, string servingConfigId, CancellationToken cancellationToken)

Creates a ServingConfig.

A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a FAILED_PRECONDITION error is returned.

Parameters
NameDescription
parentSystem.String

Required. Full resource name of parent. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

servingConfigServingConfig

Required. The ServingConfig to create.

servingConfigIdSystem.String

Required. The ID to use for the ServingConfig, which will become the final component of the ServingConfig's resource name.

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-_/.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
ServingConfig servingConfig = new ServingConfig();
string servingConfigId = "";
// Make the request
ServingConfig response = await servingConfigServiceClient.CreateServingConfigAsync(parent, servingConfig, servingConfigId);

DeleteServingConfig(DeleteServingConfigRequest, CallSettings)

public virtual void DeleteServingConfig(DeleteServingConfigRequest request, CallSettings callSettings = null)

Deletes a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
requestDeleteServingConfigRequest

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
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
DeleteServingConfigRequest request = new DeleteServingConfigRequest
{
    ServingConfigName = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"),
};
// Make the request
servingConfigServiceClient.DeleteServingConfig(request);

DeleteServingConfig(ServingConfigName, CallSettings)

public virtual void DeleteServingConfig(ServingConfigName name, CallSettings callSettings = null)

Deletes a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
nameServingConfigName

Required. The resource name of the ServingConfig to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
ServingConfigName name = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
// Make the request
servingConfigServiceClient.DeleteServingConfig(name);

DeleteServingConfig(String, CallSettings)

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

Deletes a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
nameSystem.String

Required. The resource name of the ServingConfig to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/servingConfigs/[SERVING_CONFIG]";
// Make the request
servingConfigServiceClient.DeleteServingConfig(name);

DeleteServingConfigAsync(DeleteServingConfigRequest, CallSettings)

public virtual Task DeleteServingConfigAsync(DeleteServingConfigRequest request, CallSettings callSettings = null)

Deletes a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
requestDeleteServingConfigRequest

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
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteServingConfigRequest request = new DeleteServingConfigRequest
{
    ServingConfigName = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"),
};
// Make the request
await servingConfigServiceClient.DeleteServingConfigAsync(request);

DeleteServingConfigAsync(DeleteServingConfigRequest, CancellationToken)

public virtual Task DeleteServingConfigAsync(DeleteServingConfigRequest request, CancellationToken cancellationToken)

Deletes a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
requestDeleteServingConfigRequest

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
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteServingConfigRequest request = new DeleteServingConfigRequest
{
    ServingConfigName = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"),
};
// Make the request
await servingConfigServiceClient.DeleteServingConfigAsync(request);

DeleteServingConfigAsync(ServingConfigName, CallSettings)

public virtual Task DeleteServingConfigAsync(ServingConfigName name, CallSettings callSettings = null)

Deletes a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
nameServingConfigName

Required. The resource name of the ServingConfig to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
ServingConfigName name = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
// Make the request
await servingConfigServiceClient.DeleteServingConfigAsync(name);

DeleteServingConfigAsync(ServingConfigName, CancellationToken)

public virtual Task DeleteServingConfigAsync(ServingConfigName name, CancellationToken cancellationToken)

Deletes a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
nameServingConfigName

Required. The resource name of the ServingConfig to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
ServingConfigName name = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
// Make the request
await servingConfigServiceClient.DeleteServingConfigAsync(name);

DeleteServingConfigAsync(String, CallSettings)

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

Deletes a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
nameSystem.String

Required. The resource name of the ServingConfig to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/servingConfigs/[SERVING_CONFIG]";
// Make the request
await servingConfigServiceClient.DeleteServingConfigAsync(name);

DeleteServingConfigAsync(String, CancellationToken)

public virtual Task DeleteServingConfigAsync(string name, CancellationToken cancellationToken)

Deletes a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
nameSystem.String

Required. The resource name of the ServingConfig to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/servingConfigs/[SERVING_CONFIG]";
// Make the request
await servingConfigServiceClient.DeleteServingConfigAsync(name);

GetServingConfig(GetServingConfigRequest, CallSettings)

public virtual ServingConfig GetServingConfig(GetServingConfigRequest request, CallSettings callSettings = null)

Gets a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
requestGetServingConfigRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
GetServingConfigRequest request = new GetServingConfigRequest
{
    ServingConfigName = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"),
};
// Make the request
ServingConfig response = servingConfigServiceClient.GetServingConfig(request);

GetServingConfig(ServingConfigName, CallSettings)

public virtual ServingConfig GetServingConfig(ServingConfigName name, CallSettings callSettings = null)

Gets a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
nameServingConfigName

Required. The resource name of the ServingConfig to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
ServingConfigName name = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
// Make the request
ServingConfig response = servingConfigServiceClient.GetServingConfig(name);

GetServingConfig(String, CallSettings)

public virtual ServingConfig GetServingConfig(string name, CallSettings callSettings = null)

Gets a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
nameSystem.String

Required. The resource name of the ServingConfig to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/servingConfigs/[SERVING_CONFIG]";
// Make the request
ServingConfig response = servingConfigServiceClient.GetServingConfig(name);

GetServingConfigAsync(GetServingConfigRequest, CallSettings)

public virtual Task<ServingConfig> GetServingConfigAsync(GetServingConfigRequest request, CallSettings callSettings = null)

Gets a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
requestGetServingConfigRequest

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<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
GetServingConfigRequest request = new GetServingConfigRequest
{
    ServingConfigName = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"),
};
// Make the request
ServingConfig response = await servingConfigServiceClient.GetServingConfigAsync(request);

GetServingConfigAsync(GetServingConfigRequest, CancellationToken)

public virtual Task<ServingConfig> GetServingConfigAsync(GetServingConfigRequest request, CancellationToken cancellationToken)

Gets a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
requestGetServingConfigRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
GetServingConfigRequest request = new GetServingConfigRequest
{
    ServingConfigName = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"),
};
// Make the request
ServingConfig response = await servingConfigServiceClient.GetServingConfigAsync(request);

GetServingConfigAsync(ServingConfigName, CallSettings)

public virtual Task<ServingConfig> GetServingConfigAsync(ServingConfigName name, CallSettings callSettings = null)

Gets a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
nameServingConfigName

Required. The resource name of the ServingConfig to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
ServingConfigName name = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
// Make the request
ServingConfig response = await servingConfigServiceClient.GetServingConfigAsync(name);

GetServingConfigAsync(ServingConfigName, CancellationToken)

public virtual Task<ServingConfig> GetServingConfigAsync(ServingConfigName name, CancellationToken cancellationToken)

Gets a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
nameServingConfigName

Required. The resource name of the ServingConfig to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
ServingConfigName name = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
// Make the request
ServingConfig response = await servingConfigServiceClient.GetServingConfigAsync(name);

GetServingConfigAsync(String, CallSettings)

public virtual Task<ServingConfig> GetServingConfigAsync(string name, CallSettings callSettings = null)

Gets a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
nameSystem.String

Required. The resource name of the ServingConfig to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/servingConfigs/[SERVING_CONFIG]";
// Make the request
ServingConfig response = await servingConfigServiceClient.GetServingConfigAsync(name);

GetServingConfigAsync(String, CancellationToken)

public virtual Task<ServingConfig> GetServingConfigAsync(string name, CancellationToken cancellationToken)

Gets a ServingConfig.

Returns a NotFound error if the ServingConfig does not exist.

Parameters
NameDescription
nameSystem.String

Required. The resource name of the ServingConfig to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/servingConfigs/[SERVING_CONFIG]";
// Make the request
ServingConfig response = await servingConfigServiceClient.GetServingConfigAsync(name);

ListServingConfigs(CatalogName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListServingConfigsResponse, ServingConfig> ListServingConfigs(CatalogName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all ServingConfigs linked to this catalog.

Parameters
NameDescription
parentCatalogName

Required. The catalog resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

pageTokenSystem.String

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

pageSizeNullable<Int32>

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
PagedEnumerable<ListServingConfigsResponse, ServingConfig>

A pageable sequence of ServingConfig resources.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
// Make the request
PagedEnumerable<ListServingConfigsResponse, ServingConfig> response = servingConfigServiceClient.ListServingConfigs(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (ServingConfig 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 (ListServingConfigsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ServingConfig 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<ServingConfig> 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 (ServingConfig 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;

ListServingConfigs(ListServingConfigsRequest, CallSettings)

public virtual PagedEnumerable<ListServingConfigsResponse, ServingConfig> ListServingConfigs(ListServingConfigsRequest request, CallSettings callSettings = null)

Lists all ServingConfigs linked to this catalog.

Parameters
NameDescription
requestListServingConfigsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListServingConfigsResponse, ServingConfig>

A pageable sequence of ServingConfig resources.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
ListServingConfigsRequest request = new ListServingConfigsRequest
{
    ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
};
// Make the request
PagedEnumerable<ListServingConfigsResponse, ServingConfig> response = servingConfigServiceClient.ListServingConfigs(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (ServingConfig 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 (ListServingConfigsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ServingConfig 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<ServingConfig> 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 (ServingConfig 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;

ListServingConfigs(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListServingConfigsResponse, ServingConfig> ListServingConfigs(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all ServingConfigs linked to this catalog.

Parameters
NameDescription
parentSystem.String

Required. The catalog resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

pageTokenSystem.String

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

pageSizeNullable<Int32>

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
PagedEnumerable<ListServingConfigsResponse, ServingConfig>

A pageable sequence of ServingConfig resources.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
// Make the request
PagedEnumerable<ListServingConfigsResponse, ServingConfig> response = servingConfigServiceClient.ListServingConfigs(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (ServingConfig 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 (ListServingConfigsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ServingConfig 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<ServingConfig> 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 (ServingConfig 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;

ListServingConfigsAsync(CatalogName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListServingConfigsResponse, ServingConfig> ListServingConfigsAsync(CatalogName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all ServingConfigs linked to this catalog.

Parameters
NameDescription
parentCatalogName

Required. The catalog resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

pageTokenSystem.String

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

pageSizeNullable<Int32>

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
PagedAsyncEnumerable<ListServingConfigsResponse, ServingConfig>

A pageable asynchronous sequence of ServingConfig resources.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
// Make the request
PagedAsyncEnumerable<ListServingConfigsResponse, ServingConfig> response = servingConfigServiceClient.ListServingConfigsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ServingConfig 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((ListServingConfigsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ServingConfig 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<ServingConfig> 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 (ServingConfig 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;

ListServingConfigsAsync(ListServingConfigsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListServingConfigsResponse, ServingConfig> ListServingConfigsAsync(ListServingConfigsRequest request, CallSettings callSettings = null)

Lists all ServingConfigs linked to this catalog.

Parameters
NameDescription
requestListServingConfigsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListServingConfigsResponse, ServingConfig>

A pageable asynchronous sequence of ServingConfig resources.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
ListServingConfigsRequest request = new ListServingConfigsRequest
{
    ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
};
// Make the request
PagedAsyncEnumerable<ListServingConfigsResponse, ServingConfig> response = servingConfigServiceClient.ListServingConfigsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ServingConfig 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((ListServingConfigsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ServingConfig 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<ServingConfig> 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 (ServingConfig 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;

ListServingConfigsAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListServingConfigsResponse, ServingConfig> ListServingConfigsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all ServingConfigs linked to this catalog.

Parameters
NameDescription
parentSystem.String

Required. The catalog resource name. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}

pageTokenSystem.String

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

pageSizeNullable<Int32>

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
PagedAsyncEnumerable<ListServingConfigsResponse, ServingConfig>

A pageable asynchronous sequence of ServingConfig resources.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
// Make the request
PagedAsyncEnumerable<ListServingConfigsResponse, ServingConfig> response = servingConfigServiceClient.ListServingConfigsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ServingConfig 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((ListServingConfigsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ServingConfig 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<ServingConfig> 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 (ServingConfig 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;

RemoveControl(RemoveControlRequest, CallSettings)

public virtual ServingConfig RemoveControl(RemoveControlRequest request, CallSettings callSettings = null)

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.

Parameters
NameDescription
requestRemoveControlRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
RemoveControlRequest request = new RemoveControlRequest
{
    ServingConfigAsServingConfigName = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"),
    ControlId = "",
};
// Make the request
ServingConfig response = servingConfigServiceClient.RemoveControl(request);

RemoveControl(ServingConfigName, CallSettings)

public virtual ServingConfig RemoveControl(ServingConfigName servingConfig, CallSettings callSettings = null)

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.

Parameters
NameDescription
servingConfigServingConfigName

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
ServingConfigName servingConfig = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
// Make the request
ServingConfig response = servingConfigServiceClient.RemoveControl(servingConfig);

RemoveControl(String, CallSettings)

public virtual ServingConfig RemoveControl(string servingConfig, CallSettings callSettings = null)

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.

Parameters
NameDescription
servingConfigSystem.String

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
string servingConfig = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/servingConfigs/[SERVING_CONFIG]";
// Make the request
ServingConfig response = servingConfigServiceClient.RemoveControl(servingConfig);

RemoveControlAsync(RemoveControlRequest, CallSettings)

public virtual Task<ServingConfig> RemoveControlAsync(RemoveControlRequest request, CallSettings callSettings = null)

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.

Parameters
NameDescription
requestRemoveControlRequest

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<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
RemoveControlRequest request = new RemoveControlRequest
{
    ServingConfigAsServingConfigName = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"),
    ControlId = "",
};
// Make the request
ServingConfig response = await servingConfigServiceClient.RemoveControlAsync(request);

RemoveControlAsync(RemoveControlRequest, CancellationToken)

public virtual Task<ServingConfig> RemoveControlAsync(RemoveControlRequest request, CancellationToken cancellationToken)

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.

Parameters
NameDescription
requestRemoveControlRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
RemoveControlRequest request = new RemoveControlRequest
{
    ServingConfigAsServingConfigName = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]"),
    ControlId = "",
};
// Make the request
ServingConfig response = await servingConfigServiceClient.RemoveControlAsync(request);

RemoveControlAsync(ServingConfigName, CallSettings)

public virtual Task<ServingConfig> RemoveControlAsync(ServingConfigName servingConfig, CallSettings callSettings = null)

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.

Parameters
NameDescription
servingConfigServingConfigName

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
ServingConfigName servingConfig = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
// Make the request
ServingConfig response = await servingConfigServiceClient.RemoveControlAsync(servingConfig);

RemoveControlAsync(ServingConfigName, CancellationToken)

public virtual Task<ServingConfig> RemoveControlAsync(ServingConfigName servingConfig, CancellationToken cancellationToken)

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.

Parameters
NameDescription
servingConfigServingConfigName

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
ServingConfigName servingConfig = ServingConfigName.FromProjectLocationCatalogServingConfig("[PROJECT]", "[LOCATION]", "[CATALOG]", "[SERVING_CONFIG]");
// Make the request
ServingConfig response = await servingConfigServiceClient.RemoveControlAsync(servingConfig);

RemoveControlAsync(String, CallSettings)

public virtual Task<ServingConfig> RemoveControlAsync(string servingConfig, CallSettings callSettings = null)

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.

Parameters
NameDescription
servingConfigSystem.String

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
string servingConfig = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/servingConfigs/[SERVING_CONFIG]";
// Make the request
ServingConfig response = await servingConfigServiceClient.RemoveControlAsync(servingConfig);

RemoveControlAsync(String, CancellationToken)

public virtual Task<ServingConfig> RemoveControlAsync(string servingConfig, CancellationToken cancellationToken)

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.

Parameters
NameDescription
servingConfigSystem.String

Required. The source ServingConfig resource name . Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
string servingConfig = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/servingConfigs/[SERVING_CONFIG]";
// Make the request
ServingConfig response = await servingConfigServiceClient.RemoveControlAsync(servingConfig);

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.

UpdateServingConfig(ServingConfig, FieldMask, CallSettings)

public virtual ServingConfig UpdateServingConfig(ServingConfig servingConfig, FieldMask updateMask, CallSettings callSettings = null)

Updates a ServingConfig.

Parameters
NameDescription
servingConfigServingConfig

Required. The ServingConfig to update.

updateMaskFieldMask

Indicates which fields in the provided [ServingConfig][google.cloud.retail.v2.ServingConfig] to update. The following are NOT supported:

  • [ServingConfig.name][google.cloud.retail.v2.ServingConfig.name]

If not set, all supported fields are updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
ServingConfig servingConfig = new ServingConfig();
FieldMask updateMask = new FieldMask();
// Make the request
ServingConfig response = servingConfigServiceClient.UpdateServingConfig(servingConfig, updateMask);

UpdateServingConfig(UpdateServingConfigRequest, CallSettings)

public virtual ServingConfig UpdateServingConfig(UpdateServingConfigRequest request, CallSettings callSettings = null)

Updates a ServingConfig.

Parameters
NameDescription
requestUpdateServingConfigRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ServingConfig

The RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = ServingConfigServiceClient.Create();
// Initialize request argument(s)
UpdateServingConfigRequest request = new UpdateServingConfigRequest
{
    ServingConfig = new ServingConfig(),
    UpdateMask = new FieldMask(),
};
// Make the request
ServingConfig response = servingConfigServiceClient.UpdateServingConfig(request);

UpdateServingConfigAsync(ServingConfig, FieldMask, CallSettings)

public virtual Task<ServingConfig> UpdateServingConfigAsync(ServingConfig servingConfig, FieldMask updateMask, CallSettings callSettings = null)

Updates a ServingConfig.

Parameters
NameDescription
servingConfigServingConfig

Required. The ServingConfig to update.

updateMaskFieldMask

Indicates which fields in the provided [ServingConfig][google.cloud.retail.v2.ServingConfig] to update. The following are NOT supported:

  • [ServingConfig.name][google.cloud.retail.v2.ServingConfig.name]

If not set, all supported fields are updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
ServingConfig servingConfig = new ServingConfig();
FieldMask updateMask = new FieldMask();
// Make the request
ServingConfig response = await servingConfigServiceClient.UpdateServingConfigAsync(servingConfig, updateMask);

UpdateServingConfigAsync(ServingConfig, FieldMask, CancellationToken)

public virtual Task<ServingConfig> UpdateServingConfigAsync(ServingConfig servingConfig, FieldMask updateMask, CancellationToken cancellationToken)

Updates a ServingConfig.

Parameters
NameDescription
servingConfigServingConfig

Required. The ServingConfig to update.

updateMaskFieldMask

Indicates which fields in the provided [ServingConfig][google.cloud.retail.v2.ServingConfig] to update. The following are NOT supported:

  • [ServingConfig.name][google.cloud.retail.v2.ServingConfig.name]

If not set, all supported fields are updated.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
ServingConfig servingConfig = new ServingConfig();
FieldMask updateMask = new FieldMask();
// Make the request
ServingConfig response = await servingConfigServiceClient.UpdateServingConfigAsync(servingConfig, updateMask);

UpdateServingConfigAsync(UpdateServingConfigRequest, CallSettings)

public virtual Task<ServingConfig> UpdateServingConfigAsync(UpdateServingConfigRequest request, CallSettings callSettings = null)

Updates a ServingConfig.

Parameters
NameDescription
requestUpdateServingConfigRequest

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<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateServingConfigRequest request = new UpdateServingConfigRequest
{
    ServingConfig = new ServingConfig(),
    UpdateMask = new FieldMask(),
};
// Make the request
ServingConfig response = await servingConfigServiceClient.UpdateServingConfigAsync(request);

UpdateServingConfigAsync(UpdateServingConfigRequest, CancellationToken)

public virtual Task<ServingConfig> UpdateServingConfigAsync(UpdateServingConfigRequest request, CancellationToken cancellationToken)

Updates a ServingConfig.

Parameters
NameDescription
requestUpdateServingConfigRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ServingConfig>

A Task containing the RPC response.

Example
// Create client
ServingConfigServiceClient servingConfigServiceClient = await ServingConfigServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateServingConfigRequest request = new UpdateServingConfigRequest
{
    ServingConfig = new ServingConfig(),
    UpdateMask = new FieldMask(),
};
// Make the request
ServingConfig response = await servingConfigServiceClient.UpdateServingConfigAsync(request);