Skip to main content

changes

Creates, updates, deletes, gets or lists a changes resource.

Overview

Namechanges
TypeResource
Idgoogleworkspace.drivev2.changes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (int64)The ID of the change.
changeTypestringThe type of the change. Possible values are file and drive.
deletedbooleanWhether the file or shared drive has been removed from this list of changes, for example by deletion or loss of access.
driveobjectThe updated state of the shared drive. Present if the changeType is drive, the user is still a member of the shared drive, and the shared drive has not been deleted. (id: Drive)
driveIdstringThe ID of the shared drive associated with this change.
fileobjectThe updated state of the file. Present if the type is file and the file has not been removed from this list of changes. (id: File)
fileIdstringThe ID of the file associated with this change.
kindstringThis is always drive#change. (default: drive#change)
modificationDatestring (date-time)The time of this modification.
selfLinkstringA link back to this change.
teamDriveobjectDeprecated: Use drive instead. (id: TeamDrive)
teamDriveIdstringDeprecated: Use driveId instead.
typestringDeprecated: Use changeType instead.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectchangeIddriveId, supportsAllDrives, supportsTeamDrives, teamDriveIdDeprecated: Use changes.getStartPageToken and changes.list to retrieve recent changes.
listselectdriveId, includeCorpusRemovals, includeDeleted, includeItemsFromAllDrives, includeSubscribed, includeTeamDriveItems, maxResults, pageToken, spaces, startChangeId, supportsAllDrives, supportsTeamDrives, teamDriveId, includePermissionsForView, includeLabelsLists the changes for a user or shared drive.
watchexecdriveId, includeCorpusRemovals, includeDeleted, includeItemsFromAllDrives, includeSubscribed, includeTeamDriveItems, maxResults, pageToken, spaces, startChangeId, supportsAllDrives, supportsTeamDrives, teamDriveId, includePermissionsForView, includeLabelsSubscribe to changes for a user.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
changeIdstring
driveIdstring
includeCorpusRemovalsboolean
includeDeletedboolean
includeItemsFromAllDrivesboolean
includeLabelsstring
includePermissionsForViewstring
includeSubscribedboolean
includeTeamDriveItemsboolean
maxResultsinteger (int32)
pageTokenstring
spacesstring
startChangeIdstring (int64)
supportsAllDrivesboolean
supportsTeamDrivesboolean
teamDriveIdstring

SELECT examples

Deprecated: Use changes.getStartPageToken and changes.list to retrieve recent changes.

SELECT
id,
changeType,
deleted,
drive,
driveId,
file,
fileId,
kind,
modificationDate,
selfLink,
teamDrive,
teamDriveId,
type
FROM googleworkspace.drivev2.changes
WHERE changeId = '{{ changeId }}' -- required
AND driveId = '{{ driveId }}'
AND supportsAllDrives = '{{ supportsAllDrives }}'
AND supportsTeamDrives = '{{ supportsTeamDrives }}'
AND teamDriveId = '{{ teamDriveId }}'
;

Lifecycle Methods

Subscribe to changes for a user.

EXEC googleworkspace.drivev2.changes.watch 
@driveId='{{ driveId }}',
@includeCorpusRemovals={{ includeCorpusRemovals }},
@includeDeleted={{ includeDeleted }},
@includeItemsFromAllDrives={{ includeItemsFromAllDrives }},
@includeSubscribed={{ includeSubscribed }},
@includeTeamDriveItems={{ includeTeamDriveItems }},
@maxResults='{{ maxResults }}',
@pageToken='{{ pageToken }}',
@spaces='{{ spaces }}',
@startChangeId='{{ startChangeId }}',
@supportsAllDrives={{ supportsAllDrives }},
@supportsTeamDrives={{ supportsTeamDrives }},
@teamDriveId='{{ teamDriveId }}',
@includePermissionsForView='{{ includePermissionsForView }}',
@includeLabels='{{ includeLabels }}'
@@json=
'{
"payload": {{ payload }},
"id": "{{ id }}",
"resourceId": "{{ resourceId }}",
"resourceUri": "{{ resourceUri }}",
"token": "{{ token }}",
"expiration": "{{ expiration }}",
"type": "{{ type }}",
"address": "{{ address }}",
"params": "{{ params }}",
"kind": "{{ kind }}"
}'
;