list method

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

Lists projects that are direct children of the specified folder or organization resource.

list() provides a strongly consistent view of the projects underneath the specified parent resource. list() returns projects sorted based upon the (ascending) lexical ordering of their display_name. The caller must have resourcemanager.projects.list permission on the identified parent.

Request parameters:

pageSize - Optional. The maximum number of projects to return in the response. The server can return fewer projects than requested. If unspecified, server picks an appropriate default.

pageToken - Optional. A pagination token returned from a previous call to ListProjects that indicates from where listing should continue.

parent - Required. The name of the parent resource whose projects are being listed. Only children of this parent resource are listed; descendants are not listed. If the parent is a folder, use the value folders/{folder_id}. If the parent is an organization, use the value organizations/{org_id}.

showDeleted - Optional. Indicate that projects in the DELETE_REQUESTED state should also be returned. Normally only ACTIVE projects are returned.

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

Completes with a ListProjectsResponse.

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

  const url_ = 'v3/projects';

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