Retail v2 API - Class ProductServiceClient (2.12.0)

public abstract class ProductServiceClient

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

ProductService client wrapper, for convenient use.

Inheritance

object > ProductServiceClient

Derived Types

Namespace

Google.Cloud.Retail.V2

Assembly

Google.Cloud.Retail.V2.dll

Remarks

Service for ingesting [Product][google.cloud.retail.v2.Product] information of the customer's website.

Properties

AddFulfillmentPlacesOperationsClient

public virtual OperationsClient AddFulfillmentPlacesOperationsClient { get; }

The long-running operations client for AddFulfillmentPlaces.

Property Value
Type Description
OperationsClient

AddLocalInventoriesOperationsClient

public virtual OperationsClient AddLocalInventoriesOperationsClient { get; }

The long-running operations client for AddLocalInventories.

Property Value
Type Description
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the ProductService 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 ProductService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default ProductService scopes are:

GrpcClient

public virtual ProductService.ProductServiceClient GrpcClient { get; }

The underlying gRPC ProductService client

Property Value
Type Description
ProductServiceProductServiceClient

ImportProductsOperationsClient

public virtual OperationsClient ImportProductsOperationsClient { get; }

The long-running operations client for ImportProducts.

Property Value
Type Description
OperationsClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

PurgeProductsOperationsClient

public virtual OperationsClient PurgeProductsOperationsClient { get; }

The long-running operations client for PurgeProducts.

Property Value
Type Description
OperationsClient

RemoveFulfillmentPlacesOperationsClient

public virtual OperationsClient RemoveFulfillmentPlacesOperationsClient { get; }

The long-running operations client for RemoveFulfillmentPlaces.

Property Value
Type Description
OperationsClient

RemoveLocalInventoriesOperationsClient

public virtual OperationsClient RemoveLocalInventoriesOperationsClient { get; }

The long-running operations client for RemoveLocalInventories.

Property Value
Type Description
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

SetInventoryOperationsClient

public virtual OperationsClient SetInventoryOperationsClient { get; }

The long-running operations client for SetInventory.

Property Value
Type Description
OperationsClient

Methods

AddFulfillmentPlaces(AddFulfillmentPlacesRequest, CallSettings)

public virtual Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> AddFulfillmentPlaces(AddFulfillmentPlacesRequest request, CallSettings callSettings = null)

We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request AddFulfillmentPlacesRequest

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
OperationAddFulfillmentPlacesResponseAddFulfillmentPlacesMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
AddFulfillmentPlacesRequest request = new AddFulfillmentPlacesRequest
{
    ProductAsProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
    Type = "",
    PlaceIds = { "", },
    AddTime = new Timestamp(),
    AllowMissing = false,
};
// Make the request
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> response = productServiceClient.AddFulfillmentPlaces(request);

