public abstract class ServingConfigServiceClient
Reference documentation and code samples for the Retail v2 API class ServingConfigServiceClient.
ServingConfigService client wrapper, for convenient use.
Derived Types
Namespace
GoogleCloudGoogle.Cloud.RetailV2Assembly
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 | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default ServingConfigService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default ServingConfigService scopes are:
GrpcClient
public virtual ServingConfigService.ServingConfigServiceClient GrpcClient { get; }
The underlying gRPC ServingConfigService client
Property Value | |
---|---|
Type | Description |
ServingConfigServiceServingConfigServiceClient |
LocationsClient
public virtual LocationsClient LocationsClient { get; }
The LocationsClient associated with this client.
Property Value | |
---|---|
Type | Description |
LocationsClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | AddControlRequest 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 |
ServingConfig | The RPC response. |
// 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 | |
---|---|
Name | Description |
servingConfig | ServingConfigName Required. The source ServingConfig resource name . Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ServingConfig | The RPC response. |
// 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 | |
---|---|
Name | Description |
servingConfig | string Required. The source ServingConfig resource name . Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ServingConfig | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | AddControlRequest 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 |
TaskServingConfig | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | AddControlRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskServingConfig | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
servingConfig | ServingConfigName Required. The source ServingConfig resource name . Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskServingConfig | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
servingConfig | ServingConfigName Required. The source ServingConfig resource name . Format:
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskServingConfig | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
servingConfig | string Required. The source ServingConfig resource name . Format:
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskServingConfig | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
servingConfig | string Required. The source ServingConfig resource name . Format:
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskServingConfig | A Task containing the RPC response. |
// 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 | |
---|---|
Type | Description |
ServingConfigServiceClient | The created ServingConfigServiceClient. |
CreateAsync(CancellationToken)
public static Task<ServingConfigServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a ServingConfigServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ServingConfigServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskServingConfigServiceClient | 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 | |
---|---|
Name | Description |
parent | CatalogName Required. Full resource name of parent. Format:
|
servingConfig | ServingConfig Required. The ServingConfig to create. |
servingConfigId | 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]-_/. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ServingConfig | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | CreateServingConfigRequest 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 |
ServingConfig | The RPC response. |
// 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 | |
---|---|
Name | Description |
parent | string Required. Full resource name of parent. Format:
|
servingConfig | ServingConfig Required. The ServingConfig to create. |
servingConfigId | 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]-_/. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ServingConfig | The RPC response. |
// 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 | |
---|---|
Name | Description |
parent | CatalogName Required. Full resource name of parent. Format:
|
servingConfig | ServingConfig Required. The ServingConfig to create. |
servingConfigId | 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]-_/. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskServingConfig | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | CatalogName Required. Full resource name of parent. Format:
|
servingConfig | ServingConfig Required. The ServingConfig to create. |
servingConfigId | 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]-_/. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskServingConfig | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | CreateServingConfigRequest 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 |
TaskServingConfig | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | CreateServingConfigRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskServingConfig | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent |
|