list method

Future<ListBillingAccountsResponse> list({
  1. String? filter,
  2. int? pageSize,
  3. String? pageToken,
  4. String? parent,
  5. String? $fields,
})

Lists the billing accounts that the current authenticated user has permission to view.

Request parameters:

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.

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

$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? filter,
  core.int? pageSize,
  core.String? pageToken,
  core.String? parent,
  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 (parent != null) 'parent': [parent],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'v1/billingAccounts';

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