// Poll until the returned long-running operation is complete
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
AddFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> retrievedResponse = productServiceClient.PollOnceAddFulfillmentPlaces(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

AddFulfillmentPlaces(ProductName, CallSettings)

public virtual Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> AddFulfillmentPlaces(ProductName product, CallSettings callSettings = null)

We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAddFulfillmentPlacesResponseAddFulfillmentPlacesMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
ProductName product = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> response = productServiceClient.AddFulfillmentPlaces(product);

// Poll until the returned long-running operation is complete
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
AddFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> retrievedResponse = productServiceClient.PollOnceAddFulfillmentPlaces(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

AddFulfillmentPlaces(string, CallSettings)

public virtual Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> AddFulfillmentPlaces(string product, CallSettings callSettings = null)

We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAddFulfillmentPlacesResponseAddFulfillmentPlacesMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
string product = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> response = productServiceClient.AddFulfillmentPlaces(product);

// Poll until the returned long-running operation is complete
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
AddFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> retrievedResponse = productServiceClient.PollOnceAddFulfillmentPlaces(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

AddFulfillmentPlacesAsync(AddFulfillmentPlacesRequest, CallSettings)

public virtual Task<Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>> AddFulfillmentPlacesAsync(AddFulfillmentPlacesRequest request, CallSettings callSettings = null)

We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request AddFulfillmentPlacesRequest

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
TaskOperationAddFulfillmentPlacesResponseAddFulfillmentPlacesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
AddFulfillmentPlacesRequest request = new AddFulfillmentPlacesRequest
{
    ProductAsProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
    Type = "",
    PlaceIds = { "", },
    AddTime = new Timestamp(),
    AllowMissing = false,
};
// Make the request
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> response = await productServiceClient.AddFulfillmentPlacesAsync(request);

// Poll until the returned long-running operation is complete
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> retrievedResponse = await productServiceClient.PollOnceAddFulfillmentPlacesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

AddFulfillmentPlacesAsync(AddFulfillmentPlacesRequest, CancellationToken)

public virtual Task<Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>> AddFulfillmentPlacesAsync(AddFulfillmentPlacesRequest request, CancellationToken cancellationToken)

We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request AddFulfillmentPlacesRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationAddFulfillmentPlacesResponseAddFulfillmentPlacesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
AddFulfillmentPlacesRequest request = new AddFulfillmentPlacesRequest
{
    ProductAsProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
    Type = "",
    PlaceIds = { "", },
    AddTime = new Timestamp(),
    AllowMissing = false,
};
// Make the request
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> response = await productServiceClient.AddFulfillmentPlacesAsync(request);

// Poll until the returned long-running operation is complete
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> retrievedResponse = await productServiceClient.PollOnceAddFulfillmentPlacesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

AddFulfillmentPlacesAsync(ProductName, CallSettings)

public virtual Task<Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>> AddFulfillmentPlacesAsync(ProductName product, CallSettings callSettings = null)

We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAddFulfillmentPlacesResponseAddFulfillmentPlacesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName product = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> response = await productServiceClient.AddFulfillmentPlacesAsync(product);

// Poll until the returned long-running operation is complete
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> retrievedResponse = await productServiceClient.PollOnceAddFulfillmentPlacesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

AddFulfillmentPlacesAsync(ProductName, CancellationToken)

public virtual Task<Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>> AddFulfillmentPlacesAsync(ProductName product, CancellationToken cancellationToken)

We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationAddFulfillmentPlacesResponseAddFulfillmentPlacesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName product = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> response = await productServiceClient.AddFulfillmentPlacesAsync(product);

// Poll until the returned long-running operation is complete
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> retrievedResponse = await productServiceClient.PollOnceAddFulfillmentPlacesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

AddFulfillmentPlacesAsync(string, CallSettings)

public virtual Task<Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>> AddFulfillmentPlacesAsync(string product, CallSettings callSettings = null)

We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAddFulfillmentPlacesResponseAddFulfillmentPlacesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string product = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> response = await productServiceClient.AddFulfillmentPlacesAsync(product);

// Poll until the returned long-running operation is complete
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> retrievedResponse = await productServiceClient.PollOnceAddFulfillmentPlacesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

AddFulfillmentPlacesAsync(string, CancellationToken)

public virtual Task<Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>> AddFulfillmentPlacesAsync(string product, CancellationToken cancellationToken)

We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationAddFulfillmentPlacesResponseAddFulfillmentPlacesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string product = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> response = await productServiceClient.AddFulfillmentPlacesAsync(product);

// Poll until the returned long-running operation is complete
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> retrievedResponse = await productServiceClient.PollOnceAddFulfillmentPlacesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

AddLocalInventories(AddLocalInventoriesRequest, CallSettings)

public virtual Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> AddLocalInventories(AddLocalInventoriesRequest request, CallSettings callSettings = null)

Updates local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places, while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request AddLocalInventoriesRequest

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
OperationAddLocalInventoriesResponseAddLocalInventoriesMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
AddLocalInventoriesRequest request = new AddLocalInventoriesRequest
{
    ProductAsProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
    LocalInventories =
    {
        new LocalInventory(),
    },
    AddMask = new FieldMask(),
    AddTime = new Timestamp(),
    AllowMissing = false,
};
// Make the request
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> response = productServiceClient.AddLocalInventories(request);

// Poll until the returned long-running operation is complete
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
AddLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> retrievedResponse = productServiceClient.PollOnceAddLocalInventories(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

AddLocalInventories(ProductName, CallSettings)

public virtual Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> AddLocalInventories(ProductName product, CallSettings callSettings = null)

Updates local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places, while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAddLocalInventoriesResponseAddLocalInventoriesMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
ProductName product = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> response = productServiceClient.AddLocalInventories(product);

// Poll until the returned long-running operation is complete
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
AddLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> retrievedResponse = productServiceClient.PollOnceAddLocalInventories(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

AddLocalInventories(string, CallSettings)

public virtual Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> AddLocalInventories(string product, CallSettings callSettings = null)

Updates local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places, while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAddLocalInventoriesResponseAddLocalInventoriesMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
string product = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> response = productServiceClient.AddLocalInventories(product);

// Poll until the returned long-running operation is complete
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
AddLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> retrievedResponse = productServiceClient.PollOnceAddLocalInventories(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

AddLocalInventoriesAsync(AddLocalInventoriesRequest, CallSettings)

public virtual Task<Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>> AddLocalInventoriesAsync(AddLocalInventoriesRequest request, CallSettings callSettings = null)

Updates local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places, while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request AddLocalInventoriesRequest

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
TaskOperationAddLocalInventoriesResponseAddLocalInventoriesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
AddLocalInventoriesRequest request = new AddLocalInventoriesRequest
{
    ProductAsProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
    LocalInventories =
    {
        new LocalInventory(),
    },
    AddMask = new FieldMask(),
    AddTime = new Timestamp(),
    AllowMissing = false,
};
// Make the request
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> response = await productServiceClient.AddLocalInventoriesAsync(request);

// Poll until the returned long-running operation is complete
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> retrievedResponse = await productServiceClient.PollOnceAddLocalInventoriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

AddLocalInventoriesAsync(AddLocalInventoriesRequest, CancellationToken)

public virtual Task<Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>> AddLocalInventoriesAsync(AddLocalInventoriesRequest request, CancellationToken cancellationToken)

Updates local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places, while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request AddLocalInventoriesRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationAddLocalInventoriesResponseAddLocalInventoriesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
AddLocalInventoriesRequest request = new AddLocalInventoriesRequest
{
    ProductAsProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
    LocalInventories =
    {
        new LocalInventory(),
    },
    AddMask = new FieldMask(),
    AddTime = new Timestamp(),
    AllowMissing = false,
};
// Make the request
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> response = await productServiceClient.AddLocalInventoriesAsync(request);

// Poll until the returned long-running operation is complete
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> retrievedResponse = await productServiceClient.PollOnceAddLocalInventoriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

AddLocalInventoriesAsync(ProductName, CallSettings)

public virtual Task<Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>> AddLocalInventoriesAsync(ProductName product, CallSettings callSettings = null)

Updates local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places, while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAddLocalInventoriesResponseAddLocalInventoriesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName product = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> response = await productServiceClient.AddLocalInventoriesAsync(product);

// Poll until the returned long-running operation is complete
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> retrievedResponse = await productServiceClient.PollOnceAddLocalInventoriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

AddLocalInventoriesAsync(ProductName, CancellationToken)

public virtual Task<Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>> AddLocalInventoriesAsync(ProductName product, CancellationToken cancellationToken)

Updates local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places, while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationAddLocalInventoriesResponseAddLocalInventoriesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName product = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> response = await productServiceClient.AddLocalInventoriesAsync(product);

// Poll until the returned long-running operation is complete
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> retrievedResponse = await productServiceClient.PollOnceAddLocalInventoriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

AddLocalInventoriesAsync(string, CallSettings)

public virtual Task<Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>> AddLocalInventoriesAsync(string product, CallSettings callSettings = null)

Updates local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places, while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAddLocalInventoriesResponseAddLocalInventoriesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string product = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> response = await productServiceClient.AddLocalInventoriesAsync(product);

// Poll until the returned long-running operation is complete
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> retrievedResponse = await productServiceClient.PollOnceAddLocalInventoriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

AddLocalInventoriesAsync(string, CancellationToken)

public virtual Task<Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>> AddLocalInventoriesAsync(string product, CancellationToken cancellationToken)

Updates local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places, while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationAddLocalInventoriesResponseAddLocalInventoriesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string product = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> response = await productServiceClient.AddLocalInventoriesAsync(product);

// Poll until the returned long-running operation is complete
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
AddLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> retrievedResponse = await productServiceClient.PollOnceAddLocalInventoriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    AddLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

Create()

public static ProductServiceClient Create()

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

Returns
Type Description
ProductServiceClient

The created ProductServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskProductServiceClient

The task representing the created ProductServiceClient.

CreateProduct(BranchName, Product, string, CallSettings)

public virtual Product CreateProduct(BranchName parent, Product product, string productId, CallSettings callSettings = null)

Creates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
parent BranchName

Required. The parent catalog resource name, such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch.

product Product

Required. The [Product][google.cloud.retail.v2.Product] to create.

productId string

Required. The ID to use for the [Product][google.cloud.retail.v2.Product], which will become the final component of the [Product.name][google.cloud.retail.v2.Product.name].

If the caller does not have permission to create the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

This field must be unique among all [Product][google.cloud.retail.v2.Product]s with the same [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned.

This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Product

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
BranchName parent = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
Product product = new Product();
string productId = "";
// Make the request
Product response = productServiceClient.CreateProduct(parent, product, productId);

CreateProduct(CreateProductRequest, CallSettings)

public virtual Product CreateProduct(CreateProductRequest request, CallSettings callSettings = null)

Creates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request CreateProductRequest

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
Product

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
CreateProductRequest request = new CreateProductRequest
{
    ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
    Product = new Product(),
    ProductId = "",
};
// Make the request
Product response = productServiceClient.CreateProduct(request);

CreateProduct(string, Product, string, CallSettings)

public virtual Product CreateProduct(string parent, Product product, string productId, CallSettings callSettings = null)

Creates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
parent string

Required. The parent catalog resource name, such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch.

product Product

Required. The [Product][google.cloud.retail.v2.Product] to create.

productId string

Required. The ID to use for the [Product][google.cloud.retail.v2.Product], which will become the final component of the [Product.name][google.cloud.retail.v2.Product.name].

If the caller does not have permission to create the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

This field must be unique among all [Product][google.cloud.retail.v2.Product]s with the same [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned.

This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Product

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]";
Product product = new Product();
string productId = "";
// Make the request
Product response = productServiceClient.CreateProduct(parent, product, productId);

CreateProductAsync(BranchName, Product, string, CallSettings)

public virtual Task<Product> CreateProductAsync(BranchName parent, Product product, string productId, CallSettings callSettings = null)

Creates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
parent BranchName

Required. The parent catalog resource name, such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch.

product Product

Required. The [Product][google.cloud.retail.v2.Product] to create.

productId string

Required. The ID to use for the [Product][google.cloud.retail.v2.Product], which will become the final component of the [Product.name][google.cloud.retail.v2.Product.name].

If the caller does not have permission to create the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

This field must be unique among all [Product][google.cloud.retail.v2.Product]s with the same [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned.

This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
BranchName parent = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
Product product = new Product();
string productId = "";
// Make the request
Product response = await productServiceClient.CreateProductAsync(parent, product, productId);

CreateProductAsync(BranchName, Product, string, CancellationToken)

public virtual Task<Product> CreateProductAsync(BranchName parent, Product product, string productId, CancellationToken cancellationToken)

Creates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
parent BranchName

Required. The parent catalog resource name, such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch.

product Product

Required. The [Product][google.cloud.retail.v2.Product] to create.

productId string

Required. The ID to use for the [Product][google.cloud.retail.v2.Product], which will become the final component of the [Product.name][google.cloud.retail.v2.Product.name].

If the caller does not have permission to create the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

This field must be unique among all [Product][google.cloud.retail.v2.Product]s with the same [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned.

This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
BranchName parent = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
Product product = new Product();
string productId = "";
// Make the request
Product response = await productServiceClient.CreateProductAsync(parent, product, productId);

CreateProductAsync(CreateProductRequest, CallSettings)

public virtual Task<Product> CreateProductAsync(CreateProductRequest request, CallSettings callSettings = null)

Creates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request CreateProductRequest

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
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
CreateProductRequest request = new CreateProductRequest
{
    ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
    Product = new Product(),
    ProductId = "",
};
// Make the request
Product response = await productServiceClient.CreateProductAsync(request);

CreateProductAsync(CreateProductRequest, CancellationToken)

public virtual Task<Product> CreateProductAsync(CreateProductRequest request, CancellationToken cancellationToken)

Creates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request CreateProductRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
CreateProductRequest request = new CreateProductRequest
{
    ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
    Product = new Product(),
    ProductId = "",
};
// Make the request
Product response = await productServiceClient.CreateProductAsync(request);

CreateProductAsync(string, Product, string, CallSettings)

public virtual Task<Product> CreateProductAsync(string parent, Product product, string productId, CallSettings callSettings = null)

Creates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
parent string

Required. The parent catalog resource name, such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch.

product Product

Required. The [Product][google.cloud.retail.v2.Product] to create.

productId string

Required. The ID to use for the [Product][google.cloud.retail.v2.Product], which will become the final component of the [Product.name][google.cloud.retail.v2.Product.name].

If the caller does not have permission to create the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

This field must be unique among all [Product][google.cloud.retail.v2.Product]s with the same [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned.

This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]";
Product product = new Product();
string productId = "";
// Make the request
Product response = await productServiceClient.CreateProductAsync(parent, product, productId);

CreateProductAsync(string, Product, string, CancellationToken)

public virtual Task<Product> CreateProductAsync(string parent, Product product, string productId, CancellationToken cancellationToken)

Creates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
parent string

Required. The parent catalog resource name, such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch.

product Product

Required. The [Product][google.cloud.retail.v2.Product] to create.

productId string

Required. The ID to use for the [Product][google.cloud.retail.v2.Product], which will become the final component of the [Product.name][google.cloud.retail.v2.Product.name].

If the caller does not have permission to create the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

This field must be unique among all [Product][google.cloud.retail.v2.Product]s with the same [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned.

This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]";
Product product = new Product();
string productId = "";
// Make the request
Product response = await productServiceClient.CreateProductAsync(parent, product, productId);

DeleteProduct(DeleteProductRequest, CallSettings)

public virtual void DeleteProduct(DeleteProductRequest request, CallSettings callSettings = null)

Deletes a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request DeleteProductRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
DeleteProductRequest request = new DeleteProductRequest
{
    ProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
};
// Make the request
productServiceClient.DeleteProduct(request);

DeleteProduct(ProductName, CallSettings)

public virtual void DeleteProduct(ProductName name, CallSettings callSettings = null)

Deletes a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
name ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to delete the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

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

The [Product][google.cloud.retail.v2.Product] to delete can neither be a [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] [Product][google.cloud.retail.v2.Product] member nor a [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] [Product][google.cloud.retail.v2.Product] with more than one [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an INVALID_ARGUMENT error is returned.

All inventory information for the named [Product][google.cloud.retail.v2.Product] will be deleted.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
productServiceClient.DeleteProduct(name);

DeleteProduct(string, CallSettings)

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

Deletes a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
name string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to delete the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

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

The [Product][google.cloud.retail.v2.Product] to delete can neither be a [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] [Product][google.cloud.retail.v2.Product] member nor a [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] [Product][google.cloud.retail.v2.Product] with more than one [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an INVALID_ARGUMENT error is returned.

All inventory information for the named [Product][google.cloud.retail.v2.Product] will be deleted.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
productServiceClient.DeleteProduct(name);

DeleteProductAsync(DeleteProductRequest, CallSettings)

public virtual Task DeleteProductAsync(DeleteProductRequest request, CallSettings callSettings = null)

Deletes a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request DeleteProductRequest

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
Task

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteProductRequest request = new DeleteProductRequest
{
    ProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
};
// Make the request
await productServiceClient.DeleteProductAsync(request);

DeleteProductAsync(DeleteProductRequest, CancellationToken)

public virtual Task DeleteProductAsync(DeleteProductRequest request, CancellationToken cancellationToken)

Deletes a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request DeleteProductRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteProductRequest request = new DeleteProductRequest
{
    ProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
};
// Make the request
await productServiceClient.DeleteProductAsync(request);

DeleteProductAsync(ProductName, CallSettings)

public virtual Task DeleteProductAsync(ProductName name, CallSettings callSettings = null)

Deletes a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
name ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to delete the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

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

The [Product][google.cloud.retail.v2.Product] to delete can neither be a [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] [Product][google.cloud.retail.v2.Product] member nor a [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] [Product][google.cloud.retail.v2.Product] with more than one [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an INVALID_ARGUMENT error is returned.

All inventory information for the named [Product][google.cloud.retail.v2.Product] will be deleted.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
await productServiceClient.DeleteProductAsync(name);

DeleteProductAsync(ProductName, CancellationToken)

public virtual Task DeleteProductAsync(ProductName name, CancellationToken cancellationToken)

Deletes a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
name ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to delete the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

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

The [Product][google.cloud.retail.v2.Product] to delete can neither be a [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] [Product][google.cloud.retail.v2.Product] member nor a [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] [Product][google.cloud.retail.v2.Product] with more than one [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an INVALID_ARGUMENT error is returned.

All inventory information for the named [Product][google.cloud.retail.v2.Product] will be deleted.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
await productServiceClient.DeleteProductAsync(name);

DeleteProductAsync(string, CallSettings)

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

Deletes a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
name string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to delete the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

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

The [Product][google.cloud.retail.v2.Product] to delete can neither be a [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] [Product][google.cloud.retail.v2.Product] member nor a [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] [Product][google.cloud.retail.v2.Product] with more than one [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an INVALID_ARGUMENT error is returned.

All inventory information for the named [Product][google.cloud.retail.v2.Product] will be deleted.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
await productServiceClient.DeleteProductAsync(name);

DeleteProductAsync(string, CancellationToken)

public virtual Task DeleteProductAsync(string name, CancellationToken cancellationToken)

Deletes a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
name string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to delete the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

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

The [Product][google.cloud.retail.v2.Product] to delete can neither be a [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] [Product][google.cloud.retail.v2.Product] member nor a [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] [Product][google.cloud.retail.v2.Product] with more than one [variants][google.cloud.retail.v2.Product.Type.VARIANT]. Otherwise, an INVALID_ARGUMENT error is returned.

All inventory information for the named [Product][google.cloud.retail.v2.Product] will be deleted.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
await productServiceClient.DeleteProductAsync(name);

GetProduct(GetProductRequest, CallSettings)

public virtual Product GetProduct(GetProductRequest request, CallSettings callSettings = null)

Gets a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request GetProductRequest

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
Product

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
GetProductRequest request = new GetProductRequest
{
    ProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
};
// Make the request
Product response = productServiceClient.GetProduct(request);

GetProduct(ProductName, CallSettings)

public virtual Product GetProduct(ProductName name, CallSettings callSettings = null)

Gets a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
name ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Product

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Product response = productServiceClient.GetProduct(name);

GetProduct(string, CallSettings)

public virtual Product GetProduct(string name, CallSettings callSettings = null)

Gets a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
name string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Product

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Product response = productServiceClient.GetProduct(name);

GetProductAsync(GetProductRequest, CallSettings)

public virtual Task<Product> GetProductAsync(GetProductRequest request, CallSettings callSettings = null)

Gets a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request GetProductRequest

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
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
GetProductRequest request = new GetProductRequest
{
    ProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
};
// Make the request
Product response = await productServiceClient.GetProductAsync(request);

GetProductAsync(GetProductRequest, CancellationToken)

public virtual Task<Product> GetProductAsync(GetProductRequest request, CancellationToken cancellationToken)

Gets a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request GetProductRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
GetProductRequest request = new GetProductRequest
{
    ProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
};
// Make the request
Product response = await productServiceClient.GetProductAsync(request);

GetProductAsync(ProductName, CallSettings)

public virtual Task<Product> GetProductAsync(ProductName name, CallSettings callSettings = null)

Gets a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
name ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Product response = await productServiceClient.GetProductAsync(name);

GetProductAsync(ProductName, CancellationToken)

public virtual Task<Product> GetProductAsync(ProductName name, CancellationToken cancellationToken)

Gets a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
name ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Product response = await productServiceClient.GetProductAsync(name);

GetProductAsync(string, CallSettings)

public virtual Task<Product> GetProductAsync(string name, CallSettings callSettings = null)

Gets a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
name string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Product response = await productServiceClient.GetProductAsync(name);

GetProductAsync(string, CancellationToken)

public virtual Task<Product> GetProductAsync(string name, CancellationToken cancellationToken)

Gets a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
name string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the requested [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Product response = await productServiceClient.GetProductAsync(name);

ImportProducts(ImportProductsRequest, CallSettings)

public virtual Operation<ImportProductsResponse, ImportMetadata> ImportProducts(ImportProductsRequest request, CallSettings callSettings = null)

Bulk import of multiple [Product][google.cloud.retail.v2.Product]s.

Request processing may be synchronous. Non-existing items are created.

Note that it is possible for a subset of the [Product][google.cloud.retail.v2.Product]s to be successfully updated.

Parameters
Name Description
request ImportProductsRequest

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
OperationImportProductsResponseImportMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
ImportProductsRequest request = new ImportProductsRequest
{
    ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
    InputConfig = new ProductInputConfig(),
    ErrorsConfig = new ImportErrorsConfig(),
    UpdateMask = new FieldMask(),
    ReconciliationMode = ImportProductsRequest.Types.ReconciliationMode.Unspecified,
    NotificationPubsubTopic = "",
};
// Make the request
Operation<ImportProductsResponse, ImportMetadata> response = productServiceClient.ImportProducts(request);

// Poll until the returned long-running operation is complete
Operation<ImportProductsResponse, ImportMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ImportProductsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportProductsResponse, ImportMetadata> retrievedResponse = productServiceClient.PollOnceImportProducts(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportProductsResponse retrievedResult = retrievedResponse.Result;
}

ImportProductsAsync(ImportProductsRequest, CallSettings)

public virtual Task<Operation<ImportProductsResponse, ImportMetadata>> ImportProductsAsync(ImportProductsRequest request, CallSettings callSettings = null)

Bulk import of multiple [Product][google.cloud.retail.v2.Product]s.

Request processing may be synchronous. Non-existing items are created.

Note that it is possible for a subset of the [Product][google.cloud.retail.v2.Product]s to be successfully updated.

Parameters
Name Description
request ImportProductsRequest

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
TaskOperationImportProductsResponseImportMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ImportProductsRequest request = new ImportProductsRequest
{
    ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
    InputConfig = new ProductInputConfig(),
    ErrorsConfig = new ImportErrorsConfig(),
    UpdateMask = new FieldMask(),
    ReconciliationMode = ImportProductsRequest.Types.ReconciliationMode.Unspecified,
    NotificationPubsubTopic = "",
};
// Make the request
Operation<ImportProductsResponse, ImportMetadata> response = await productServiceClient.ImportProductsAsync(request);

// Poll until the returned long-running operation is complete
Operation<ImportProductsResponse, ImportMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportProductsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportProductsResponse, ImportMetadata> retrievedResponse = await productServiceClient.PollOnceImportProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportProductsResponse retrievedResult = retrievedResponse.Result;
}

ImportProductsAsync(ImportProductsRequest, CancellationToken)

public virtual Task<Operation<ImportProductsResponse, ImportMetadata>> ImportProductsAsync(ImportProductsRequest request, CancellationToken cancellationToken)

Bulk import of multiple [Product][google.cloud.retail.v2.Product]s.

Request processing may be synchronous. Non-existing items are created.

Note that it is possible for a subset of the [Product][google.cloud.retail.v2.Product]s to be successfully updated.

Parameters
Name Description
request ImportProductsRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationImportProductsResponseImportMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ImportProductsRequest request = new ImportProductsRequest
{
    ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
    InputConfig = new ProductInputConfig(),
    ErrorsConfig = new ImportErrorsConfig(),
    UpdateMask = new FieldMask(),
    ReconciliationMode = ImportProductsRequest.Types.ReconciliationMode.Unspecified,
    NotificationPubsubTopic = "",
};
// Make the request
Operation<ImportProductsResponse, ImportMetadata> response = await productServiceClient.ImportProductsAsync(request);

// Poll until the returned long-running operation is complete
Operation<ImportProductsResponse, ImportMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportProductsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportProductsResponse, ImportMetadata> retrievedResponse = await productServiceClient.PollOnceImportProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportProductsResponse retrievedResult = retrievedResponse.Result;
}

ListProducts(BranchName, string, int?, CallSettings)

public virtual PagedEnumerable<ListProductsResponse, Product> ListProducts(BranchName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Gets a list of [Product][google.cloud.retail.v2.Product]s.

Parameters
Name Description
parent BranchName

Required. The parent branch resource name, such as projects/*/locations/global/catalogs/default_catalog/branches/0. Use default_branch as the branch ID, to list products under the default branch.

If the caller does not have permission to list [Product][google.cloud.retail.v2.Product]s under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListProductsResponseProduct

A pageable sequence of Product resources.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
BranchName parent = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
// Make the request
PagedEnumerable<ListProductsResponse, Product> response = productServiceClient.ListProducts(parent);

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

ListProducts(ListProductsRequest, CallSettings)

public virtual PagedEnumerable<ListProductsResponse, Product> ListProducts(ListProductsRequest request, CallSettings callSettings = null)

Gets a list of [Product][google.cloud.retail.v2.Product]s.

Parameters
Name Description
request ListProductsRequest

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
PagedEnumerableListProductsResponseProduct

A pageable sequence of Product resources.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
ListProductsRequest request = new ListProductsRequest
{
    ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
    Filter = "",
    ReadMask = new FieldMask(),
};
// Make the request
PagedEnumerable<ListProductsResponse, Product> response = productServiceClient.ListProducts(request);

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

ListProducts(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListProductsResponse, Product> ListProducts(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Gets a list of [Product][google.cloud.retail.v2.Product]s.

Parameters
Name Description
parent string

Required. The parent branch resource name, such as projects/*/locations/global/catalogs/default_catalog/branches/0. Use default_branch as the branch ID, to list products under the default branch.

If the caller does not have permission to list [Product][google.cloud.retail.v2.Product]s under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListProductsResponseProduct

A pageable sequence of Product resources.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]";
// Make the request
PagedEnumerable<ListProductsResponse, Product> response = productServiceClient.ListProducts(parent);

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

ListProductsAsync(BranchName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListProductsResponse, Product> ListProductsAsync(BranchName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Gets a list of [Product][google.cloud.retail.v2.Product]s.

Parameters
Name Description
parent BranchName

Required. The parent branch resource name, such as projects/*/locations/global/catalogs/default_catalog/branches/0. Use default_branch as the branch ID, to list products under the default branch.

If the caller does not have permission to list [Product][google.cloud.retail.v2.Product]s under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListProductsResponseProduct

A pageable asynchronous sequence of Product resources.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
BranchName parent = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
// Make the request
PagedAsyncEnumerable<ListProductsResponse, Product> response = productServiceClient.ListProductsAsync(parent);

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

ListProductsAsync(ListProductsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListProductsResponse, Product> ListProductsAsync(ListProductsRequest request, CallSettings callSettings = null)

Gets a list of [Product][google.cloud.retail.v2.Product]s.

Parameters
Name Description
request ListProductsRequest

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
PagedAsyncEnumerableListProductsResponseProduct

A pageable asynchronous sequence of Product resources.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ListProductsRequest request = new ListProductsRequest
{
    ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
    Filter = "",
    ReadMask = new FieldMask(),
};
// Make the request
PagedAsyncEnumerable<ListProductsResponse, Product> response = productServiceClient.ListProductsAsync(request);

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

ListProductsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListProductsResponse, Product> ListProductsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Gets a list of [Product][google.cloud.retail.v2.Product]s.

Parameters
Name Description
parent string

Required. The parent branch resource name, such as projects/*/locations/global/catalogs/default_catalog/branches/0. Use default_branch as the branch ID, to list products under the default branch.

If the caller does not have permission to list [Product][google.cloud.retail.v2.Product]s under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListProductsResponseProduct

A pageable asynchronous sequence of Product resources.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]";
// Make the request
PagedAsyncEnumerable<ListProductsResponse, Product> response = productServiceClient.ListProductsAsync(parent);

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

PollOnceAddFulfillmentPlaces(string, CallSettings)

public virtual Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> PollOnceAddFulfillmentPlaces(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of AddFulfillmentPlaces .

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAddFulfillmentPlacesResponseAddFulfillmentPlacesMetadata

The result of polling the operation.

PollOnceAddFulfillmentPlacesAsync(string, CallSettings)

public virtual Task<Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>> PollOnceAddFulfillmentPlacesAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of AddFulfillmentPlaces.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAddFulfillmentPlacesResponseAddFulfillmentPlacesMetadata

A task representing the result of polling the operation.

PollOnceAddLocalInventories(string, CallSettings)

public virtual Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> PollOnceAddLocalInventories(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of AddLocalInventories .

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationAddLocalInventoriesResponseAddLocalInventoriesMetadata

The result of polling the operation.

PollOnceAddLocalInventoriesAsync(string, CallSettings)

public virtual Task<Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>> PollOnceAddLocalInventoriesAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of AddLocalInventories.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationAddLocalInventoriesResponseAddLocalInventoriesMetadata

A task representing the result of polling the operation.

PollOnceImportProducts(string, CallSettings)

public virtual Operation<ImportProductsResponse, ImportMetadata> PollOnceImportProducts(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of ImportProducts.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationImportProductsResponseImportMetadata

The result of polling the operation.

PollOnceImportProductsAsync(string, CallSettings)

public virtual Task<Operation<ImportProductsResponse, ImportMetadata>> PollOnceImportProductsAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of ImportProducts.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationImportProductsResponseImportMetadata

A task representing the result of polling the operation.

PollOncePurgeProducts(string, CallSettings)

public virtual Operation<PurgeProductsResponse, PurgeProductsMetadata> PollOncePurgeProducts(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of PurgeProducts.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationPurgeProductsResponsePurgeProductsMetadata

The result of polling the operation.

PollOncePurgeProductsAsync(string, CallSettings)

public virtual Task<Operation<PurgeProductsResponse, PurgeProductsMetadata>> PollOncePurgeProductsAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of PurgeProducts.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationPurgeProductsResponsePurgeProductsMetadata

A task representing the result of polling the operation.

PollOnceRemoveFulfillmentPlaces(string, CallSettings)

public virtual Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> PollOnceRemoveFulfillmentPlaces(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of RemoveFulfillmentPlaces.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationRemoveFulfillmentPlacesResponseRemoveFulfillmentPlacesMetadata

The result of polling the operation.

PollOnceRemoveFulfillmentPlacesAsync(string, CallSettings)

public virtual Task<Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata>> PollOnceRemoveFulfillmentPlacesAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of RemoveFulfillmentPlaces.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationRemoveFulfillmentPlacesResponseRemoveFulfillmentPlacesMetadata

A task representing the result of polling the operation.

PollOnceRemoveLocalInventories(string, CallSettings)

public virtual Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> PollOnceRemoveLocalInventories(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of RemoveLocalInventories.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationRemoveLocalInventoriesResponseRemoveLocalInventoriesMetadata

The result of polling the operation.

PollOnceRemoveLocalInventoriesAsync(string, CallSettings)

public virtual Task<Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata>> PollOnceRemoveLocalInventoriesAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of RemoveLocalInventories.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationRemoveLocalInventoriesResponseRemoveLocalInventoriesMetadata

A task representing the result of polling the operation.

PollOnceSetInventory(string, CallSettings)

public virtual Operation<SetInventoryResponse, SetInventoryMetadata> PollOnceSetInventory(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of SetInventory.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationSetInventoryResponseSetInventoryMetadata

The result of polling the operation.

PollOnceSetInventoryAsync(string, CallSettings)

public virtual Task<Operation<SetInventoryResponse, SetInventoryMetadata>> PollOnceSetInventoryAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of SetInventory.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationSetInventoryResponseSetInventoryMetadata

A task representing the result of polling the operation.

PurgeProducts(PurgeProductsRequest, CallSettings)

public virtual Operation<PurgeProductsResponse, PurgeProductsMetadata> PurgeProducts(PurgeProductsRequest request, CallSettings callSettings = null)

Permanently deletes all selected [Product][google.cloud.retail.v2.Product]s under a branch.

This process is asynchronous. If the request is valid, the removal will be enqueued and processed offline. Depending on the number of [Product][google.cloud.retail.v2.Product]s, this operation could take hours to complete. Before the operation completes, some [Product][google.cloud.retail.v2.Product]s may still be returned by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Depending on the number of [Product][google.cloud.retail.v2.Product]s, this operation could take hours to complete. To get a sample of [Product][google.cloud.retail.v2.Product]s that would be deleted, set [PurgeProductsRequest.force][google.cloud.retail.v2.PurgeProductsRequest.force] to false.

Parameters
Name Description
request PurgeProductsRequest

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
OperationPurgeProductsResponsePurgeProductsMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
PurgeProductsRequest request = new PurgeProductsRequest
{
    ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
    Filter = "",
    Force = false,
};
// Make the request
Operation<PurgeProductsResponse, PurgeProductsMetadata> response = productServiceClient.PurgeProducts(request);

// Poll until the returned long-running operation is complete
Operation<PurgeProductsResponse, PurgeProductsMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
PurgeProductsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<PurgeProductsResponse, PurgeProductsMetadata> retrievedResponse = productServiceClient.PollOncePurgeProducts(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    PurgeProductsResponse retrievedResult = retrievedResponse.Result;
}

PurgeProductsAsync(PurgeProductsRequest, CallSettings)

public virtual Task<Operation<PurgeProductsResponse, PurgeProductsMetadata>> PurgeProductsAsync(PurgeProductsRequest request, CallSettings callSettings = null)

Permanently deletes all selected [Product][google.cloud.retail.v2.Product]s under a branch.

This process is asynchronous. If the request is valid, the removal will be enqueued and processed offline. Depending on the number of [Product][google.cloud.retail.v2.Product]s, this operation could take hours to complete. Before the operation completes, some [Product][google.cloud.retail.v2.Product]s may still be returned by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Depending on the number of [Product][google.cloud.retail.v2.Product]s, this operation could take hours to complete. To get a sample of [Product][google.cloud.retail.v2.Product]s that would be deleted, set [PurgeProductsRequest.force][google.cloud.retail.v2.PurgeProductsRequest.force] to false.

Parameters
Name Description
request PurgeProductsRequest

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
TaskOperationPurgeProductsResponsePurgeProductsMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
PurgeProductsRequest request = new PurgeProductsRequest
{
    ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
    Filter = "",
    Force = false,
};
// Make the request
Operation<PurgeProductsResponse, PurgeProductsMetadata> response = await productServiceClient.PurgeProductsAsync(request);

// Poll until the returned long-running operation is complete
Operation<PurgeProductsResponse, PurgeProductsMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PurgeProductsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<PurgeProductsResponse, PurgeProductsMetadata> retrievedResponse = await productServiceClient.PollOncePurgeProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    PurgeProductsResponse retrievedResult = retrievedResponse.Result;
}

PurgeProductsAsync(PurgeProductsRequest, CancellationToken)

public virtual Task<Operation<PurgeProductsResponse, PurgeProductsMetadata>> PurgeProductsAsync(PurgeProductsRequest request, CancellationToken cancellationToken)

Permanently deletes all selected [Product][google.cloud.retail.v2.Product]s under a branch.

This process is asynchronous. If the request is valid, the removal will be enqueued and processed offline. Depending on the number of [Product][google.cloud.retail.v2.Product]s, this operation could take hours to complete. Before the operation completes, some [Product][google.cloud.retail.v2.Product]s may still be returned by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Depending on the number of [Product][google.cloud.retail.v2.Product]s, this operation could take hours to complete. To get a sample of [Product][google.cloud.retail.v2.Product]s that would be deleted, set [PurgeProductsRequest.force][google.cloud.retail.v2.PurgeProductsRequest.force] to false.

Parameters
Name Description
request PurgeProductsRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationPurgeProductsResponsePurgeProductsMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
PurgeProductsRequest request = new PurgeProductsRequest
{
    ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
    Filter = "",
    Force = false,
};
// Make the request
Operation<PurgeProductsResponse, PurgeProductsMetadata> response = await productServiceClient.PurgeProductsAsync(request);

// Poll until the returned long-running operation is complete
Operation<PurgeProductsResponse, PurgeProductsMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
PurgeProductsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<PurgeProductsResponse, PurgeProductsMetadata> retrievedResponse = await productServiceClient.PollOncePurgeProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    PurgeProductsResponse retrievedResult = retrievedResponse.Result;
}

RemoveFulfillmentPlaces(ProductName, CallSettings)

public virtual Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> RemoveFulfillmentPlaces(ProductName product, CallSettings callSettings = null)

We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationRemoveFulfillmentPlacesResponseRemoveFulfillmentPlacesMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
ProductName product = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> response = productServiceClient.RemoveFulfillmentPlaces(product);

// Poll until the returned long-running operation is complete
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
RemoveFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> retrievedResponse = productServiceClient.PollOnceRemoveFulfillmentPlaces(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest, CallSettings)

public virtual Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest request, CallSettings callSettings = null)

We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request RemoveFulfillmentPlacesRequest

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
OperationRemoveFulfillmentPlacesResponseRemoveFulfillmentPlacesMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
RemoveFulfillmentPlacesRequest request = new RemoveFulfillmentPlacesRequest
{
    ProductAsProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
    Type = "",
    PlaceIds = { "", },
    RemoveTime = new Timestamp(),
    AllowMissing = false,
};
// Make the request
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> response = productServiceClient.RemoveFulfillmentPlaces(request);

// Poll until the returned long-running operation is complete
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
RemoveFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> retrievedResponse = productServiceClient.PollOnceRemoveFulfillmentPlaces(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

RemoveFulfillmentPlaces(string, CallSettings)

public virtual Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> RemoveFulfillmentPlaces(string product, CallSettings callSettings = null)

We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationRemoveFulfillmentPlacesResponseRemoveFulfillmentPlacesMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
string product = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> response = productServiceClient.RemoveFulfillmentPlaces(product);

// Poll until the returned long-running operation is complete
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
RemoveFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> retrievedResponse = productServiceClient.PollOnceRemoveFulfillmentPlaces(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

RemoveFulfillmentPlacesAsync(ProductName, CallSettings)

public virtual Task<Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata>> RemoveFulfillmentPlacesAsync(ProductName product, CallSettings callSettings = null)

We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationRemoveFulfillmentPlacesResponseRemoveFulfillmentPlacesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName product = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> response = await productServiceClient.RemoveFulfillmentPlacesAsync(product);

// Poll until the returned long-running operation is complete
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemoveFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> retrievedResponse = await productServiceClient.PollOnceRemoveFulfillmentPlacesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

RemoveFulfillmentPlacesAsync(ProductName, CancellationToken)

public virtual Task<Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata>> RemoveFulfillmentPlacesAsync(ProductName product, CancellationToken cancellationToken)

We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationRemoveFulfillmentPlacesResponseRemoveFulfillmentPlacesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName product = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> response = await productServiceClient.RemoveFulfillmentPlacesAsync(product);

// Poll until the returned long-running operation is complete
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemoveFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> retrievedResponse = await productServiceClient.PollOnceRemoveFulfillmentPlacesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

RemoveFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest, CallSettings)

public virtual Task<Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata>> RemoveFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest request, CallSettings callSettings = null)

We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request RemoveFulfillmentPlacesRequest

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
TaskOperationRemoveFulfillmentPlacesResponseRemoveFulfillmentPlacesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
RemoveFulfillmentPlacesRequest request = new RemoveFulfillmentPlacesRequest
{
    ProductAsProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
    Type = "",
    PlaceIds = { "", },
    RemoveTime = new Timestamp(),
    AllowMissing = false,
};
// Make the request
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> response = await productServiceClient.RemoveFulfillmentPlacesAsync(request);

// Poll until the returned long-running operation is complete
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemoveFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> retrievedResponse = await productServiceClient.PollOnceRemoveFulfillmentPlacesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

RemoveFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest, CancellationToken)

public virtual Task<Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata>> RemoveFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest request, CancellationToken cancellationToken)

We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request RemoveFulfillmentPlacesRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationRemoveFulfillmentPlacesResponseRemoveFulfillmentPlacesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
RemoveFulfillmentPlacesRequest request = new RemoveFulfillmentPlacesRequest
{
    ProductAsProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
    Type = "",
    PlaceIds = { "", },
    RemoveTime = new Timestamp(),
    AllowMissing = false,
};
// Make the request
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> response = await productServiceClient.RemoveFulfillmentPlacesAsync(request);

// Poll until the returned long-running operation is complete
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemoveFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> retrievedResponse = await productServiceClient.PollOnceRemoveFulfillmentPlacesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

RemoveFulfillmentPlacesAsync(string, CallSettings)

public virtual Task<Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata>> RemoveFulfillmentPlacesAsync(string product, CallSettings callSettings = null)

We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationRemoveFulfillmentPlacesResponseRemoveFulfillmentPlacesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string product = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> response = await productServiceClient.RemoveFulfillmentPlacesAsync(product);

// Poll until the returned long-running operation is complete
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemoveFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> retrievedResponse = await productServiceClient.PollOnceRemoveFulfillmentPlacesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

RemoveFulfillmentPlacesAsync(string, CancellationToken)

public virtual Task<Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata>> RemoveFulfillmentPlacesAsync(string product, CancellationToken cancellationToken)

We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.

Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationRemoveFulfillmentPlacesResponseRemoveFulfillmentPlacesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string product = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> response = await productServiceClient.RemoveFulfillmentPlacesAsync(product);

// Poll until the returned long-running operation is complete
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemoveFulfillmentPlacesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> retrievedResponse = await productServiceClient.PollOnceRemoveFulfillmentPlacesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveFulfillmentPlacesResponse retrievedResult = retrievedResponse.Result;
}

RemoveLocalInventories(ProductName, CallSettings)

public virtual Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> RemoveLocalInventories(ProductName product, CallSettings callSettings = null)

Remove local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places at a removal timestamp.

This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationRemoveLocalInventoriesResponseRemoveLocalInventoriesMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
ProductName product = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> response = productServiceClient.RemoveLocalInventories(product);

// Poll until the returned long-running operation is complete
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
RemoveLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> retrievedResponse = productServiceClient.PollOnceRemoveLocalInventories(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

RemoveLocalInventories(RemoveLocalInventoriesRequest, CallSettings)

public virtual Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> RemoveLocalInventories(RemoveLocalInventoriesRequest request, CallSettings callSettings = null)

Remove local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places at a removal timestamp.

This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request RemoveLocalInventoriesRequest

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
OperationRemoveLocalInventoriesResponseRemoveLocalInventoriesMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
RemoveLocalInventoriesRequest request = new RemoveLocalInventoriesRequest
{
    ProductAsProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
    PlaceIds = { "", },
    AllowMissing = false,
    RemoveTime = new Timestamp(),
};
// Make the request
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> response = productServiceClient.RemoveLocalInventories(request);

// Poll until the returned long-running operation is complete
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
RemoveLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> retrievedResponse = productServiceClient.PollOnceRemoveLocalInventories(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

RemoveLocalInventories(string, CallSettings)

public virtual Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> RemoveLocalInventories(string product, CallSettings callSettings = null)

Remove local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places at a removal timestamp.

This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationRemoveLocalInventoriesResponseRemoveLocalInventoriesMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
string product = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> response = productServiceClient.RemoveLocalInventories(product);

// Poll until the returned long-running operation is complete
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
RemoveLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> retrievedResponse = productServiceClient.PollOnceRemoveLocalInventories(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

RemoveLocalInventoriesAsync(ProductName, CallSettings)

public virtual Task<Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata>> RemoveLocalInventoriesAsync(ProductName product, CallSettings callSettings = null)

Remove local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places at a removal timestamp.

This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationRemoveLocalInventoriesResponseRemoveLocalInventoriesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName product = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> response = await productServiceClient.RemoveLocalInventoriesAsync(product);

// Poll until the returned long-running operation is complete
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemoveLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> retrievedResponse = await productServiceClient.PollOnceRemoveLocalInventoriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

RemoveLocalInventoriesAsync(ProductName, CancellationToken)

public virtual Task<Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata>> RemoveLocalInventoriesAsync(ProductName product, CancellationToken cancellationToken)

Remove local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places at a removal timestamp.

This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product ProductName

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationRemoveLocalInventoriesResponseRemoveLocalInventoriesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName product = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> response = await productServiceClient.RemoveLocalInventoriesAsync(product);

// Poll until the returned long-running operation is complete
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemoveLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> retrievedResponse = await productServiceClient.PollOnceRemoveLocalInventoriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

RemoveLocalInventoriesAsync(RemoveLocalInventoriesRequest, CallSettings)

public virtual Task<Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata>> RemoveLocalInventoriesAsync(RemoveLocalInventoriesRequest request, CallSettings callSettings = null)

Remove local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places at a removal timestamp.

This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request RemoveLocalInventoriesRequest

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
TaskOperationRemoveLocalInventoriesResponseRemoveLocalInventoriesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
RemoveLocalInventoriesRequest request = new RemoveLocalInventoriesRequest
{
    ProductAsProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
    PlaceIds = { "", },
    AllowMissing = false,
    RemoveTime = new Timestamp(),
};
// Make the request
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> response = await productServiceClient.RemoveLocalInventoriesAsync(request);

// Poll until the returned long-running operation is complete
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemoveLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> retrievedResponse = await productServiceClient.PollOnceRemoveLocalInventoriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

RemoveLocalInventoriesAsync(RemoveLocalInventoriesRequest, CancellationToken)

public virtual Task<Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata>> RemoveLocalInventoriesAsync(RemoveLocalInventoriesRequest request, CancellationToken cancellationToken)

Remove local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places at a removal timestamp.

This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request RemoveLocalInventoriesRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationRemoveLocalInventoriesResponseRemoveLocalInventoriesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
RemoveLocalInventoriesRequest request = new RemoveLocalInventoriesRequest
{
    ProductAsProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
    PlaceIds = { "", },
    AllowMissing = false,
    RemoveTime = new Timestamp(),
};
// Make the request
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> response = await productServiceClient.RemoveLocalInventoriesAsync(request);

// Poll until the returned long-running operation is complete
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemoveLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> retrievedResponse = await productServiceClient.PollOnceRemoveLocalInventoriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

RemoveLocalInventoriesAsync(string, CallSettings)

public virtual Task<Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata>> RemoveLocalInventoriesAsync(string product, CallSettings callSettings = null)

Remove local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places at a removal timestamp.

This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationRemoveLocalInventoriesResponseRemoveLocalInventoriesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string product = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> response = await productServiceClient.RemoveLocalInventoriesAsync(product);

// Poll until the returned long-running operation is complete
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemoveLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> retrievedResponse = await productServiceClient.PollOnceRemoveLocalInventoriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

RemoveLocalInventoriesAsync(string, CancellationToken)

public virtual Task<Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata>> RemoveLocalInventoriesAsync(string product, CancellationToken cancellationToken)

Remove local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places at a removal timestamp.

This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
product string

Required. Full resource name of [Product][google.cloud.retail.v2.Product], such as projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id.

If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationRemoveLocalInventoriesResponseRemoveLocalInventoriesMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string product = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> response = await productServiceClient.RemoveLocalInventoriesAsync(product);

// Poll until the returned long-running operation is complete
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
RemoveLocalInventoriesResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> retrievedResponse = await productServiceClient.PollOnceRemoveLocalInventoriesAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    RemoveLocalInventoriesResponse retrievedResult = retrievedResponse.Result;
}

SetInventory(Product, FieldMask, CallSettings)

public virtual Operation<SetInventoryResponse, SetInventoryMetadata> SetInventory(Product inventory, FieldMask setMask, CallSettings callSettings = null)

Updates inventory information for a [Product][google.cloud.retail.v2.Product] while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] request.

If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product], then any pre-existing inventory information for this product is used.

If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask], then any existing inventory information is preserved.

Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces].

The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the [GetOperation][google.longrunning.Operations.GetOperation] API returns NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates are not marked as [done][google.longrunning.Operation.done] until they are obsolete.

Parameters
Name Description
inventory Product

Required. The inventory information to update. The allowable fields to update are:

  • [Product.price_info][google.cloud.retail.v2.Product.price_info]
  • [Product.availability][google.cloud.retail.v2.Product.availability]
  • [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
  • [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] The updated inventory fields must be specified in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].

If [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name] is empty or invalid, an INVALID_ARGUMENT error is returned.

If the caller does not have permission to update the [Product][google.cloud.retail.v2.Product] named in [Product.name][google.cloud.retail.v2.Product.name], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Product][google.cloud.retail.v2.Product] to update does not have existing inventory information, the provided inventory information will be inserted.

If the [Product][google.cloud.retail.v2.Product] to update has existing inventory information, the provided inventory information will be merged while respecting the last update time for each inventory field, using the provided or default value for [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time].

The caller can replace place IDs for a subset of fulfillment types in the following ways:

  • Adds "fulfillment_info" in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]
  • Specifies only the desired fulfillment types and corresponding place IDs to update in [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]

The caller can clear all place IDs from a subset of fulfillment types in the following ways:

  • Adds "fulfillment_info" in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]
  • Specifies only the desired fulfillment types to clear in [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
  • Checks that only the desired fulfillment info types have empty [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]

The last update time is recorded for the following inventory fields:

  • [Product.price_info][google.cloud.retail.v2.Product.price_info]
  • [Product.availability][google.cloud.retail.v2.Product.availability]
  • [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
  • [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]

If a full overwrite of inventory information while ignoring timestamps is needed, [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] should be invoked instead.

setMask FieldMask

Indicates which inventory fields in the provided [Product][google.cloud.retail.v2.Product] to update.

At least one field must be provided.

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned and the entire update will be ignored.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationSetInventoryResponseSetInventoryMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
Product inventory = new Product();
FieldMask setMask = new FieldMask();
// Make the request
Operation<SetInventoryResponse, SetInventoryMetadata> response = productServiceClient.SetInventory(inventory, setMask);

// Poll until the returned long-running operation is complete
Operation<SetInventoryResponse, SetInventoryMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
SetInventoryResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<SetInventoryResponse, SetInventoryMetadata> retrievedResponse = productServiceClient.PollOnceSetInventory(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    SetInventoryResponse retrievedResult = retrievedResponse.Result;
}

SetInventory(SetInventoryRequest, CallSettings)

public virtual Operation<SetInventoryResponse, SetInventoryMetadata> SetInventory(SetInventoryRequest request, CallSettings callSettings = null)

Updates inventory information for a [Product][google.cloud.retail.v2.Product] while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] request.

If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product], then any pre-existing inventory information for this product is used.

If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask], then any existing inventory information is preserved.

Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces].

The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the [GetOperation][google.longrunning.Operations.GetOperation] API returns NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates are not marked as [done][google.longrunning.Operation.done] until they are obsolete.

Parameters
Name Description
request SetInventoryRequest

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
OperationSetInventoryResponseSetInventoryMetadata

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
SetInventoryRequest request = new SetInventoryRequest
{
    Inventory = new Product(),
    SetMask = new FieldMask(),
    SetTime = new Timestamp(),
    AllowMissing = false,
};
// Make the request
Operation<SetInventoryResponse, SetInventoryMetadata> response = productServiceClient.SetInventory(request);

// Poll until the returned long-running operation is complete
Operation<SetInventoryResponse, SetInventoryMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
SetInventoryResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<SetInventoryResponse, SetInventoryMetadata> retrievedResponse = productServiceClient.PollOnceSetInventory(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    SetInventoryResponse retrievedResult = retrievedResponse.Result;
}

SetInventoryAsync(Product, FieldMask, CallSettings)

public virtual Task<Operation<SetInventoryResponse, SetInventoryMetadata>> SetInventoryAsync(Product inventory, FieldMask setMask, CallSettings callSettings = null)

Updates inventory information for a [Product][google.cloud.retail.v2.Product] while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] request.

If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product], then any pre-existing inventory information for this product is used.

If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask], then any existing inventory information is preserved.

Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces].

The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the [GetOperation][google.longrunning.Operations.GetOperation] API returns NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates are not marked as [done][google.longrunning.Operation.done] until they are obsolete.

Parameters
Name Description
inventory Product

Required. The inventory information to update. The allowable fields to update are:

  • [Product.price_info][google.cloud.retail.v2.Product.price_info]
  • [Product.availability][google.cloud.retail.v2.Product.availability]
  • [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
  • [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] The updated inventory fields must be specified in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].

If [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name] is empty or invalid, an INVALID_ARGUMENT error is returned.

If the caller does not have permission to update the [Product][google.cloud.retail.v2.Product] named in [Product.name][google.cloud.retail.v2.Product.name], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Product][google.cloud.retail.v2.Product] to update does not have existing inventory information, the provided inventory information will be inserted.

If the [Product][google.cloud.retail.v2.Product] to update has existing inventory information, the provided inventory information will be merged while respecting the last update time for each inventory field, using the provided or default value for [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time].

The caller can replace place IDs for a subset of fulfillment types in the following ways:

  • Adds "fulfillment_info" in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]
  • Specifies only the desired fulfillment types and corresponding place IDs to update in [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]

The caller can clear all place IDs from a subset of fulfillment types in the following ways:

  • Adds "fulfillment_info" in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]
  • Specifies only the desired fulfillment types to clear in [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
  • Checks that only the desired fulfillment info types have empty [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]

The last update time is recorded for the following inventory fields:

  • [Product.price_info][google.cloud.retail.v2.Product.price_info]
  • [Product.availability][google.cloud.retail.v2.Product.availability]
  • [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
  • [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]

If a full overwrite of inventory information while ignoring timestamps is needed, [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] should be invoked instead.

setMask FieldMask

Indicates which inventory fields in the provided [Product][google.cloud.retail.v2.Product] to update.

At least one field must be provided.

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned and the entire update will be ignored.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationSetInventoryResponseSetInventoryMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
Product inventory = new Product();
FieldMask setMask = new FieldMask();
// Make the request
Operation<SetInventoryResponse, SetInventoryMetadata> response = await productServiceClient.SetInventoryAsync(inventory, setMask);

// Poll until the returned long-running operation is complete
Operation<SetInventoryResponse, SetInventoryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
SetInventoryResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<SetInventoryResponse, SetInventoryMetadata> retrievedResponse = await productServiceClient.PollOnceSetInventoryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    SetInventoryResponse retrievedResult = retrievedResponse.Result;
}

SetInventoryAsync(Product, FieldMask, CancellationToken)

public virtual Task<Operation<SetInventoryResponse, SetInventoryMetadata>> SetInventoryAsync(Product inventory, FieldMask setMask, CancellationToken cancellationToken)

Updates inventory information for a [Product][google.cloud.retail.v2.Product] while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] request.

If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product], then any pre-existing inventory information for this product is used.

