list method

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

Returns a list of budgets for a billing account.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. When reading from the API, you will not see these fields in the return value, though they may have been set in the Cloud Console.

Request parameters:

parent - Required. Name of billing account to list budgets under. Values are of the form billingAccounts/{billingAccountId}. Value must have pattern ^billingAccounts/\[^/\]+$.

pageSize - Optional. The maximum number of budgets to return per page. The default and maximum value are 100.

pageToken - Optional. The value returned by the last ListBudgetsResponse which indicates that this is a continuation of a prior ListBudgets call, and that the system should return the next page of data.

scope - Optional. Set the scope of the budgets to be returned, in the format of the resource name. The scope of a budget is the cost that it tracks, such as costs for a single project, or the costs for all projects in a folder. Only project scope (in the format of "projects/project-id" or "projects/123") is supported in this field. When this field is set to a project's resource name, the budgets returned are tracking the costs for that project.

$fields - Selector specifying which fields to include in a partial response.

Completes with a GoogleCloudBillingBudgetsV1ListBudgetsResponse.

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<GoogleCloudBillingBudgetsV1ListBudgetsResponse> list(
  core.String parent, {
  core.int? pageSize,
  core.String? pageToken,
  core.String? scope,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (scope != null) 'scope': [scope],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/budgets';

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