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 resource name of the Organization or Folder whose Folders are being listed. Must be of the form folders/{folder_id} or 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_ = 'v2/folders';

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