If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask], then any existing inventory information is preserved.

Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces].

The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the [GetOperation][google.longrunning.Operations.GetOperation] API returns NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates are not marked as [done][google.longrunning.Operation.done] until they are obsolete.

Parameters
Name Description
inventory Product

Required. The inventory information to update. The allowable fields to update are:

  • [Product.price_info][google.cloud.retail.v2.Product.price_info]
  • [Product.availability][google.cloud.retail.v2.Product.availability]
  • [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
  • [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info] The updated inventory fields must be specified in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask].

If [SetInventoryRequest.inventory.name][google.cloud.retail.v2.Product.name] is empty or invalid, an INVALID_ARGUMENT error is returned.

If the caller does not have permission to update the [Product][google.cloud.retail.v2.Product] named in [Product.name][google.cloud.retail.v2.Product.name], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Product][google.cloud.retail.v2.Product] to update does not have existing inventory information, the provided inventory information will be inserted.

If the [Product][google.cloud.retail.v2.Product] to update has existing inventory information, the provided inventory information will be merged while respecting the last update time for each inventory field, using the provided or default value for [SetInventoryRequest.set_time][google.cloud.retail.v2.SetInventoryRequest.set_time].

The caller can replace place IDs for a subset of fulfillment types in the following ways:

  • Adds "fulfillment_info" in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]
  • Specifies only the desired fulfillment types and corresponding place IDs to update in [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]

