list method

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

Lists the folders that are direct descendants of supplied parent resource.

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

Request parameters:

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

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

parent - Required. The name of the parent resource whose folders 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}. Access to this method is controlled by checking the resourcemanager.folders.list permission on the parent.

showDeleted - Optional. Controls whether folders in the DELETE_REQUESTED state should be returned. Defaults to false.

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

Completes with a ListFoldersResponse.

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<ListFoldersResponse> 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/folders';

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