list method

Future<SettlementtransactionsListResponse> list(
  1. String merchantId,
  2. String settlementId, {
  3. int? maxResults,
  4. String? pageToken,
  5. List<String>? transactionIds,
  6. String? $fields,
})

Retrieves a list of transactions for the settlement.

Request parameters:

merchantId - The Merchant Center account to list transactions for.

settlementId - The Google-provided ID of the settlement.

maxResults - The maximum number of transactions to return in the response, used for paging. The default value is 200 transactions per page, and the maximum allowed value is 5000 transactions per page.

pageToken - The token returned by the previous request.

transactionIds - The list of transactions to return. If not set, all transactions will be returned.

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

Completes with a SettlementtransactionsListResponse.

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

  final url_ = commons.escapeVariable('$merchantId') +
      '/settlementreports/' +
      commons.escapeVariable('$settlementId') +
      '/transactions';

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