The caller can clear all place IDs from a subset of fulfillment types in the following ways:

  • Adds "fulfillment_info" in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask]
  • Specifies only the desired fulfillment types to clear in [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]
  • Checks that only the desired fulfillment info types have empty [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]

The last update time is recorded for the following inventory fields:

  • [Product.price_info][google.cloud.retail.v2.Product.price_info]
  • [Product.availability][google.cloud.retail.v2.Product.availability]
  • [Product.available_quantity][google.cloud.retail.v2.Product.available_quantity]
  • [Product.fulfillment_info][google.cloud.retail.v2.Product.fulfillment_info]

If a full overwrite of inventory information while ignoring timestamps is needed, [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] should be invoked instead.

setMask FieldMask

Indicates which inventory fields in the provided [Product][google.cloud.retail.v2.Product] to update.

At least one field must be provided.

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned and the entire update will be ignored.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationSetInventoryResponseSetInventoryMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
Product inventory = new Product();
FieldMask setMask = new FieldMask();
// Make the request
Operation<SetInventoryResponse, SetInventoryMetadata> response = await productServiceClient.SetInventoryAsync(inventory, setMask);

// Poll until the returned long-running operation is complete
Operation<SetInventoryResponse, SetInventoryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
SetInventoryResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<SetInventoryResponse, SetInventoryMetadata> retrievedResponse = await productServiceClient.PollOnceSetInventoryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    SetInventoryResponse retrievedResult = retrievedResponse.Result;
}

