list method

Future<DriveList> list({
  1. int? maxResults,
  2. String? pageToken,
  3. String? q,
  4. bool? useDomainAdminAccess,
  5. String? $fields,
})

Lists the user's shared drives.

This method accepts the q parameter, which is a search query combining one or more search terms. For more information, see the [Search for shared drives](/drive/api/guides/search-shareddrives) guide.

Request parameters:

maxResults - Maximum number of shared drives to return per page. Value must be between "1" and "100".

pageToken - Page token for shared drives.

q - Query string for searching shared drives.

useDomainAdminAccess - Issue the request as a domain administrator; if set to true, then all shared drives of the domain in which the requester is an administrator are returned.

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

Completes with a DriveList.

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

  const url_ = 'drives';

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