removeLocalInventories method

Future<GoogleLongrunningOperation> removeLocalInventories(
  1. GoogleCloudRetailV2RemoveLocalInventoriesRequest request,
  2. String product, {
  3. String? $fields,
})

Remove local inventory information for a Product at a list of places at a removal timestamp.

This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method. ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete.

request - The metadata request object.

Request parameters:

product - Required. Full resource name of Product, such as projects / * /locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/catalogs/\[^/\]+/branches/\[^/\]+/products/.*$.

$fields - Selector specifying which fields to include in a partial response.

Completes with a GoogleLongrunningOperation.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<GoogleLongrunningOperation> removeLocalInventories(
  GoogleCloudRetailV2RemoveLocalInventoriesRequest request,
  core.String product, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ =
      'v2/' + core.Uri.encodeFull('$product') + ':removeLocalInventories';

  final response_ = await _requester.request(
    url_,
    'POST',
    body: body_,
    queryParams: queryParams_,
  );
  return GoogleLongrunningOperation.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}