SetInventoryAsync(SetInventoryRequest, CallSettings)

public virtual Task<Operation<SetInventoryResponse, SetInventoryMetadata>> SetInventoryAsync(SetInventoryRequest request, CallSettings callSettings = null)

Updates inventory information for a [Product][google.cloud.retail.v2.Product] while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] request.

If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product], then any pre-existing inventory information for this product is used.

If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask], then any existing inventory information is preserved.

Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces].

The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the [GetOperation][google.longrunning.Operations.GetOperation] API returns NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates are not marked as [done][google.longrunning.Operation.done] until they are obsolete.

Parameters
Name Description
request SetInventoryRequest

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
TaskOperationSetInventoryResponseSetInventoryMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
SetInventoryRequest request = new SetInventoryRequest
{
    Inventory = new Product(),
    SetMask = new FieldMask(),
    SetTime = new Timestamp(),
    AllowMissing = false,
};
// Make the request
Operation<SetInventoryResponse, SetInventoryMetadata> response = await productServiceClient.SetInventoryAsync(request);

// Poll until the returned long-running operation is complete
Operation<SetInventoryResponse, SetInventoryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
SetInventoryResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<SetInventoryResponse, SetInventoryMetadata> retrievedResponse = await productServiceClient.PollOnceSetInventoryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    SetInventoryResponse retrievedResult = retrievedResponse.Result;
}

