lookupInvoiceCurrency method

Future<LookupInvoiceCurrencyResponse> lookupInvoiceCurrency(
  1. String advertiserId, {
  2. String? invoiceMonth,
  3. String? $fields,
})

Retrieves the invoice currency used by an advertiser in a given month.

Request parameters:

advertiserId - Required. The ID of the advertiser to lookup currency for. Value must have pattern ^\[^/\]+$.

invoiceMonth - Month for which the currency is needed. If not set, the request will return existing currency settings for the advertiser. Must be in the format YYYYMM.

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

Completes with a LookupInvoiceCurrencyResponse.

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

  final url_ = 'v2/advertisers/' +
      core.Uri.encodeFull('$advertiserId') +
      '/invoices:lookupInvoiceCurrency';

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