removeFulfillmentPlaces method

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

We recommend that you use the ProductService.RemoveLocalInventories method instead of the ProductService.RemoveFulfillmentPlaces method.

ProductService.RemoveLocalInventories achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete.

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> removeFulfillmentPlaces(
  GoogleCloudRetailV2RemoveFulfillmentPlacesRequest 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') + ':removeFulfillmentPlaces';

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