list method
Retrieves a list of invoices for a particular issue month.
The api only works if the billing profile invoice level is set to either advertiser or campaign non-consolidated invoice level.
Request parameters:
profileId
- User profile ID associated with this request.
Value must have pattern ^\[^/\]+$
.
advertiserId
- Advertiser ID of this invoice.
Value must have pattern ^\[^/\]+$
.
issueMonth
- Month for which invoices are needed in the format YYYYMM.
Required field
maxResults
- Maximum number of results to return.
pageToken
- Value of the nextPageToken from the previous result page.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a AdvertiserInvoicesListResponse.
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<AdvertiserInvoicesListResponse> list(
core.String profileId,
core.String advertiserId, {
core.String? issueMonth,
core.int? maxResults,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (issueMonth != null) 'issueMonth': [issueMonth],
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'userprofiles/' +
core.Uri.encodeFull('$profileId') +
'/advertisers/' +
core.Uri.encodeFull('$advertiserId') +
'/invoices';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return AdvertiserInvoicesListResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}