list method
Lists the billing accounts that the current authenticated user has permission to view.
Request parameters:
parent
- Optional. The parent resource to list billing accounts from.
Format: - organizations/{organization_id}
, for example,
organizations/12345678
- billingAccounts/{billing_account_id}
, for
example, billingAccounts/012345-567890-ABCDEF
Value must have pattern ^billingAccounts/\[^/\]+$
.
filter
- Options for how to filter the returned billing accounts. This
only supports filtering for
subaccounts under a
single provided parent billing account. (for example,
master_billing_account=billingAccounts/012345-678901-ABCDEF
). Boolean
algebra and other fields are not currently supported.
pageSize
- Requested page size. The maximum page size is 100; this is
also the default.
pageToken
- A token identifying a page of results to return. This should
be a next_page_token
value returned from a previous
ListBillingAccounts
call. If unspecified, the first page of results is
returned.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListBillingAccountsResponse.
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<ListBillingAccountsResponse> list(
core.String parent, {
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (filter != null) 'filter': [filter],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/subAccounts';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListBillingAccountsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}