Class ControlServiceClient (2.2.0)

Stay organized with collections Save and categorize content based on your preferences.
public abstract class ControlServiceClient

ControlService client wrapper, for convenient use.

Inheritance

Object > ControlServiceClient

Derived Types

Namespace

Google.Cloud.Retail.V2

Assembly

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
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default ControlService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default ControlService scopes are:

GrpcClient

public virtual ControlService.ControlServiceClient GrpcClient { get; }

The underlying gRPC ControlService client

Property Value
TypeDescription
ControlService.ControlServiceClient

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

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
TypeDescription
ControlServiceClient

The created ControlServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<ControlServiceClient>

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
NameDescription
parentCatalogName

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

controlControl

Required. The Control to create.

controlIdString

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]-_/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Control

The RPC response.

Example
// 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
NameDescription
requestCreateControlRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Control

The RPC response.

Example
// 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
NameDescription
parentString

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

controlControl

Required. The Control to create.

controlIdString

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]-_/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Control

The RPC response.

Example
// 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
NameDescription
parentCatalogName

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

controlControl

Required. The Control to create.

controlIdString

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]-_/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Control>

A Task containing the RPC response.

Example
// 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
NameDescription
parentCatalogName

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

controlControl

Required. The Control to create.

controlIdString

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]-_/.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Control>

A Task containing the RPC response.

Example
// 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
NameDescription
requestCreateControlRequest

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

A Task containing the RPC response.

Example
// 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
NameDescription
requestCreateControlRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Control>

A Task containing the RPC response.

Example
// 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(String, Control, String, CallSettings)

public virtual Task<Control> CreateControlAsync(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
NameDescription
parentString

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

controlControl

Required. The Control to create.

controlIdString

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]-_/.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Control>

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
Control control = new Control();
string controlId = "";
// Make the request
Control response = await controlServiceClient.CreateControlAsync(parent, control, controlId);

CreateControlAsync(String, Control, String, CancellationToken)

public virtual Task<Control> CreateControlAsync(string 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
NameDescription
parentString

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

controlControl

Required. The Control to create.

controlIdString

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]-_/.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Control>

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
Control control = new Control();
string controlId = "";
// Make the request
Control response = await controlServiceClient.CreateControlAsync(parent, control, controlId);

DeleteControl(ControlName, CallSettings)

public virtual void DeleteControl(ControlName name, CallSettings callSettings = null)

Deletes a Control.

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

Parameters
NameDescription
nameControlName

Required. The resource name of the Control to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
ControlName name = ControlName.FromProjectLocationCatalogControl("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]");
// Make the request
controlServiceClient.DeleteControl(name);

DeleteControl(DeleteControlRequest, CallSettings)

public virtual void DeleteControl(DeleteControlRequest request, CallSettings callSettings = null)

Deletes a Control.

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

Parameters
NameDescription
requestDeleteControlRequest

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
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
DeleteControlRequest request = new DeleteControlRequest
{
    ControlName = ControlName.FromProjectLocationCatalogControl("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"),
};
// Make the request
controlServiceClient.DeleteControl(request);

DeleteControl(String, CallSettings)

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

Deletes a Control.

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

Parameters
NameDescription
nameString

Required. The resource name of the Control to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/controls/[CONTROL]";
// Make the request
controlServiceClient.DeleteControl(name);

DeleteControlAsync(ControlName, CallSettings)

public virtual Task DeleteControlAsync(ControlName name, CallSettings callSettings = null)

Deletes a Control.

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

Parameters
NameDescription
nameControlName

Required. The resource name of the Control to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
ControlName name = ControlName.FromProjectLocationCatalogControl("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]");
// Make the request
await controlServiceClient.DeleteControlAsync(name);

DeleteControlAsync(ControlName, CancellationToken)

public virtual Task DeleteControlAsync(ControlName name, CancellationToken cancellationToken)

Deletes a Control.

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

Parameters
NameDescription
nameControlName

Required. The resource name of the Control to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
ControlName name = ControlName.FromProjectLocationCatalogControl("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]");
// Make the request
await controlServiceClient.DeleteControlAsync(name);

DeleteControlAsync(DeleteControlRequest, CallSettings)

public virtual Task DeleteControlAsync(DeleteControlRequest request, CallSettings callSettings = null)

Deletes a Control.

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

Parameters
NameDescription
requestDeleteControlRequest

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
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteControlRequest request = new DeleteControlRequest
{
    ControlName = ControlName.FromProjectLocationCatalogControl("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"),
};
// Make the request
await controlServiceClient.DeleteControlAsync(request);

DeleteControlAsync(DeleteControlRequest, CancellationToken)

public virtual Task DeleteControlAsync(DeleteControlRequest request, CancellationToken cancellationToken)

Deletes a Control.

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

Parameters
NameDescription
requestDeleteControlRequest

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
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteControlRequest request = new DeleteControlRequest
{
    ControlName = ControlName.FromProjectLocationCatalogControl("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"),
};
// Make the request
await controlServiceClient.DeleteControlAsync(request);

