watch method

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

Subscribes to changes for a user.

request - The metadata request object.

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 Channel.

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<Channel> watch(
  Channel request,
  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 body_ = convert.json.encode(request);
  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/watch';

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