Class ProductServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (ProductServiceClient productServiceClient = ProductServiceClient.create()) {
BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
Product product = Product.newBuilder().build();
String productId = "productId-1051830678";
Product response = productServiceClient.createProduct(parent, product, productId);
}
Note: close() needs to be called on the ProductServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
CreateProduct |
Creates a [Product][google.cloud.retail.v2alpha.Product]. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetProduct |
Gets a [Product][google.cloud.retail.v2alpha.Product]. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListProducts |
Gets a list of [Product][google.cloud.retail.v2alpha.Product]s. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateProduct |
Updates a [Product][google.cloud.retail.v2alpha.Product]. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteProduct |
Deletes a [Product][google.cloud.retail.v2alpha.Product]. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
PurgeProducts |
Permanently deletes all selected [Product][google.cloud.retail.v2alpha.Product]s under a branch. This process is asynchronous. If the request is valid, the removal will be enqueued and processed offline. Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, this operation could take hours to complete. Before the operation completes, some [Product][google.cloud.retail.v2alpha.Product]s may still be returned by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, this operation could take hours to complete. To get a sample of [Product][google.cloud.retail.v2alpha.Product]s that would be deleted, set [PurgeProductsRequest.force][google.cloud.retail.v2alpha.PurgeProductsRequest.force] to false. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ImportProducts |
Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s. Request processing may be synchronous. Non-existing items are created. Note that it is possible for a subset of the [Product][google.cloud.retail.v2alpha.Product]s to be successfully updated. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ExportProducts |
Exports multiple [Product][google.cloud.retail.v2alpha.Product]s. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetInventory |
Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request. If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], then any pre-existing inventory information for this product is used. If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], then any existing inventory information is preserved. Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces]. The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the [GetOperation][google.longrunning.Operations.GetOperation] API returns `NOT_FOUND` afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates are not marked as [done][google.longrunning.Operation.done] until they are obsolete. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AddFulfillmentPlaces |
We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.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.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RemoveFulfillmentPlaces |
We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AddLocalInventories |
Updates local inventory information for a [Product][google.cloud.retail.v2alpha.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.v2alpha.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.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RemoveLocalInventories |
Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards. If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of ProductServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ProductServiceSettings productServiceSettings =
ProductServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ProductServiceClient productServiceClient = ProductServiceClient.create(productServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ProductServiceSettings productServiceSettings =
ProductServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
ProductServiceClient productServiceClient = ProductServiceClient.create(productServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ProductServiceSettings productServiceSettings =
ProductServiceSettings.newHttpJsonBuilder().build();
ProductServiceClient productServiceClient = ProductServiceClient.create(productServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProductServiceClient(ProductServiceSettings settings) Constructs an instance of ProductServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionWe recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces] method.addFulfillmentPlacesAsync(ProductName product) We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces] method.addFulfillmentPlacesAsync(String product) We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces] method.We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces] method.final OperationCallable<AddFulfillmentPlacesRequest,AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces] method.Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places, while respecting the last update timestamps of each inventory field.addLocalInventoriesAsync(ProductName product) Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places, while respecting the last update timestamps of each inventory field.addLocalInventoriesAsync(String product) Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places, while respecting the last update timestamps of each inventory field.Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places, while respecting the last update timestamps of each inventory field.final OperationCallable<AddLocalInventoriesRequest,AddLocalInventoriesResponse, AddLocalInventoriesMetadata> Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places, while respecting the last update timestamps of each inventory field.booleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final ProductServiceClientcreate()Constructs an instance of ProductServiceClient with default settings.static final ProductServiceClientcreate(ProductServiceSettings settings) Constructs an instance of ProductServiceClient, using the given settings.static final ProductServiceClientcreate(ProductServiceStub stub) Constructs an instance of ProductServiceClient, using the given stub for making calls.final ProductcreateProduct(BranchName parent, Product product, String productId) Creates a [Product][google.cloud.retail.v2alpha.Product].final ProductcreateProduct(CreateProductRequest request) Creates a [Product][google.cloud.retail.v2alpha.Product].final ProductcreateProduct(String parent, Product product, String productId) Creates a [Product][google.cloud.retail.v2alpha.Product].Creates a [Product][google.cloud.retail.v2alpha.Product].final voiddeleteProduct(DeleteProductRequest request) Deletes a [Product][google.cloud.retail.v2alpha.Product].final voiddeleteProduct(ProductName name) Deletes a [Product][google.cloud.retail.v2alpha.Product].final voiddeleteProduct(String name) Deletes a [Product][google.cloud.retail.v2alpha.Product].final UnaryCallable<DeleteProductRequest,com.google.protobuf.Empty> Deletes a [Product][google.cloud.retail.v2alpha.Product].exportProductsAsync(ExportProductsRequest request) Exports multiple [Product][google.cloud.retail.v2alpha.Product]s.Exports multiple [Product][google.cloud.retail.v2alpha.Product]s.Exports multiple [Product][google.cloud.retail.v2alpha.Product]s.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final ProductgetProduct(GetProductRequest request) Gets a [Product][google.cloud.retail.v2alpha.Product].final ProductgetProduct(ProductName name) Gets a [Product][google.cloud.retail.v2alpha.Product].final ProductgetProduct(String name) Gets a [Product][google.cloud.retail.v2alpha.Product].Gets a [Product][google.cloud.retail.v2alpha.Product].final ProductServiceSettingsgetStub()importProductsAsync(ImportProductsRequest request) Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s.Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s.Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s.booleanbooleanlistProducts(BranchName parent) Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.listProducts(ListProductsRequest request) Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.listProducts(String parent) Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.purgeProductsAsync(PurgeProductsRequest request) Permanently deletes all selected [Product][google.cloud.retail.v2alpha.Product]s under a branch.Permanently deletes all selected [Product][google.cloud.retail.v2alpha.Product]s under a branch.Permanently deletes all selected [Product][google.cloud.retail.v2alpha.Product]s under a branch.removeFulfillmentPlacesAsync(ProductName product) We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces] method.We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces] method.removeFulfillmentPlacesAsync(String product) We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces] method.We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces] method.final OperationCallable<RemoveFulfillmentPlacesRequest,RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces] method.removeLocalInventoriesAsync(ProductName product) Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp.Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp.removeLocalInventoriesAsync(String product) Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp.Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp.final OperationCallable<RemoveLocalInventoriesRequest,RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp.setInventoryAsync(Product inventory, com.google.protobuf.FieldMask setMask) Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while respecting the last update timestamps of each inventory field.setInventoryAsync(SetInventoryRequest request) Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while respecting the last update timestamps of each inventory field.Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while respecting the last update timestamps of each inventory field.Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while respecting the last update timestamps of each inventory field.voidshutdown()voidfinal ProductupdateProduct(Product product, com.google.protobuf.FieldMask updateMask) Updates a [Product][google.cloud.retail.v2alpha.Product].final ProductupdateProduct(UpdateProductRequest request) Updates a [Product][google.cloud.retail.v2alpha.Product].Updates a [Product][google.cloud.retail.v2alpha.Product].
-
Constructor Details
-
ProductServiceClient
Constructs an instance of ProductServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
ProductServiceClient
-
-
Method Details
-
create
Constructs an instance of ProductServiceClient with default settings.- Throws:
IOException
-
create
Constructs an instance of ProductServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of ProductServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(ProductServiceSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
createProduct
Creates a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"); Product product = Product.newBuilder().build(); String productId = "productId-1051830678"; Product response = productServiceClient.createProduct(parent, product, productId); }- Parameters:
parent- Required. The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.product- Required. The [Product][google.cloud.retail.v2alpha.Product] to create.productId- Required. The ID to use for the [Product][google.cloud.retail.v2alpha.Product], which will become the final component of the [Product.name][google.cloud.retail.v2alpha.Product.name].If the caller does not have permission to create the [Product][google.cloud.retail.v2alpha.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.v2alpha.Product]s with the same [parent][google.cloud.retail.v2alpha.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.
- Throws:
ApiException- if the remote call fails
-
createProduct
Creates a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { String parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString(); Product product = Product.newBuilder().build(); String productId = "productId-1051830678"; Product response = productServiceClient.createProduct(parent, product, productId); }- Parameters:
parent- Required. The parent catalog resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch`.product- Required. The [Product][google.cloud.retail.v2alpha.Product] to create.productId- Required. The ID to use for the [Product][google.cloud.retail.v2alpha.Product], which will become the final component of the [Product.name][google.cloud.retail.v2alpha.Product.name].If the caller does not have permission to create the [Product][google.cloud.retail.v2alpha.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.v2alpha.Product]s with the same [parent][google.cloud.retail.v2alpha.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.
- Throws:
ApiException- if the remote call fails
-
createProduct
Creates a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { CreateProductRequest request = CreateProductRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setProduct(Product.newBuilder().build()) .setProductId("productId-1051830678") .build(); Product response = productServiceClient.createProduct(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createProductCallable
Creates a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { CreateProductRequest request = CreateProductRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setProduct(Product.newBuilder().build()) .setProductId("productId-1051830678") .build(); ApiFuture<Product> future = productServiceClient.createProductCallable().futureCall(request); // Do something. Product response = future.get(); } -
getProduct
Gets a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); Product response = productServiceClient.getProduct(name); }- Parameters:
name- Required. Full resource name of [Product][google.cloud.retail.v2alpha.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.v2alpha.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the requested [Product][google.cloud.retail.v2alpha.Product] does not exist, a NOT_FOUND error is returned.
- Throws:
ApiException- if the remote call fails
-
getProduct
Gets a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { String name = ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString(); Product response = productServiceClient.getProduct(name); }- Parameters:
name- Required. Full resource name of [Product][google.cloud.retail.v2alpha.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.v2alpha.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the requested [Product][google.cloud.retail.v2alpha.Product] does not exist, a NOT_FOUND error is returned.
- Throws:
ApiException- if the remote call fails
-
getProduct
Gets a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { GetProductRequest request = GetProductRequest.newBuilder() .setName( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .build(); Product response = productServiceClient.getProduct(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getProductCallable
Gets a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { GetProductRequest request = GetProductRequest.newBuilder() .setName( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .build(); ApiFuture<Product> future = productServiceClient.getProductCallable().futureCall(request); // Do something. Product response = future.get(); } -
listProducts
Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { BranchName parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"); for (Product element : productServiceClient.listProducts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent branch resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use `default_branch` as the branch ID, to list products under the default branch.If the caller does not have permission to list [Product][google.cloud.retail.v2alpha.Product]s under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.
- Throws:
ApiException- if the remote call fails
-
listProducts
Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { String parent = BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString(); for (Product element : productServiceClient.listProducts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent branch resource name, such as `projects/*/locations/global/catalogs/default_catalog/branches/0`. Use `default_branch` as the branch ID, to list products under the default branch.If the caller does not have permission to list [Product][google.cloud.retail.v2alpha.Product]s under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.
- Throws:
ApiException- if the remote call fails
-
listProducts
public final ProductServiceClient.ListProductsPagedResponse listProducts(ListProductsRequest request) Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ListProductsRequest request = ListProductsRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setReadMask(FieldMask.newBuilder().build()) .setRequireTotalSize(true) .build(); for (Product element : productServiceClient.listProducts(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listProductsPagedCallable
public final UnaryCallable<ListProductsRequest,ProductServiceClient.ListProductsPagedResponse> listProductsPagedCallable()Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ListProductsRequest request = ListProductsRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setReadMask(FieldMask.newBuilder().build()) .setRequireTotalSize(true) .build(); ApiFuture<Product> future = productServiceClient.listProductsPagedCallable().futureCall(request); // Do something. for (Product element : future.get().iterateAll()) { // doThingsWith(element); } } -
listProductsCallable
Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ListProductsRequest request = ListProductsRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setReadMask(FieldMask.newBuilder().build()) .setRequireTotalSize(true) .build(); while (true) { ListProductsResponse response = productServiceClient.listProductsCallable().call(request); for (Product element : response.getProductsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
updateProduct
Updates a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { Product product = Product.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Product response = productServiceClient.updateProduct(product, updateMask); }- Parameters:
product- Required. The product to update/create.If the caller does not have permission to update the [Product][google.cloud.retail.v2alpha.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the [Product][google.cloud.retail.v2alpha.Product] to update does not exist and [allow_missing][google.cloud.retail.v2alpha.UpdateProductRequest.allow_missing] is not set, a NOT_FOUND error is returned.
updateMask- Indicates which fields in the provided [Product][google.cloud.retail.v2alpha.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.
- Throws:
ApiException- if the remote call fails
-
updateProduct
Updates a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { UpdateProductRequest request = UpdateProductRequest.newBuilder() .setProduct(Product.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); Product response = productServiceClient.updateProduct(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateProductCallable
Updates a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { UpdateProductRequest request = UpdateProductRequest.newBuilder() .setProduct(Product.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<Product> future = productServiceClient.updateProductCallable().futureCall(request); // Do something. Product response = future.get(); } -
deleteProduct
Deletes a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); productServiceClient.deleteProduct(name); }- Parameters:
name- Required. Full resource name of [Product][google.cloud.retail.v2alpha.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.v2alpha.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the [Product][google.cloud.retail.v2alpha.Product] to delete does not exist, a NOT_FOUND error is returned.
The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be a [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION] [Product][google.cloud.retail.v2alpha.Product] member nor a [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] [Product][google.cloud.retail.v2alpha.Product] with more than one [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an INVALID_ARGUMENT error is returned.
All inventory information for the named [Product][google.cloud.retail.v2alpha.Product] will be deleted.
- Throws:
ApiException- if the remote call fails
-
deleteProduct
Deletes a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { String name = ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString(); productServiceClient.deleteProduct(name); }- Parameters:
name- Required. Full resource name of [Product][google.cloud.retail.v2alpha.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.v2alpha.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the [Product][google.cloud.retail.v2alpha.Product] to delete does not exist, a NOT_FOUND error is returned.
The [Product][google.cloud.retail.v2alpha.Product] to delete can neither be a [Product.Type.COLLECTION][google.cloud.retail.v2alpha.Product.Type.COLLECTION] [Product][google.cloud.retail.v2alpha.Product] member nor a [Product.Type.PRIMARY][google.cloud.retail.v2alpha.Product.Type.PRIMARY] [Product][google.cloud.retail.v2alpha.Product] with more than one [variants][google.cloud.retail.v2alpha.Product.Type.VARIANT]. Otherwise, an INVALID_ARGUMENT error is returned.
All inventory information for the named [Product][google.cloud.retail.v2alpha.Product] will be deleted.
- Throws:
ApiException- if the remote call fails
-
deleteProduct
Deletes a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { DeleteProductRequest request = DeleteProductRequest.newBuilder() .setName( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .setForce(true) .build(); productServiceClient.deleteProduct(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteProductCallable
Deletes a [Product][google.cloud.retail.v2alpha.Product].Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { DeleteProductRequest request = DeleteProductRequest.newBuilder() .setName( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .setForce(true) .build(); ApiFuture<Empty> future = productServiceClient.deleteProductCallable().futureCall(request); // Do something. future.get(); } -
purgeProductsAsync
public final OperationFuture<PurgeProductsResponse,PurgeProductsMetadata> purgeProductsAsync(PurgeProductsRequest request) Permanently deletes all selected [Product][google.cloud.retail.v2alpha.Product]s under a branch.This process is asynchronous. If the request is valid, the removal will be enqueued and processed offline. Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, this operation could take hours to complete. Before the operation completes, some [Product][google.cloud.retail.v2alpha.Product]s may still be returned by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, this operation could take hours to complete. To get a sample of [Product][google.cloud.retail.v2alpha.Product]s that would be deleted, set [PurgeProductsRequest.force][google.cloud.retail.v2alpha.PurgeProductsRequest.force] to false.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { PurgeProductsRequest request = PurgeProductsRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setFilter("filter-1274492040") .setForce(true) .build(); PurgeProductsResponse response = productServiceClient.purgeProductsAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
purgeProductsOperationCallable
public final OperationCallable<PurgeProductsRequest,PurgeProductsResponse, purgeProductsOperationCallable()PurgeProductsMetadata> Permanently deletes all selected [Product][google.cloud.retail.v2alpha.Product]s under a branch.This process is asynchronous. If the request is valid, the removal will be enqueued and processed offline. Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, this operation could take hours to complete. Before the operation completes, some [Product][google.cloud.retail.v2alpha.Product]s may still be returned by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, this operation could take hours to complete. To get a sample of [Product][google.cloud.retail.v2alpha.Product]s that would be deleted, set [PurgeProductsRequest.force][google.cloud.retail.v2alpha.PurgeProductsRequest.force] to false.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { PurgeProductsRequest request = PurgeProductsRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setFilter("filter-1274492040") .setForce(true) .build(); OperationFuture<PurgeProductsResponse, PurgeProductsMetadata> future = productServiceClient.purgeProductsOperationCallable().futureCall(request); // Do something. PurgeProductsResponse response = future.get(); } -
purgeProductsCallable
Permanently deletes all selected [Product][google.cloud.retail.v2alpha.Product]s under a branch.This process is asynchronous. If the request is valid, the removal will be enqueued and processed offline. Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, this operation could take hours to complete. Before the operation completes, some [Product][google.cloud.retail.v2alpha.Product]s may still be returned by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, this operation could take hours to complete. To get a sample of [Product][google.cloud.retail.v2alpha.Product]s that would be deleted, set [PurgeProductsRequest.force][google.cloud.retail.v2alpha.PurgeProductsRequest.force] to false.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { PurgeProductsRequest request = PurgeProductsRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setFilter("filter-1274492040") .setForce(true) .build(); ApiFuture<Operation> future = productServiceClient.purgeProductsCallable().futureCall(request); // Do something. Operation response = future.get(); } -
importProductsAsync
public final OperationFuture<ImportProductsResponse,ImportMetadata> importProductsAsync(ImportProductsRequest request) Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s.Request processing may be synchronous. Non-existing items are created.
Note that it is possible for a subset of the [Product][google.cloud.retail.v2alpha.Product]s to be successfully updated.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ImportProductsRequest request = ImportProductsRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setRequestId("requestId693933066") .setInputConfig(ProductInputConfig.newBuilder().build()) .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") .setSkipDefaultBranchProtection(true) .build(); ImportProductsResponse response = productServiceClient.importProductsAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
importProductsOperationCallable
public final OperationCallable<ImportProductsRequest,ImportProductsResponse, importProductsOperationCallable()ImportMetadata> Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s.Request processing may be synchronous. Non-existing items are created.
Note that it is possible for a subset of the [Product][google.cloud.retail.v2alpha.Product]s to be successfully updated.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ImportProductsRequest request = ImportProductsRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setRequestId("requestId693933066") .setInputConfig(ProductInputConfig.newBuilder().build()) .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") .setSkipDefaultBranchProtection(true) .build(); OperationFuture<ImportProductsResponse, ImportMetadata> future = productServiceClient.importProductsOperationCallable().futureCall(request); // Do something. ImportProductsResponse response = future.get(); } -
importProductsCallable
Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s.Request processing may be synchronous. Non-existing items are created.
Note that it is possible for a subset of the [Product][google.cloud.retail.v2alpha.Product]s to be successfully updated.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ImportProductsRequest request = ImportProductsRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setRequestId("requestId693933066") .setInputConfig(ProductInputConfig.newBuilder().build()) .setErrorsConfig(ImportErrorsConfig.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setNotificationPubsubTopic("notificationPubsubTopic-1361224991") .setSkipDefaultBranchProtection(true) .build(); ApiFuture<Operation> future = productServiceClient.importProductsCallable().futureCall(request); // Do something. Operation response = future.get(); } -
exportProductsAsync
public final OperationFuture<ExportProductsResponse,ExportMetadata> exportProductsAsync(ExportProductsRequest request) Exports multiple [Product][google.cloud.retail.v2alpha.Product]s.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ExportProductsRequest request = ExportProductsRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setOutputConfig(OutputConfig.newBuilder().build()) .setFilter("filter-1274492040") .build(); ExportProductsResponse response = productServiceClient.exportProductsAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
exportProductsOperationCallable
public final OperationCallable<ExportProductsRequest,ExportProductsResponse, exportProductsOperationCallable()ExportMetadata> Exports multiple [Product][google.cloud.retail.v2alpha.Product]s.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ExportProductsRequest request = ExportProductsRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setOutputConfig(OutputConfig.newBuilder().build()) .setFilter("filter-1274492040") .build(); OperationFuture<ExportProductsResponse, ExportMetadata> future = productServiceClient.exportProductsOperationCallable().futureCall(request); // Do something. ExportProductsResponse response = future.get(); } -
exportProductsCallable
Exports multiple [Product][google.cloud.retail.v2alpha.Product]s.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ExportProductsRequest request = ExportProductsRequest.newBuilder() .setParent( BranchName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]").toString()) .setOutputConfig(OutputConfig.newBuilder().build()) .setFilter("filter-1274492040") .build(); ApiFuture<Operation> future = productServiceClient.exportProductsCallable().futureCall(request); // Do something. Operation response = future.get(); } -
setInventoryAsync
public final OperationFuture<SetInventoryResponse,SetInventoryMetadata> setInventoryAsync(Product inventory, com.google.protobuf.FieldMask setMask) Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while respecting the last update timestamps of each inventory field.This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request.
If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], then any pre-existing inventory information for this product is used.
If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], then any existing inventory information is preserved.
Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces].
The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the [GetOperation][google.longrunning.Operations.GetOperation] API returns `NOT_FOUND` afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates are not marked as [done][google.longrunning.Operation.done] until they are obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { Product inventory = Product.newBuilder().build(); FieldMask setMask = FieldMask.newBuilder().build(); SetInventoryResponse response = productServiceClient.setInventoryAsync(inventory, setMask).get(); }- Parameters:
inventory- Required. The inventory information to update. The allowable fields to update are:- [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
- [Product.availability][google.cloud.retail.v2alpha.Product.availability]
- [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
- [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info] The updated inventory fields must be specified in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask].
If [SetInventoryRequest.inventory.name][google.cloud.retail.v2alpha.Product.name] is empty or invalid, an INVALID_ARGUMENT error is returned.
If the caller does not have permission to update the [Product][google.cloud.retail.v2alpha.Product] named in [Product.name][google.cloud.retail.v2alpha.Product.name], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
If the [Product][google.cloud.retail.v2alpha.Product] to update does not have existing inventory information, the provided inventory information will be inserted.
If the [Product][google.cloud.retail.v2alpha.Product] to update has existing inventory information, the provided inventory information will be merged while respecting the last update time for each inventory field, using the provided or default value for [SetInventoryRequest.set_time][google.cloud.retail.v2alpha.SetInventoryRequest.set_time].
The caller can replace place IDs for a subset of fulfillment types in the following ways:
- Adds "fulfillment_info" in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
- Specifies only the desired fulfillment types and corresponding place IDs to update in [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
The caller can clear all place IDs from a subset of fulfillment types in the following ways:
- Adds "fulfillment_info" in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask]
- Specifies only the desired fulfillment types to clear in [SetInventoryRequest.inventory.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
- Checks that only the desired fulfillment info types have empty [SetInventoryRequest.inventory.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]
The last update time is recorded for the following inventory fields:
- [Product.price_info][google.cloud.retail.v2alpha.Product.price_info]
- [Product.availability][google.cloud.retail.v2alpha.Product.availability]
- [Product.available_quantity][google.cloud.retail.v2alpha.Product.available_quantity]
- [Product.fulfillment_info][google.cloud.retail.v2alpha.Product.fulfillment_info]
If a full overwrite of inventory information while ignoring timestamps is needed, [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] should be invoked instead.
setMask- Indicates which inventory fields in the provided [Product][google.cloud.retail.v2alpha.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.
- Throws:
ApiException- if the remote call fails
-
setInventoryAsync
public final OperationFuture<SetInventoryResponse,SetInventoryMetadata> setInventoryAsync(SetInventoryRequest request) Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while respecting the last update timestamps of each inventory field.This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request.
If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], then any pre-existing inventory information for this product is used.
If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], then any existing inventory information is preserved.
Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces].
The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the [GetOperation][google.longrunning.Operations.GetOperation] API returns `NOT_FOUND` afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates are not marked as [done][google.longrunning.Operation.done] until they are obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { SetInventoryRequest request = SetInventoryRequest.newBuilder() .setInventory(Product.newBuilder().build()) .setSetMask(FieldMask.newBuilder().build()) .setSetTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); SetInventoryResponse response = productServiceClient.setInventoryAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setInventoryOperationCallable
public final OperationCallable<SetInventoryRequest,SetInventoryResponse, setInventoryOperationCallable()SetInventoryMetadata> Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while respecting the last update timestamps of each inventory field.This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request.
If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], then any pre-existing inventory information for this product is used.
If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], then any existing inventory information is preserved.
Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces].
The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the [GetOperation][google.longrunning.Operations.GetOperation] API returns `NOT_FOUND` afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates are not marked as [done][google.longrunning.Operation.done] until they are obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { SetInventoryRequest request = SetInventoryRequest.newBuilder() .setInventory(Product.newBuilder().build()) .setSetMask(FieldMask.newBuilder().build()) .setSetTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); OperationFuture<SetInventoryResponse, SetInventoryMetadata> future = productServiceClient.setInventoryOperationCallable().futureCall(request); // Do something. SetInventoryResponse response = future.get(); } -
setInventoryCallable
Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while respecting the last update timestamps of each inventory field.This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request.
If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2alpha.CreateProductRequest.product], then any pre-existing inventory information for this product is used.
If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2alpha.SetInventoryRequest.set_mask], then any existing inventory information is preserved.
Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2alpha.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces].
The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the [GetOperation][google.longrunning.Operations.GetOperation] API returns `NOT_FOUND` afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates are not marked as [done][google.longrunning.Operation.done] until they are obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { SetInventoryRequest request = SetInventoryRequest.newBuilder() .setInventory(Product.newBuilder().build()) .setSetMask(FieldMask.newBuilder().build()) .setSetTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<Operation> future = productServiceClient.setInventoryCallable().futureCall(request); // Do something. Operation response = future.get(); } -
addFulfillmentPlacesAsync
public final OperationFuture<AddFulfillmentPlacesResponse,AddFulfillmentPlacesMetadata> addFulfillmentPlacesAsync(ProductName product) We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.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.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ProductName product = ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); AddFulfillmentPlacesResponse response = productServiceClient.addFulfillmentPlacesAsync(product).get(); }- Parameters:
product- Required. Full resource name of [Product][google.cloud.retail.v2alpha.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.v2alpha.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
- Throws:
ApiException- if the remote call fails
-
addFulfillmentPlacesAsync
public final OperationFuture<AddFulfillmentPlacesResponse,AddFulfillmentPlacesMetadata> addFulfillmentPlacesAsync(String product) We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.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.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { String product = ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString(); AddFulfillmentPlacesResponse response = productServiceClient.addFulfillmentPlacesAsync(product).get(); }- Parameters:
product- Required. Full resource name of [Product][google.cloud.retail.v2alpha.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.v2alpha.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
- Throws:
ApiException- if the remote call fails
-
addFulfillmentPlacesAsync
public final OperationFuture<AddFulfillmentPlacesResponse,AddFulfillmentPlacesMetadata> addFulfillmentPlacesAsync(AddFulfillmentPlacesRequest request) We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.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.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { AddFulfillmentPlacesRequest request = AddFulfillmentPlacesRequest.newBuilder() .setProduct( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .setType("type3575610") .addAllPlaceIds(new ArrayList<String>()) .setAddTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); AddFulfillmentPlacesResponse response = productServiceClient.addFulfillmentPlacesAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
addFulfillmentPlacesOperationCallable
public final OperationCallable<AddFulfillmentPlacesRequest,AddFulfillmentPlacesResponse, addFulfillmentPlacesOperationCallable()AddFulfillmentPlacesMetadata> We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.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.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { AddFulfillmentPlacesRequest request = AddFulfillmentPlacesRequest.newBuilder() .setProduct( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .setType("type3575610") .addAllPlaceIds(new ArrayList<String>()) .setAddTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); OperationFuture<AddFulfillmentPlacesResponse, AddFulfillmentPlacesMetadata> future = productServiceClient.addFulfillmentPlacesOperationCallable().futureCall(request); // Do something. AddFulfillmentPlacesResponse response = future.get(); } -
addFulfillmentPlacesCallable
We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.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.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { AddFulfillmentPlacesRequest request = AddFulfillmentPlacesRequest.newBuilder() .setProduct( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .setType("type3575610") .addAllPlaceIds(new ArrayList<String>()) .setAddTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<Operation> future = productServiceClient.addFulfillmentPlacesCallable().futureCall(request); // Do something. Operation response = future.get(); } -
removeFulfillmentPlacesAsync
public final OperationFuture<RemoveFulfillmentPlacesResponse,RemoveFulfillmentPlacesMetadata> removeFulfillmentPlacesAsync(ProductName product) We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ProductName product = ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); RemoveFulfillmentPlacesResponse response = productServiceClient.removeFulfillmentPlacesAsync(product).get(); }- Parameters:
product- Required. Full resource name of [Product][google.cloud.retail.v2alpha.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.v2alpha.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
- Throws:
ApiException- if the remote call fails
-
removeFulfillmentPlacesAsync
public final OperationFuture<RemoveFulfillmentPlacesResponse,RemoveFulfillmentPlacesMetadata> removeFulfillmentPlacesAsync(String product) We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { String product = ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString(); RemoveFulfillmentPlacesResponse response = productServiceClient.removeFulfillmentPlacesAsync(product).get(); }- Parameters:
product- Required. Full resource name of [Product][google.cloud.retail.v2alpha.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.v2alpha.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
- Throws:
ApiException- if the remote call fails
-
removeFulfillmentPlacesAsync
public final OperationFuture<RemoveFulfillmentPlacesResponse,RemoveFulfillmentPlacesMetadata> removeFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest request) We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { RemoveFulfillmentPlacesRequest request = RemoveFulfillmentPlacesRequest.newBuilder() .setProduct( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .setType("type3575610") .addAllPlaceIds(new ArrayList<String>()) .setRemoveTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); RemoveFulfillmentPlacesResponse response = productServiceClient.removeFulfillmentPlacesAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
removeFulfillmentPlacesOperationCallable
public final OperationCallable<RemoveFulfillmentPlacesRequest,RemoveFulfillmentPlacesResponse, removeFulfillmentPlacesOperationCallable()RemoveFulfillmentPlacesMetadata> We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { RemoveFulfillmentPlacesRequest request = RemoveFulfillmentPlacesRequest.newBuilder() .setProduct( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .setType("type3575610") .addAllPlaceIds(new ArrayList<String>()) .setRemoveTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); OperationFuture<RemoveFulfillmentPlacesResponse, RemoveFulfillmentPlacesMetadata> future = productServiceClient.removeFulfillmentPlacesOperationCallable().futureCall(request); // Do something. RemoveFulfillmentPlacesResponse response = future.get(); } -
removeFulfillmentPlacesCallable
public final UnaryCallable<RemoveFulfillmentPlacesRequest,Operation> removeFulfillmentPlacesCallable()We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data.Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids].
This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { RemoveFulfillmentPlacesRequest request = RemoveFulfillmentPlacesRequest.newBuilder() .setProduct( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .setType("type3575610") .addAllPlaceIds(new ArrayList<String>()) .setRemoveTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<Operation> future = productServiceClient.removeFulfillmentPlacesCallable().futureCall(request); // Do something. Operation response = future.get(); } -
addLocalInventoriesAsync
public final OperationFuture<AddLocalInventoriesResponse,AddLocalInventoriesMetadata> addLocalInventoriesAsync(ProductName product) Updates local inventory information for a [Product][google.cloud.retail.v2alpha.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.v2alpha.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.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories.
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ProductName product = ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); AddLocalInventoriesResponse response = productServiceClient.addLocalInventoriesAsync(product).get(); }- Parameters:
product- Required. Full resource name of [Product][google.cloud.retail.v2alpha.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.v2alpha.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
- Throws:
ApiException- if the remote call fails
-
addLocalInventoriesAsync
public final OperationFuture<AddLocalInventoriesResponse,AddLocalInventoriesMetadata> addLocalInventoriesAsync(String product) Updates local inventory information for a [Product][google.cloud.retail.v2alpha.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.v2alpha.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.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories.
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { String product = ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString(); AddLocalInventoriesResponse response = productServiceClient.addLocalInventoriesAsync(product).get(); }- Parameters:
product- Required. Full resource name of [Product][google.cloud.retail.v2alpha.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.v2alpha.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
- Throws:
ApiException- if the remote call fails
-
addLocalInventoriesAsync
public final OperationFuture<AddLocalInventoriesResponse,AddLocalInventoriesMetadata> addLocalInventoriesAsync(AddLocalInventoriesRequest request) Updates local inventory information for a [Product][google.cloud.retail.v2alpha.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.v2alpha.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.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories.
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { AddLocalInventoriesRequest request = AddLocalInventoriesRequest.newBuilder() .setProduct( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .addAllLocalInventories(new ArrayList<LocalInventory>()) .setAddMask(FieldMask.newBuilder().build()) .setAddTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); AddLocalInventoriesResponse response = productServiceClient.addLocalInventoriesAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
addLocalInventoriesOperationCallable
public final OperationCallable<AddLocalInventoriesRequest,AddLocalInventoriesResponse, addLocalInventoriesOperationCallable()AddLocalInventoriesMetadata> Updates local inventory information for a [Product][google.cloud.retail.v2alpha.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.v2alpha.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.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories.
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { AddLocalInventoriesRequest request = AddLocalInventoriesRequest.newBuilder() .setProduct( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .addAllLocalInventories(new ArrayList<LocalInventory>()) .setAddMask(FieldMask.newBuilder().build()) .setAddTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); OperationFuture<AddLocalInventoriesResponse, AddLocalInventoriesMetadata> future = productServiceClient.addLocalInventoriesOperationCallable().futureCall(request); // Do something. AddLocalInventoriesResponse response = future.get(); } -
addLocalInventoriesCallable
Updates local inventory information for a [Product][google.cloud.retail.v2alpha.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.v2alpha.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.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories.
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { AddLocalInventoriesRequest request = AddLocalInventoriesRequest.newBuilder() .setProduct( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .addAllLocalInventories(new ArrayList<LocalInventory>()) .setAddMask(FieldMask.newBuilder().build()) .setAddTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<Operation> future = productServiceClient.addLocalInventoriesCallable().futureCall(request); // Do something. Operation response = future.get(); } -
removeLocalInventoriesAsync
public final OperationFuture<RemoveLocalInventoriesResponse,RemoveLocalInventoriesMetadata> removeLocalInventoriesAsync(ProductName product) Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp.This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories.
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { ProductName product = ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"); RemoveLocalInventoriesResponse response = productServiceClient.removeLocalInventoriesAsync(product).get(); }- Parameters:
product- Required. Full resource name of [Product][google.cloud.retail.v2alpha.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.v2alpha.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
- Throws:
ApiException- if the remote call fails
-
removeLocalInventoriesAsync
public final OperationFuture<RemoveLocalInventoriesResponse,RemoveLocalInventoriesMetadata> removeLocalInventoriesAsync(String product) Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp.This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories.
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { String product = ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString(); RemoveLocalInventoriesResponse response = productServiceClient.removeLocalInventoriesAsync(product).get(); }- Parameters:
product- Required. Full resource name of [Product][google.cloud.retail.v2alpha.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.v2alpha.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.
- Throws:
ApiException- if the remote call fails
-
removeLocalInventoriesAsync
public final OperationFuture<RemoveLocalInventoriesResponse,RemoveLocalInventoriesMetadata> removeLocalInventoriesAsync(RemoveLocalInventoriesRequest request) Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp.This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories.
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { RemoveLocalInventoriesRequest request = RemoveLocalInventoriesRequest.newBuilder() .setProduct( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .addAllPlaceIds(new ArrayList<String>()) .setRemoveTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); RemoveLocalInventoriesResponse response = productServiceClient.removeLocalInventoriesAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
removeLocalInventoriesOperationCallable
public final OperationCallable<RemoveLocalInventoriesRequest,RemoveLocalInventoriesResponse, removeLocalInventoriesOperationCallable()RemoveLocalInventoriesMetadata> Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp.This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories.
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { RemoveLocalInventoriesRequest request = RemoveLocalInventoriesRequest.newBuilder() .setProduct( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .addAllPlaceIds(new ArrayList<String>()) .setRemoveTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); OperationFuture<RemoveLocalInventoriesResponse, RemoveLocalInventoriesMetadata> future = productServiceClient.removeLocalInventoriesOperationCallable().futureCall(request); // Do something. RemoveLocalInventoriesResponse response = future.get(); } -
removeLocalInventoriesCallable
public final UnaryCallable<RemoveLocalInventoriesRequest,Operation> removeLocalInventoriesCallable()Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp.This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts].
Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories.
The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.
If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ProductServiceClient productServiceClient = ProductServiceClient.create()) { RemoveLocalInventoriesRequest request = RemoveLocalInventoriesRequest.newBuilder() .setProduct( ProductName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]") .toString()) .addAllPlaceIds(new ArrayList<String>()) .setRemoveTime(Timestamp.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<Operation> future = productServiceClient.removeLocalInventoriesCallable().futureCall(request); // Do something. Operation response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-