DeleteControlAsync(String, CallSettings)

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

Deletes a Control.

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

Parameters
NameDescription
nameString

Required. The resource name of the Control to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/controls/[CONTROL]";
// Make the request
await controlServiceClient.DeleteControlAsync(name);

DeleteControlAsync(String, CancellationToken)

public virtual Task DeleteControlAsync(string name, CancellationToken cancellationToken)

Deletes a Control.

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

Parameters
NameDescription
nameString

Required. The resource name of the Control to delete. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/controls/[CONTROL]";
// Make the request
await controlServiceClient.DeleteControlAsync(name);

GetControl(ControlName, CallSettings)

public virtual Control GetControl(ControlName name, CallSettings callSettings = null)

Gets a Control.

Parameters
NameDescription
nameControlName

Required. The resource name of the Control to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Control

The RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
ControlName name = ControlName.FromProjectLocationCatalogControl("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]");
// Make the request
Control response = controlServiceClient.GetControl(name);

GetControl(GetControlRequest, CallSettings)

public virtual Control GetControl(GetControlRequest request, CallSettings callSettings = null)

Gets a Control.

Parameters
NameDescription
requestGetControlRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Control

The RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
GetControlRequest request = new GetControlRequest
{
    ControlName = ControlName.FromProjectLocationCatalogControl("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"),
};
// Make the request
Control response = controlServiceClient.GetControl(request);

GetControl(String, CallSettings)

public virtual Control GetControl(string name, CallSettings callSettings = null)

Gets a Control.

Parameters
NameDescription
nameString

Required. The resource name of the Control to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Control

The RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/controls/[CONTROL]";
// Make the request
Control response = controlServiceClient.GetControl(name);

GetControlAsync(ControlName, CallSettings)

public virtual Task<Control> GetControlAsync(ControlName name, CallSettings callSettings = null)

Gets a Control.

Parameters
NameDescription
nameControlName

Required. The resource name of the Control to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Control>

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
ControlName name = ControlName.FromProjectLocationCatalogControl("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]");
// Make the request
Control response = await controlServiceClient.GetControlAsync(name);

GetControlAsync(ControlName, CancellationToken)

public virtual Task<Control> GetControlAsync(ControlName name, CancellationToken cancellationToken)

Gets a Control.

Parameters
NameDescription
nameControlName

Required. The resource name of the Control to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Control>

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
ControlName name = ControlName.FromProjectLocationCatalogControl("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]");
// Make the request
Control response = await controlServiceClient.GetControlAsync(name);

GetControlAsync(GetControlRequest, CallSettings)

public virtual Task<Control> GetControlAsync(GetControlRequest request, CallSettings callSettings = null)

Gets a Control.

Parameters
NameDescription
requestGetControlRequest

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

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
GetControlRequest request = new GetControlRequest
{
    ControlName = ControlName.FromProjectLocationCatalogControl("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"),
};
// Make the request
Control response = await controlServiceClient.GetControlAsync(request);

GetControlAsync(GetControlRequest, CancellationToken)

public virtual Task<Control> GetControlAsync(GetControlRequest request, CancellationToken cancellationToken)

Gets a Control.

Parameters
NameDescription
requestGetControlRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Control>

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
GetControlRequest request = new GetControlRequest
{
    ControlName = ControlName.FromProjectLocationCatalogControl("[PROJECT]", "[LOCATION]", "[CATALOG]", "[CONTROL]"),
};
// Make the request
Control response = await controlServiceClient.GetControlAsync(request);

GetControlAsync(String, CallSettings)

public virtual Task<Control> GetControlAsync(string name, CallSettings callSettings = null)

Gets a Control.

Parameters
NameDescription
nameString

Required. The resource name of the Control to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Control>

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/controls/[CONTROL]";
// Make the request
Control response = await controlServiceClient.GetControlAsync(name);

GetControlAsync(String, CancellationToken)

public virtual Task<Control> GetControlAsync(string name, CancellationToken cancellationToken)

Gets a Control.

Parameters
NameDescription
nameString

Required. The resource name of the Control to get. Format: projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Control>

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/controls/[CONTROL]";
// Make the request
Control response = await controlServiceClient.GetControlAsync(name);

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

