list method

Future<ListRepricingRuleReportsResponse> list(
  1. String merchantId,
  2. String ruleId, {
  3. String? endDate,
  4. int? pageSize,
  5. String? pageToken,
  6. String? startDate,
  7. String? $fields,
})

Deprecated: New merchants can't start using this service.

Lists the metrics report for a given Repricing rule.

Request parameters:

merchantId - Required. Id of the merchant who owns the Repricing rule.

ruleId - Required. Id of the Repricing rule.

endDate - Gets Repricing reports on and before this date in the merchant's timezone. You can only retrieve data up to 7 days ago (default) or earlier. Format: YYYY-MM-DD.

pageSize - Maximum number of daily reports to return. Each report includes data from a single 24-hour period. The page size defaults to 50 and values above 1000 are coerced to 1000. This service may return fewer days than this value, for example, if the time between your start and end date is less than page size.

pageToken - Token (if provided) to retrieve the subsequent page. All other parameters must match the original call that provided the page token.

startDate - Gets Repricing reports on and after this date in the merchant's timezone, up to one year ago. Do not use a start date later than 7 days ago (default). Format: YYYY-MM-DD.

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

Completes with a ListRepricingRuleReportsResponse.

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<ListRepricingRuleReportsResponse> list(
  core.String merchantId,
  core.String ruleId, {
  core.String? endDate,
  core.int? pageSize,
  core.String? pageToken,
  core.String? startDate,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (endDate != null) 'endDate': [endDate],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (startDate != null) 'startDate': [startDate],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = commons.escapeVariable('$merchantId') +
      '/repricingrules/' +
      commons.escapeVariable('$ruleId') +
      '/repricingreports';

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