SetInventoryAsync(SetInventoryRequest, CancellationToken)

public virtual Task<Operation<SetInventoryResponse, SetInventoryMetadata>> SetInventoryAsync(SetInventoryRequest request, CancellationToken cancellationToken)

Updates inventory information for a [Product][google.cloud.retail.v2.Product] while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] request.

If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product], then any pre-existing inventory information for this product is used.

If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask], then any existing inventory information is preserved.

Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces].

The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the [GetOperation][google.longrunning.Operations.GetOperation] API returns NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates are not marked as [done][google.longrunning.Operation.done] until they are obsolete.

Parameters
Name Description
request SetInventoryRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationSetInventoryResponseSetInventoryMetadata

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
SetInventoryRequest request = new SetInventoryRequest
{
    Inventory = new Product(),
    SetMask = new FieldMask(),
    SetTime = new Timestamp(),
    AllowMissing = false,
};
// Make the request
Operation<SetInventoryResponse, SetInventoryMetadata> response = await productServiceClient.SetInventoryAsync(request);

// Poll until the returned long-running operation is complete
Operation<SetInventoryResponse, SetInventoryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
SetInventoryResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<SetInventoryResponse, SetInventoryMetadata> retrievedResponse = await productServiceClient.PollOnceSetInventoryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    SetInventoryResponse retrievedResult = retrievedResponse.Result;
}

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
Type Description
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.