public virtual PagedEnumerable<ListControlsResponse, Control> ListControls(CatalogName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

Parameters
NameDescription
parentCatalogName

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

pageTokenString

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<ListControlsResponse, Control>

A pageable sequence of Control resources.

Example
// Create client
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
// Make the request
PagedEnumerable<ListControlsResponse, Control> response = controlServiceClient.ListControls(parent);

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

ListControls(ListControlsRequest, CallSettings)

public virtual PagedEnumerable<ListControlsResponse, Control> ListControls(ListControlsRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestListControlsRequest

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<ListControlsResponse, Control>

A pageable sequence of Control resources.

Example
// Create client
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
ListControlsRequest request = new ListControlsRequest
{
    ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListControlsResponse, Control> response = controlServiceClient.ListControls(request);

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

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

public virtual PagedEnumerable<ListControlsResponse, Control> ListControls(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

Parameters
NameDescription
parentString

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

pageTokenString

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<ListControlsResponse, Control>

A pageable sequence of Control resources.

Example
// Create client
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
// Make the request
PagedEnumerable<ListControlsResponse, Control> response = controlServiceClient.ListControls(parent);

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

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

public virtual PagedAsyncEnumerable<ListControlsResponse, Control> ListControlsAsync(CatalogName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

Parameters
NameDescription
parentCatalogName

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

pageTokenString

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<ListControlsResponse, Control>

A pageable asynchronous sequence of Control resources.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
CatalogName parent = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]");
// Make the request
PagedAsyncEnumerable<ListControlsResponse, Control> response = controlServiceClient.ListControlsAsync(parent);

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

ListControlsAsync(ListControlsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListControlsResponse, Control> ListControlsAsync(ListControlsRequest request, CallSettings callSettings = null)

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

Parameters
NameDescription
requestListControlsRequest

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<ListControlsResponse, Control>

A pageable asynchronous sequence of Control resources.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
ListControlsRequest request = new ListControlsRequest
{
    ParentAsCatalogName = CatalogName.FromProjectLocationCatalog("[PROJECT]", "[LOCATION]", "[CATALOG]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListControlsResponse, Control> response = controlServiceClient.ListControlsAsync(request);

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

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

public virtual PagedAsyncEnumerable<ListControlsResponse, Control> ListControlsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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

Parameters
NameDescription
parentString

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

pageTokenString

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<ListControlsResponse, Control>

A pageable asynchronous sequence of Control resources.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]";
// Make the request
PagedAsyncEnumerable<ListControlsResponse, Control> response = controlServiceClient.ListControlsAsync(parent);

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

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.

UpdateControl(Control, FieldMask, CallSettings)

public virtual Control UpdateControl(Control control, FieldMask updateMask, CallSettings callSettings = null)

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
NameDescription
controlControl

Required. The Control to update.

updateMaskFieldMask

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

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

If not set or empty, all supported fields are updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Control

The RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
Control control = new Control();
FieldMask updateMask = new FieldMask();
// Make the request
Control response = controlServiceClient.UpdateControl(control, updateMask);

UpdateControl(UpdateControlRequest, CallSettings)

public virtual Control UpdateControl(UpdateControlRequest request, CallSettings callSettings = null)

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
NameDescription
requestUpdateControlRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Control

The RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = ControlServiceClient.Create();
// Initialize request argument(s)
UpdateControlRequest request = new UpdateControlRequest
{
    Control = new Control(),
    UpdateMask = new FieldMask(),
};
// Make the request
Control response = controlServiceClient.UpdateControl(request);

UpdateControlAsync(Control, FieldMask, CallSettings)

public virtual Task<Control> UpdateControlAsync(Control control, FieldMask updateMask, CallSettings callSettings = null)

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
NameDescription
controlControl

Required. The Control to update.

updateMaskFieldMask

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

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

If not set or empty, all supported fields are updated.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Control>

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
Control control = new Control();
FieldMask updateMask = new FieldMask();
// Make the request
Control response = await controlServiceClient.UpdateControlAsync(control, updateMask);

UpdateControlAsync(Control, FieldMask, CancellationToken)

public virtual Task<Control> UpdateControlAsync(Control control, FieldMask updateMask, CancellationToken cancellationToken)

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
NameDescription
controlControl

Required. The Control to update.

updateMaskFieldMask

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

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

If not set or empty, all supported fields are updated.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Control>

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
Control control = new Control();
FieldMask updateMask = new FieldMask();
// Make the request
Control response = await controlServiceClient.UpdateControlAsync(control, updateMask);

UpdateControlAsync(UpdateControlRequest, CallSettings)

public virtual Task<Control> UpdateControlAsync(UpdateControlRequest request, CallSettings callSettings = null)

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
NameDescription
requestUpdateControlRequest

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

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateControlRequest request = new UpdateControlRequest
{
    Control = new Control(),
    UpdateMask = new FieldMask(),
};
// Make the request
Control response = await controlServiceClient.UpdateControlAsync(request);

UpdateControlAsync(UpdateControlRequest, CancellationToken)

public virtual Task<Control> UpdateControlAsync(UpdateControlRequest request, CancellationToken cancellationToken)

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
NameDescription
requestUpdateControlRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Control>

A Task containing the RPC response.

Example
// Create client
ControlServiceClient controlServiceClient = await ControlServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateControlRequest request = new UpdateControlRequest
{
    Control = new Control(),
    UpdateMask = new FieldMask(),
};
// Make the request
Control response = await controlServiceClient.UpdateControlAsync(request);