get method

Future<Product> get(
  1. String name, {
  2. String? $fields,
})

Retrieves the processed product from your Merchant Center account.

After inserting, updating, or deleting a product input, it may take several minutes before the updated final product can be retrieved.

Request parameters:

name - Required. The name of the product to retrieve. Format: accounts/{account}/products/{product} where the last section product consists of: content_language~feed_label~offer_id example for product name is accounts/123/products/en~US~sku123. A legacy local product name would be accounts/123/products/local~en~US~sku123. Note: For calls to the v1beta version, the product section consists of: channel~content_language~feed_label~offer_id, for example: accounts/123/products/online~en~US~sku123. Value must have pattern ^accounts/\[^/\]+/products/\[^/\]+$.

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

Completes with a Product.

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<Product> get(core.String name, {core.String? $fields}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'products/v1/' + core.Uri.encodeFull('$name');

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