Class ProductServiceClient (2.2.0)

Stay organized with collections Save and categorize content based on your preferences.
public abstract 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
TypeDescription
OperationsClient

AddLocalInventoriesOperationsClient

public virtual OperationsClient AddLocalInventoriesOperationsClient { get; }

The long-running operations client for AddLocalInventories.

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

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default ProductService scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default ProductService scopes are:

GrpcClient

public virtual ProductService.ProductServiceClient GrpcClient { get; }

The underlying gRPC ProductService client

Property Value
TypeDescription
ProductService.ProductServiceClient

ImportProductsOperationsClient

public virtual OperationsClient ImportProductsOperationsClient { get; }

The long-running operations client for ImportProducts.

Property Value
TypeDescription
OperationsClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
TypeDescription
LocationsClient

RemoveFulfillmentPlacesOperationsClient

public virtual OperationsClient RemoveFulfillmentPlacesOperationsClient { get; }

The long-running operations client for RemoveFulfillmentPlaces.

Property Value
TypeDescription
OperationsClient

RemoveLocalInventoriesOperationsClient

public virtual OperationsClient RemoveLocalInventoriesOperationsClient { get; }

The long-running operations client for RemoveLocalInventories.

Property Value
TypeDescription
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

SetInventoryOperationsClient

public virtual OperationsClient SetInventoryOperationsClient { get; }

The long-running operations client for SetInventory.

Property Value
TypeDescription
OperationsClient

Methods

AddFulfillmentPlaces(AddFulfillmentPlacesRequest, CallSettings)

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

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
requestAddFulfillmentPlacesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>

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)

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
productProductName

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>

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)

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
productString

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>

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)

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
requestAddFulfillmentPlacesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>>

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)

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
requestAddFulfillmentPlacesRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>>

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)

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
productProductName

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>>

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)

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
productProductName

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>>

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)

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
productString

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>>

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)

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
productString

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata>>

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
requestAddLocalInventoriesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
productProductName

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
productString

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
requestAddLocalInventoriesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>>

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
requestAddLocalInventoriesRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>>

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
productProductName

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>>

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
productProductName

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>>

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
productString

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>>

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][]s will be obsolete after 1 day, and [GetOperation][] API will return NOT_FOUND afterwards.

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

This feature is only available for users who have Retail Search enabled. Please enable Retail Search on Cloud Console before using this feature.

Parameters
NameDescription
productString

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<AddLocalInventoriesResponse, AddLocalInventoriesMetadata>>

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

The created ProductServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<ProductServiceClient>

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

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

productProduct

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

productIdString

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateProductRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentString

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

productProduct

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

productIdString

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentBranchName

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

productProduct

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

productIdString

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Product>

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

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

productProduct

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

productIdString

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Product>

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

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Product>

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

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Product>

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

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

productProduct

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

productIdString

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Product>

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

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

productProduct

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

productIdString

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Product>

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

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
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
NameDescription
nameProductName

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