list method

Future<DriveList> list({
  1. int? pageSize,
  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 guide.

Request parameters:

pageSize - The maximum number of shared drives to return. The service may return fewer than this value. If unspecified, at most 10 shared drives will be returned. The maximum value is 100; values above 100 will be coerced to 100. 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? pageSize,
  core.String? pageToken,
  core.String? q,
  core.bool? useDomainAdminAccess,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'pageSize': ?pageSize == null ? null : ['${pageSize}'],
    'pageToken': ?pageToken == null ? null : [pageToken],
    'q': ?q == null ? null : [q],
    'useDomainAdminAccess': ?useDomainAdminAccess == null
        ? null
        : ['${useDomainAdminAccess}'],
    'fields': ?$fields == null ? null : [$fields],
  };

  const url_ = 'drives';

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