list method
Returns all invoices associated with a billing setup, for a given month.
List of thrown errors: [AuthenticationError]() [AuthorizationError]() [FieldError]() [HeaderError]() [InternalError]() [InvoiceError]() [QuotaError]() [RequestError]()
Request parameters:
customerId - Required. The ID of the customer to fetch invoices for.
Value must have pattern ^\[^/\]+$.
billingSetup - Required. The billing setup resource name of the
requested invoices.
customers/{customer_id}/billingSetups/{billing_setup_id}
includeGranularLevelInvoiceDetails - Optional. When true, the response
will include more granular level invoice details such as campaign level
cost breakdown, itemized regulatory costs and adjustments. The default
value is false.
issueMonth - Required. The issue month to retrieve invoices.
Possible string values are:
- "UNSPECIFIED" : Not specified.
- "UNKNOWN" : The value is unknown in this version.
- "JANUARY" : January.
- "FEBRUARY" : February.
- "MARCH" : March.
- "APRIL" : April.
- "MAY" : May.
- "JUNE" : June.
- "JULY" : July.
- "AUGUST" : August.
- "SEPTEMBER" : September.
- "OCTOBER" : October.
- "NOVEMBER" : November.
- "DECEMBER" : December.
issueYear - Required. The issue year to retrieve invoices, in yyyy
format. Only invoices issued in 2019 or later can be retrieved.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a GoogleAdsSearchads360V23ServicesListInvoicesResponse.
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<GoogleAdsSearchads360V23ServicesListInvoicesResponse> list(
core.String customerId, {
core.String? billingSetup,
core.bool? includeGranularLevelInvoiceDetails,
core.String? issueMonth,
core.String? issueYear,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'billingSetup': ?billingSetup == null ? null : [billingSetup],
'includeGranularLevelInvoiceDetails':
?includeGranularLevelInvoiceDetails == null
? null
: ['${includeGranularLevelInvoiceDetails}'],
'issueMonth': ?issueMonth == null ? null : [issueMonth],
'issueYear': ?issueYear == null ? null : [issueYear],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v23/customers/' + core.Uri.encodeFull('$customerId') + '/invoices';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GoogleAdsSearchads360V23ServicesListInvoicesResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}