Skip to main content

changes

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

Overview

Namechanges
TypeResource
Idgoogleworkspace.drivev3.changes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
changeTypestringThe type of the change. Possible values are file and drive.
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 which has changed.
kindstringIdentifies what kind of resource this is. Value: the fixed string "drive#change". (default: drive#change)
removedbooleanWhether the file or shared drive has been removed from this list of changes, for example by deletion or loss of access.
teamDriveobjectDeprecated: Use drive instead. (id: TeamDrive)
teamDriveIdstringDeprecated: Use driveId instead.
timestring (date-time)The time of this change (RFC 3339 date-time).
typestringDeprecated: Use changeType instead.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectpageTokendriveId, includeCorpusRemovals, includeItemsFromAllDrives, includeRemoved, includeTeamDriveItems, pageSize, restrictToMyDrive, spaces, supportsAllDrives, supportsTeamDrives, teamDriveId, includePermissionsForView, includeLabelsLists the changes for a user or shared drive. For more information, see Retrieve changes.
watchexecpageTokendriveId, includeCorpusRemovals, includeItemsFromAllDrives, includeRemoved, includeTeamDriveItems, pageSize, restrictToMyDrive, spaces, supportsAllDrives, supportsTeamDrives, teamDriveId, includePermissionsForView, includeLabelsSubscribes to changes for a user. For more information, see Notifications for resource changes.

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
pageTokenstring
driveIdstring
includeCorpusRemovalsboolean
includeItemsFromAllDrivesboolean
includeLabelsstring
includePermissionsForViewstring
includeRemovedboolean
includeTeamDriveItemsboolean
pageSizeinteger (int32)
restrictToMyDriveboolean
spacesstring
supportsAllDrivesboolean
supportsTeamDrivesboolean
teamDriveIdstring

SELECT examples

Lists the changes for a user or shared drive. For more information, see Retrieve changes.

SELECT
changeType,
drive,
driveId,
file,
fileId,
kind,
removed,
teamDrive,
teamDriveId,
time,
type
FROM googleworkspace.drivev3.changes
WHERE pageToken = '{{ pageToken }}' -- required
AND driveId = '{{ driveId }}'
AND includeCorpusRemovals = '{{ includeCorpusRemovals }}'
AND includeItemsFromAllDrives = '{{ includeItemsFromAllDrives }}'
AND includeRemoved = '{{ includeRemoved }}'
AND includeTeamDriveItems = '{{ includeTeamDriveItems }}'
AND pageSize = '{{ pageSize }}'
AND restrictToMyDrive = '{{ restrictToMyDrive }}'
AND spaces = '{{ spaces }}'
AND supportsAllDrives = '{{ supportsAllDrives }}'
AND supportsTeamDrives = '{{ supportsTeamDrives }}'
AND teamDriveId = '{{ teamDriveId }}'
AND includePermissionsForView = '{{ includePermissionsForView }}'
AND includeLabels = '{{ includeLabels }}'
;

Lifecycle Methods

Subscribes to changes for a user. For more information, see Notifications for resource changes.

EXEC googleworkspace.drivev3.changes.watch 
@pageToken='{{ pageToken }}' --required,
@driveId='{{ driveId }}',
@includeCorpusRemovals={{ includeCorpusRemovals }},
@includeItemsFromAllDrives={{ includeItemsFromAllDrives }},
@includeRemoved={{ includeRemoved }},
@includeTeamDriveItems={{ includeTeamDriveItems }},
@pageSize='{{ pageSize }}',
@restrictToMyDrive={{ restrictToMyDrive }},
@spaces='{{ spaces }}',
@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 }}"
}'
;