public abstract class ControlServiceClient
Reference documentation and code samples for the Retail v2 API class ControlServiceClient.
ControlService client wrapper, for convenient use.
Derived Types
Namespace
GoogleCloudGoogle.Cloud.RetailV2Assembly
Google.Cloud.Retail.V2.dll
Remarks
Service for modifying Control.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the ControlService 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 ControlService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default ControlService scopes are:
GrpcClient
public virtual ControlService.ControlServiceClient GrpcClient { get; }
The underlying gRPC ControlService client
Property Value | |
---|---|
Type | Description |
ControlServiceControlServiceClient |
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
Create()
public static ControlServiceClient Create()
Synchronously creates a ControlServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ControlServiceClientBuilder.
Returns | |
---|---|
Type | Description |
ControlServiceClient | The created ControlServiceClient. |
CreateAsync(CancellationToken)
public static Task<ControlServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a ControlServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ControlServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskControlServiceClient | The task representing the created ControlServiceClient. |
CreateControl(CatalogName, Control, string, CallSettings)
public virtual Control CreateControl(CatalogName parent, Control control, string controlId, CallSettings callSettings = null)
Creates a Control.
If the [Control][google.cloud.retail.v2.Control] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
parent | CatalogName Required. Full resource name of parent catalog. Format:
|
control | Control Required. The Control to create. |
controlId | string Required. The ID to use for the Control, which will become the final component of the Control'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 |
Control | The RPC response. |
// Create client
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
Control control = new Control();
string controlId = "";
// Make the request
Control response = controlServiceClient.CreateControl(parent, control, controlId);
CreateControl(CreateControlRequest, CallSettings)
public virtual Control CreateControl(CreateControlRequest request, CallSettings callSettings = null)
Creates a Control.
If the [Control][google.cloud.retail.v2.Control] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
request | CreateControlRequest 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 |
Control | The RPC response. |
// Create client
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
CreateControlRequest request = new CreateControlRequest
{
ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
Control = new Control(),
ControlId = "",
};
// Make the request
Control response = controlServiceClient.CreateControl(request);
CreateControl(string, Control, string, CallSettings)
public virtual Control CreateControl(string parent, Control control, string controlId, CallSettings callSettings = null)
Creates a Control.
If the [Control][google.cloud.retail.v2.Control] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
parent | string Required. Full resource name of parent catalog. Format:
|
control | Control Required. The Control to create. |
controlId | string Required. The ID to use for the Control, which will become the final component of the Control'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 |
Control | The RPC response. |
// Create client
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
Control control = new Control();
string controlId = "";
// Make the request
Control response = controlServiceClient.CreateControl(parent, control, controlId);
CreateControlAsync(CatalogName, Control, string, CallSettings)
public virtual Task<Control> CreateControlAsync(CatalogName parent, Control control, string controlId, CallSettings callSettings = null)
Creates a Control.
If the [Control][google.cloud.retail.v2.Control] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
parent | CatalogName Required. Full resource name of parent catalog. Format:
|
control | Control Required. The Control to create. |
controlId | string Required. The ID to use for the Control, which will become the final component of the Control'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 |
TaskControl | A Task containing the RPC response. |
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
Control control = new Control();
string controlId = "";
// Make the request
Control response = await controlServiceClient.CreateControlAsync(parent, control, controlId);
CreateControlAsync(CatalogName, Control, string, CancellationToken)
public virtual Task<Control> CreateControlAsync(CatalogName parent, Control control, string controlId, CancellationToken cancellationToken)
Creates a Control.
If the [Control][google.cloud.retail.v2.Control] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
parent | CatalogName Required. Full resource name of parent catalog. Format:
|
control | Control Required. The Control to create. |
controlId | string Required. The ID to use for the Control, which will become the final component of the Control'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 |
TaskControl | A Task containing the RPC response. |
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
Control control = new Control();
string controlId = "";
// Make the request
Control response = await controlServiceClient.CreateControlAsync(parent, control, controlId);
CreateControlAsync(CreateControlRequest, CallSettings)
public virtual Task<Control> CreateControlAsync(CreateControlRequest request, CallSettings callSettings = null)
Creates a Control.
If the [Control][google.cloud.retail.v2.Control] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
request | CreateControlRequest 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 |
TaskControl | A Task containing the RPC response. |
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
CreateControlRequest request = new CreateControlRequest
{
ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
Control = new Control(),
ControlId = "",
};
// Make the request
Control response = await controlServiceClient.CreateControlAsync(request);
CreateControlAsync(CreateControlRequest, CancellationToken)
public virtual Task<Control> CreateControlAsync(CreateControlRequest request, CancellationToken cancellationToken)
Creates a Control.
If the [Control][google.cloud.retail.v2.Control] to create already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
request | CreateControlRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskControl | A Task containing the RPC response. |
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
CreateControlRequest request = new CreateControlRequest
{
ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
Control = new Control(),
ControlId = "",
};
// Make the request
Control response = await controlServiceClient.CreateControlAsync(request);