Class ProductServiceClient (2.12.0)

Service for ingesting Product information of the customer's website.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

ProductServiceClient(ProductServiceClient const &)

Copy and move support

Parameter
Name Description
ProductServiceClient const &

ProductServiceClient(ProductServiceClient &&)

Copy and move support

Parameter
Name Description
ProductServiceClient &&

ProductServiceClient(std::shared_ptr< ProductServiceConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< ProductServiceConnection >
opts Options

Operators

operator=(ProductServiceClient const &)

Copy and move support

Parameter
Name Description
ProductServiceClient const &
Returns
Type Description
ProductServiceClient &

operator=(ProductServiceClient &&)

Copy and move support

Parameter
Name Description
ProductServiceClient &&
Returns
Type Description
ProductServiceClient &

Functions

CreateProduct(std::string const &, google::cloud::retail::v2::Product const &, std::string const &, Options)

Creates a Product.

Parameters
Name Description
parent std::string const &

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

product google::cloud::retail::v2::Product const &

Required. The Product to create.

product_id std::string const &

Required. The ID to use for the 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, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
This field must be unique among all Products 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::retail::v2::Product >

the result of the RPC. The response message type (google.cloud.retail.v2.Product) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateProduct(google::cloud::retail::v2::CreateProductRequest const &, Options)

Creates a Product.

Parameters
Name Description
request google::cloud::retail::v2::CreateProductRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.retail.v2.CreateProductRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::retail::v2::Product >

the result of the RPC. The response message type (google.cloud.retail.v2.Product) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetProduct(std::string const &, Options)

Gets a Product.

Parameters
Name Description
name std::string const &

Required. Full resource name of 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, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the requested Product does not exist, a NOT_FOUND error is returned.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::retail::v2::Product >

the result of the RPC. The response message type (google.cloud.retail.v2.Product) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetProduct(google::cloud::retail::v2::GetProductRequest const &, Options)

Gets a Product.

Parameters
Name Description
request google::cloud::retail::v2::GetProductRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.retail.v2.GetProductRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::retail::v2::Product >

the result of the RPC. The response message type (google.cloud.retail.v2.Product) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListProducts(std::string const &, Options)

Gets a list of Products.

Parameters
Name Description
parent std::string const &

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 Products under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::retail::v2::Product >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.retail.v2.Product, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListProducts(google::cloud::retail::v2::ListProductsRequest, Options)

Gets a list of Products.

Parameters
Name Description
request google::cloud::retail::v2::ListProductsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.retail.v2.ListProductsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::retail::v2::Product >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.retail.v2.Product, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

UpdateProduct(google::cloud::retail::v2::Product const &, google::protobuf::FieldMask const &, Options)

Updates a Product.

Parameters
Name Description
product google::cloud::retail::v2::Product const &

Required. The product to update/create.
If the caller does not have permission to update the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the 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.

update_mask google::protobuf::FieldMask const &

Indicates which fields in the provided 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::retail::v2::Product >

the result of the RPC. The response message type (google.cloud.retail.v2.Product) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateProduct(google::cloud::retail::v2::UpdateProductRequest const &, Options)

Updates a Product.

Parameters
Name Description
request google::cloud::retail::v2::UpdateProductRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.retail.v2.UpdateProductRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::retail::v2::Product >

the result of the RPC. The response message type (google.cloud.retail.v2.Product) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

DeleteProduct(std::string const &, Options)

Deletes a Product.

Parameters
Name Description
name std::string const &

Required. Full resource name of 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, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the Product to delete does not exist, a NOT_FOUND error is returned.
The Product to delete can neither be a [Product.Type.COLLECTION][google.cloud.retail.v2.Product.Type.COLLECTION] Product member nor a [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] 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 will be deleted.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteProduct(google::cloud::retail::v2::DeleteProductRequest const &, Options)

Deletes a Product.

Parameters
Name Description
request google::cloud::retail::v2::DeleteProductRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.retail.v2.DeleteProductRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

ImportProducts(google::cloud::retail::v2::ImportProductsRequest const &, Options)

Bulk import of multiple Products.

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

Note that it is possible for a subset of the Products to be successfully updated.

Parameters
Name Description
request google::cloud::retail::v2::ImportProductsRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.retail.v2.ImportProductsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::retail::v2::ImportProductsResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.retail.v2.ImportProductsResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

SetInventory(google::cloud::retail::v2::Product const &, google::protobuf::FieldMask const &, Options)

Updates inventory information for a Product while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the 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 queried by ProductService.GetProduct or ProductService.ListProducts.

When inventory is updated with ProductService.CreateProduct and 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 or ProductService.UpdateProduct request.

If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product is used.

If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information is preserved.

Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces.

The returned Operations is obsolete after one day, and the GetOperation API returns NOT_FOUND afterwards.

If conflicting updates are issued, the Operations associated with the stale updates are not marked as done until they are obsolete.

Parameters
Name Description
inventory google::cloud::retail::v2::Product const &

Required. The inventory information to update.
For more information, see SetInventoryRequest.

set_mask google::protobuf::FieldMask const &

Indicates which inventory fields in the provided 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::retail::v2::SetInventoryResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.retail.v2.SetInventoryResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

SetInventory(google::cloud::retail::v2::SetInventoryRequest const &, Options)

Updates inventory information for a Product while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the 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 queried by ProductService.GetProduct or ProductService.ListProducts.

When inventory is updated with ProductService.CreateProduct and 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 or ProductService.UpdateProduct request.

If no inventory fields are set in CreateProductRequest.product, then any pre-existing inventory information for this product is used.

If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information is preserved.

Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces.

The returned Operations is obsolete after one day, and the GetOperation API returns NOT_FOUND afterwards.

If conflicting updates are issued, the Operations associated with the stale updates are not marked as done until they are obsolete.

Parameters
Name Description
request google::cloud::retail::v2::SetInventoryRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.retail.v2.SetInventoryRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::retail::v2::SetInventoryResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.retail.v2.SetInventoryResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

AddFulfillmentPlaces(std::string const &, Options)

It is recommended to use the ProductService.AddLocalInventories method instead of ProductService.AddFulfillmentPlaces.

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.

This process is asynchronous and does not require the 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 queried by ProductService.GetProduct or ProductService.ListProducts.

The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards.

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

Parameters
Name Description
product std::string const &

Required. Full resource name of 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, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::retail::v2::AddFulfillmentPlacesResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.retail.v2.AddFulfillmentPlacesResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

AddFulfillmentPlaces(google::cloud::retail::v2::AddFulfillmentPlacesRequest const &, Options)

It is recommended to use the ProductService.AddLocalInventories method instead of ProductService.AddFulfillmentPlaces.

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.

This process is asynchronous and does not require the 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 queried by ProductService.GetProduct or ProductService.ListProducts.

The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards.

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

Parameters
Name Description
request google::cloud::retail::v2::AddFulfillmentPlacesRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.retail.v2.AddFulfillmentPlacesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::retail::v2::AddFulfillmentPlacesResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.retail.v2.AddFulfillmentPlacesResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

RemoveFulfillmentPlaces(std::string const &, Options)

It is recommended to use the ProductService.RemoveLocalInventories method instead of ProductService.RemoveFulfillmentPlaces.

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.

This process is asynchronous and does not require the 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 queried by ProductService.GetProduct or ProductService.ListProducts.

The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards.

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

Parameters
Name Description
product std::string const &

Required. Full resource name of 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, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::retail::v2::RemoveFulfillmentPlacesResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.retail.v2.RemoveFulfillmentPlacesResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

RemoveFulfillmentPlaces(google::cloud::retail::v2::RemoveFulfillmentPlacesRequest const &, Options)

It is recommended to use the ProductService.RemoveLocalInventories method instead of ProductService.RemoveFulfillmentPlaces.

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.

This process is asynchronous and does not require the 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 queried by ProductService.GetProduct or ProductService.ListProducts.

The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards.

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

Parameters
Name Description
request google::cloud::retail::v2::RemoveFulfillmentPlacesRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.retail.v2.RemoveFulfillmentPlacesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::retail::v2::RemoveFulfillmentPlacesResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.retail.v2.RemoveFulfillmentPlacesResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

AddLocalInventories(std::string const &, Options)

Updates local inventory information for a 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 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 queried by ProductService.GetProduct or ProductService.ListProducts.

Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories.

The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards.

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

Parameters
Name Description
product std::string const &

Required. Full resource name of 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, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::retail::v2::AddLocalInventoriesResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.retail.v2.AddLocalInventoriesResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

AddLocalInventories(google::cloud::retail::v2::AddLocalInventoriesRequest const &, Options)

Updates local inventory information for a 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 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 queried by ProductService.GetProduct or ProductService.ListProducts.

Local inventory information can only be modified using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories.

The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards.

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

Parameters
Name Description
request google::cloud::retail::v2::AddLocalInventoriesRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.retail.v2.AddLocalInventoriesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::retail::v2::AddLocalInventoriesResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.retail.v2.AddLocalInventoriesResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

RemoveLocalInventories(std::string const &, Options)

Remove local inventory information for a 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 queried by ProductService.GetProduct or ProductService.ListProducts.

Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories.

The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards.

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

Parameters
Name Description
product std::string const &

Required. Full resource name of 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, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::retail::v2::RemoveLocalInventoriesResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.retail.v2.RemoveLocalInventoriesResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

RemoveLocalInventories(google::cloud::retail::v2::RemoveLocalInventoriesRequest const &, Options)

Remove local inventory information for a 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 queried by ProductService.GetProduct or ProductService.ListProducts.

Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories.

The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards.

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

Parameters
Name Description
request google::cloud::retail::v2::RemoveLocalInventoriesRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.retail.v2.RemoveLocalInventoriesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::retail::v2::RemoveLocalInventoriesResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.retail.v2.RemoveLocalInventoriesResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.