get method

Future<DatafeedStatus> get(
  1. String merchantId,
  2. String datafeedId, {
  3. String? country,
  4. String? feedLabel,
  5. String? language,
  6. String? $fields,
})

Retrieves the status of a datafeed from your Merchant Center account.

Request parameters:

merchantId - The ID of the account that manages the datafeed. This account cannot be a multi-client account.

datafeedId - The ID of the datafeed.

country - Deprecated. Use feedLabel instead. The country to get the datafeed status for. If this parameter is provided then language must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target.

feedLabel - The feed label to get the datafeed status for. If this parameter is provided then language must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target.

language - The language to get the datafeed status for. If this parameter is provided then country must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target.

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

Completes with a DatafeedStatus.

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

  final url_ = commons.escapeVariable('$merchantId') +
      '/datafeedstatuses/' +
      commons.escapeVariable('$datafeedId');

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