UpdateProduct(Product, FieldMask, CallSettings)

public virtual Product UpdateProduct(Product product, FieldMask updateMask, CallSettings callSettings = null)

Updates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
product Product

Required. The product to update/create.

If the caller does not have permission to update the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Product][google.cloud.retail.v2.Product] to update does not exist and [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] is not set, a NOT_FOUND error is returned.

updateMask FieldMask

Indicates which fields in the provided [Product][google.cloud.retail.v2.Product] to update. The immutable and output only fields are NOT supported. If not set, all supported fields (the fields that are neither immutable nor output only) are updated.

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.

The attribute key can be updated by setting the mask path as "attributes.${key_name}". If a key name is present in the mask but not in the patching product from the request, this key will be deleted after the update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Product

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
Product product = new Product();
FieldMask updateMask = new FieldMask();
// Make the request
Product response = productServiceClient.UpdateProduct(product, updateMask);

UpdateProduct(UpdateProductRequest, CallSettings)

public virtual Product UpdateProduct(UpdateProductRequest request, CallSettings callSettings = null)

Updates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request UpdateProductRequest

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
Product

The RPC response.

Example
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
UpdateProductRequest request = new UpdateProductRequest
{
    Product = new Product(),
    UpdateMask = new FieldMask(),
    AllowMissing = false,
};
// Make the request
Product response = productServiceClient.UpdateProduct(request);

