list method
Lists the projects associated with a billing account.
The current authenticated user must have the
billing.resourceAssociations.list
IAM permission, which is often given
to billing account
viewers.
Request parameters:
name
- Required. The resource name of the billing account associated
with the projects that you want to list. For example,
billingAccounts/012345-567890-ABCDEF
.
Value must have pattern ^billingAccounts/\[^/\]+$
.
pageSize
- Requested page size. The maximum page size is 100; this is
also the default.
pageToken
- A token identifying a page of results to be returned. This
should be a next_page_token
value returned from a previous
ListProjectBillingInfo
call. If unspecified, the first page of results
is returned.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListProjectBillingInfoResponse.
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<ListProjectBillingInfoResponse> list(
core.String name, {
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$name') + '/projects';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListProjectBillingInfoResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}