list method

Future<ChangeList> list(
  1. String pageToken, {
  2. String? driveId,
  3. bool? includeCorpusRemovals,
  4. bool? includeItemsFromAllDrives,
  5. String? includeLabels,
  6. String? includePermissionsForView,
  7. bool? includeRemoved,
  8. bool? includeTeamDriveItems,
  9. int? pageSize,
  10. bool? restrictToMyDrive,
  11. String? spaces,
  12. bool? supportsAllDrives,
  13. bool? supportsTeamDrives,
  14. String? teamDriveId,
  15. String? $fields,
})

Lists the changes for a user or shared drive.

Request parameters:

pageToken - The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method.

driveId - The shared drive from which changes will be returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier.

includeCorpusRemovals - Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file.

includeItemsFromAllDrives - Whether both My Drive and shared drive items should be included in results.

includeLabels - A comma-separated list of IDs of labels to include in the labelInfo part of the response.

includePermissionsForView - Specifies which additional view's permissions to include in the response. Only 'published' is supported.

includeRemoved - Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access.

includeTeamDriveItems - Deprecated: Use includeItemsFromAllDrives instead.

pageSize - The maximum number of changes to return per page. Value must be between "1" and "1000".

restrictToMyDrive - Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive.

spaces - A comma-separated list of spaces to query within the corpora. Supported values are 'drive' and 'appDataFolder'.

supportsAllDrives - Whether the requesting application supports both My Drives and shared drives.

supportsTeamDrives - Deprecated: Use supportsAllDrives instead.

teamDriveId - Deprecated: Use driveId instead.

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

Completes with a ChangeList.

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<ChangeList> list(
  core.String pageToken, {
  core.String? driveId,
  core.bool? includeCorpusRemovals,
  core.bool? includeItemsFromAllDrives,
  core.String? includeLabels,
  core.String? includePermissionsForView,
  core.bool? includeRemoved,
  core.bool? includeTeamDriveItems,
  core.int? pageSize,
  core.bool? restrictToMyDrive,
  core.String? spaces,
  core.bool? supportsAllDrives,
  core.bool? supportsTeamDrives,
  core.String? teamDriveId,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    'pageToken': [pageToken],
    if (driveId != null) 'driveId': [driveId],
    if (includeCorpusRemovals != null)
      'includeCorpusRemovals': ['${includeCorpusRemovals}'],
    if (includeItemsFromAllDrives != null)
      'includeItemsFromAllDrives': ['${includeItemsFromAllDrives}'],
    if (includeLabels != null) 'includeLabels': [includeLabels],
    if (includePermissionsForView != null)
      'includePermissionsForView': [includePermissionsForView],
    if (includeRemoved != null) 'includeRemoved': ['${includeRemoved}'],
    if (includeTeamDriveItems != null)
      'includeTeamDriveItems': ['${includeTeamDriveItems}'],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (restrictToMyDrive != null)
      'restrictToMyDrive': ['${restrictToMyDrive}'],
    if (spaces != null) 'spaces': [spaces],
    if (supportsAllDrives != null)
      'supportsAllDrives': ['${supportsAllDrives}'],
    if (supportsTeamDrives != null)
      'supportsTeamDrives': ['${supportsTeamDrives}'],
    if (teamDriveId != null) 'teamDriveId': [teamDriveId],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'changes';

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