2.16.0 (latest) 2.15.0 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0

    public class ControlService.ControlServiceClient : ClientBase<ControlService.ControlServiceClient>

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

Client for ControlService

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [ClientBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.md.txt) \> [ClientBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.md.txt)[ControlService](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Retail.V2/latest/Google.Cloud.Retail.V2.ControlService.md.txt)[ControlServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Retail.V2/latest/Google.Cloud.Retail.V2.ControlService.ControlServiceClient.md.txt) \> ControlService.ControlServiceClient

## Inherited Members

[ClientBase\<ControlService.ControlServiceClient\>.WithHost(string)](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.md.txt#Grpc_Core_ClientBase_1_WithHost_System_String_) [ClientBase.CallInvoker](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.md.txt#Grpc_Core_ClientBase_CallInvoker) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Retail.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Retail.V2/latest/Google.Cloud.Retail.V2.md.txt)

## Assembly

Google.Cloud.Retail.V2.dll

## Constructors

### ControlServiceClient()

    protected ControlServiceClient()

Protected parameterless constructor to allow creation of test doubles.

### ControlServiceClient(CallInvoker)

    public ControlServiceClient(CallInvoker callInvoker)

Creates a new client for ControlService that uses a custom `CallInvoker`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `callInvoker` | `CallInvoker` The callInvoker to use to make remote calls. |

### ControlServiceClient(ChannelBase)

    public ControlServiceClient(ChannelBase channel)

Creates a new client for ControlService

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `channel` | `ChannelBase` The channel to use to make remote calls. |

### ControlServiceClient(ClientBaseConfiguration)

    protected ControlServiceClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `ClientBaseClientBaseConfiguration` The client configuration. |

## Methods

### CreateControl(CreateControlRequest, CallOptions)

    public virtual Control CreateControl(CreateControlRequest request, CallOptions options)

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 to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Control` | The response received from the server. |

### CreateControl(CreateControlRequest, Metadata, DateTime?, CancellationToken)

    public virtual Control CreateControl(CreateControlRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Control` | The response received from the server. |

### CreateControlAsync(CreateControlRequest, CallOptions)

    public virtual AsyncUnaryCall<Control> CreateControlAsync(CreateControlRequest request, CallOptions options)

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 to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallControl` | The call object. |

### CreateControlAsync(CreateControlRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Control> CreateControlAsync(CreateControlRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

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 to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallControl` | The call object. |

### CreateLocationsClient()

    public virtual Locations.LocationsClient CreateLocationsClient()

Creates a new instance of [Locations.LocationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.Locations.LocationsClient.md.txt) using the same call invoker as
this client.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `LocationsLocationsClient` | A new [Locations.LocationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.Locations.LocationsClient.md.txt) for the same target as this client. |

### DeleteControl(DeleteControlRequest, CallOptions)

    public virtual Empty DeleteControl(DeleteControlRequest request, CallOptions options)

Deletes a Control.

If the \[Control\]\[google.cloud.retail.v2.Control\] to delete does not exist,
a NOT_FOUND error is returned.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `DeleteControlRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Empty` | The response received from the server. |

### DeleteControl(DeleteControlRequest, Metadata, DateTime?, CancellationToken)

    public virtual Empty DeleteControl(DeleteControlRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Deletes a Control.

If the \[Control\]\[google.cloud.retail.v2.Control\] to delete does not exist,
a NOT_FOUND error is returned.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `DeleteControlRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Empty` | The response received from the server. |

### DeleteControlAsync(DeleteControlRequest, CallOptions)

    public virtual AsyncUnaryCall<Empty> DeleteControlAsync(DeleteControlRequest request, CallOptions options)

Deletes a Control.

If the \[Control\]\[google.cloud.retail.v2.Control\] to delete does not exist,
a NOT_FOUND error is returned.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `DeleteControlRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallEmpty` | The call object. |

### DeleteControlAsync(DeleteControlRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Empty> DeleteControlAsync(DeleteControlRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Deletes a Control.

If the \[Control\]\[google.cloud.retail.v2.Control\] to delete does not exist,
a NOT_FOUND error is returned.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `DeleteControlRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallEmpty` | The call object. |

### GetControl(GetControlRequest, CallOptions)

    public virtual Control GetControl(GetControlRequest request, CallOptions options)

Gets a Control.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetControlRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Control` | The response received from the server. |

### GetControl(GetControlRequest, Metadata, DateTime?, CancellationToken)

    public virtual Control GetControl(GetControlRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets a Control.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetControlRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Control` | The response received from the server. |

### GetControlAsync(GetControlRequest, CallOptions)

    public virtual AsyncUnaryCall<Control> GetControlAsync(GetControlRequest request, CallOptions options)

Gets a Control.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetControlRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallControl` | The call object. |

### GetControlAsync(GetControlRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Control> GetControlAsync(GetControlRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets a Control.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `GetControlRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallControl` | The call object. |

### ListControls(ListControlsRequest, CallOptions)

    public virtual ListControlsResponse ListControls(ListControlsRequest request, CallOptions options)

Lists all Controls by their parent
\[Catalog\]\[google.cloud.retail.v2.Catalog\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ListControlsRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ListControlsResponse` | The response received from the server. |

### ListControls(ListControlsRequest, Metadata, DateTime?, CancellationToken)

    public virtual ListControlsResponse ListControls(ListControlsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists all Controls by their parent
\[Catalog\]\[google.cloud.retail.v2.Catalog\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ListControlsRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ListControlsResponse` | The response received from the server. |

### ListControlsAsync(ListControlsRequest, CallOptions)

    public virtual AsyncUnaryCall<ListControlsResponse> ListControlsAsync(ListControlsRequest request, CallOptions options)

Lists all Controls by their parent
\[Catalog\]\[google.cloud.retail.v2.Catalog\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ListControlsRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallListControlsResponse` | The call object. |

### ListControlsAsync(ListControlsRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<ListControlsResponse> ListControlsAsync(ListControlsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists all Controls by their parent
\[Catalog\]\[google.cloud.retail.v2.Catalog\].

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `ListControlsRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallListControlsResponse` | The call object. |

### NewInstance(ClientBaseConfiguration)

    protected override ControlService.ControlServiceClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given `ClientBaseConfiguration`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `ClientBaseClientBaseConfiguration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `ControlServiceControlServiceClient` |   |

**Overrides** Grpc.Core.ClientBase\<Google.Cloud.Retail.V2.ControlService.ControlServiceClient\>.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)

### UpdateControl(UpdateControlRequest, CallOptions)

    public virtual Control UpdateControl(UpdateControlRequest request, CallOptions options)

Updates a Control.

\[Control\]\[google.cloud.retail.v2.Control\] cannot be set to a different
oneof field, if so an INVALID_ARGUMENT is returned. If the
\[Control\]\[google.cloud.retail.v2.Control\] to update does not exist, a
NOT_FOUND error is returned.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `UpdateControlRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Control` | The response received from the server. |

### UpdateControl(UpdateControlRequest, Metadata, DateTime?, CancellationToken)

    public virtual Control UpdateControl(UpdateControlRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Updates a Control.

\[Control\]\[google.cloud.retail.v2.Control\] cannot be set to a different
oneof field, if so an INVALID_ARGUMENT is returned. If the
\[Control\]\[google.cloud.retail.v2.Control\] to update does not exist, a
NOT_FOUND error is returned.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `UpdateControlRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Control` | The response received from the server. |

### UpdateControlAsync(UpdateControlRequest, CallOptions)

    public virtual AsyncUnaryCall<Control> UpdateControlAsync(UpdateControlRequest request, CallOptions options)

Updates a Control.

\[Control\]\[google.cloud.retail.v2.Control\] cannot be set to a different
oneof field, if so an INVALID_ARGUMENT is returned. If the
\[Control\]\[google.cloud.retail.v2.Control\] to update does not exist, a
NOT_FOUND error is returned.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `UpdateControlRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallControl` | The call object. |

### UpdateControlAsync(UpdateControlRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Control> UpdateControlAsync(UpdateControlRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Updates a Control.

\[Control\]\[google.cloud.retail.v2.Control\] cannot be set to a different
oneof field, if so an INVALID_ARGUMENT is returned. If the
\[Control\]\[google.cloud.retail.v2.Control\] to update does not exist, a
NOT_FOUND error is returned.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `UpdateControlRequest` The request to send to the server. |
| `headers` | `Metadata` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallControl` | The call object. |