UpdateProductAsync(Product, FieldMask, CallSettings)

public virtual Task<Product> UpdateProductAsync(Product product, FieldMask updateMask, CallSettings callSettings = null)

Updates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
product Product

Required. The product to update/create.

If the caller does not have permission to update the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Product][google.cloud.retail.v2.Product] to update does not exist and [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] is not set, a NOT_FOUND error is returned.

updateMask FieldMask

Indicates which fields in the provided [Product][google.cloud.retail.v2.Product] to update. The immutable and output only fields are NOT supported. If not set, all supported fields (the fields that are neither immutable nor output only) are updated.

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.

The attribute key can be updated by setting the mask path as "attributes.${key_name}". If a key name is present in the mask but not in the patching product from the request, this key will be deleted after the update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
Product product = new Product();
FieldMask updateMask = new FieldMask();
// Make the request
Product response = await productServiceClient.UpdateProductAsync(product, updateMask);

UpdateProductAsync(Product, FieldMask, CancellationToken)

public virtual Task<Product> UpdateProductAsync(Product product, FieldMask updateMask, CancellationToken cancellationToken)

Updates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
product Product

Required. The product to update/create.

If the caller does not have permission to update the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Product][google.cloud.retail.v2.Product] to update does not exist and [allow_missing][google.cloud.retail.v2.UpdateProductRequest.allow_missing] is not set, a NOT_FOUND error is returned.

updateMask FieldMask

Indicates which fields in the provided [Product][google.cloud.retail.v2.Product] to update. The immutable and output only fields are NOT supported. If not set, all supported fields (the fields that are neither immutable nor output only) are updated.

If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned.

The attribute key can be updated by setting the mask path as "attributes.${key_name}". If a key name is present in the mask but not in the patching product from the request, this key will be deleted after the update.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
Product product = new Product();
FieldMask updateMask = new FieldMask();
// Make the request
Product response = await productServiceClient.UpdateProductAsync(product, updateMask);

UpdateProductAsync(UpdateProductRequest, CallSettings)

public virtual Task<Product> UpdateProductAsync(UpdateProductRequest request, CallSettings callSettings = null)

Updates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request UpdateProductRequest

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
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateProductRequest request = new UpdateProductRequest
{
    Product = new Product(),
    UpdateMask = new FieldMask(),
    AllowMissing = false,
};
// Make the request
Product response = await productServiceClient.UpdateProductAsync(request);

UpdateProductAsync(UpdateProductRequest, CancellationToken)

public virtual Task<Product> UpdateProductAsync(UpdateProductRequest request, CancellationToken cancellationToken)

Updates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request UpdateProductRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskProduct

A Task containing the RPC response.

Example
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateProductRequest request = new UpdateProductRequest
{
    Product = new Product(),
    UpdateMask = new FieldMask(),
    AllowMissing = false,
};
// Make the request
Product response = await productServiceClient.UpdateProductAsync(request);