Skip to main content

files

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

Overview

Namefiles
TypeResource
Idgoogleworkspace.drivev3.files

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the file.
namestringThe name of the file. This isn't necessarily unique within a folder. Note that for immutable items such as the top-level folders of shared drives, the My Drive root folder, and the Application Data folder, the name is constant.
appPropertiesobjectA collection of arbitrary key-value pairs which are private to the requesting app. Entries with null values are cleared in update and copy requests. These properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties.
capabilitiesobjectOutput only. Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. For more information, see Understand file capabilities.
clientEncryptionDetailsobjectClient Side Encryption related details. Contains details about the encryption state of the file and details regarding the encryption mechanism that clients need to use when decrypting the contents of this item. This will only be present on files and not on folders or shortcuts. (id: ClientEncryptionDetails)
contentHintsobjectAdditional information about the content of the file. These fields are never populated in responses.
contentRestrictionsarrayRestrictions for accessing the content of the file. Only populated if such a restriction exists.
copyRequiresWriterPermissionbooleanWhether the options to copy, print, or download this file should be disabled for readers and commenters.
createdTimestring (date-time)The time at which the file was created (RFC 3339 date-time).
descriptionstringA short description of the file.
downloadRestrictionsobjectDownload restrictions applied on the file. (id: DownloadRestrictionsMetadata)
driveIdstringOutput only. ID of the shared drive the file resides in. Only populated for items in shared drives.
explicitlyTrashedbooleanOutput only. Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
exportLinksobjectOutput only. Links for exporting Docs Editors files to specific formats.
fileExtensionstringOutput only. The final component of fullFileExtension. This is only available for files with binary content in Google Drive.
folderColorRgbstringThe color for a folder or a shortcut to a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the about resource. If an unsupported color is specified, the closest color in the palette is used instead.
fullFileExtensionstringOutput only. The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. This is automatically updated when the name field changes, however it's not cleared if the new name doesn't contain a valid extension.
hasAugmentedPermissionsbooleanOutput only. Whether there are permissions directly on this file. This field is only populated for items in shared drives.
hasThumbnailbooleanOutput only. Whether this file has a thumbnail. This doesn't indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field.
headRevisionIdstringOutput only. The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.
iconLinkstringOutput only. A static, unauthenticated link to the file's icon.
imageMediaMetadataobjectOutput only. Additional metadata about image media, if available.
inheritedPermissionsDisabledbooleanWhether this file has inherited permissions disabled. Inherited permissions are enabled by default.
isAppAuthorizedbooleanOutput only. Whether the file was created or opened by the requesting app.
kindstringOutput only. Identifies what kind of resource this is. Value: the fixed string "drive#file". (default: drive#file)
labelInfoobjectLabel information on the file.
lastModifyingUserobjectInformation about a Drive user. (id: User)
linkShareMetadataobjectContains details about the link URLs that clients are using to refer to this item.
md5ChecksumstringOutput only. The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
mimeTypestringThe MIME type of the file. Google Drive attempts to automatically detect an appropriate value from uploaded content, if no value is provided. The value cannot be changed unless a new revision is uploaded. If a file is created with a Google Doc MIME type, the uploaded content is imported, if possible. The supported import formats are published in the about resource.
modifiedByMebooleanOutput only. Whether the file has been modified by this user.
modifiedByMeTimestring (date-time)The last time the file was modified by the user (RFC 3339 date-time).
modifiedTimestring (date-time)he last time the file was modified by anyone (RFC 3339 date-time). Note that setting modifiedTime will also update modifiedByMeTime for the user.
originalFilenamestringThe original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Google Drive.
ownedByMebooleanOutput only. Whether the user owns the file. Not populated for items in shared drives.
ownersarrayOutput only. The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives.
parentsarrayThe ID of the parent folder containing the file. A file can only have one parent folder; specifying multiple parents isn't supported. If not specified as part of a create request, the file is placed directly in the user's My Drive folder. If not specified as part of a copy request, the file inherits any discoverable parent of the source file. Update requests must use the addParents and removeParents parameters to modify the parents list.
permissionIdsarrayOutput only. List of permission IDs for users with access to this file.
permissionsarrayOutput only. The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for items in shared drives.
propertiesobjectA collection of arbitrary key-value pairs which are visible to all apps. Entries with null values are cleared in update and copy requests.
quotaBytesUsedstring (int64)Output only. The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.
resourceKeystringOutput only. A key needed to access the item via a shared link.
sha1ChecksumstringOutput only. The SHA1 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it's not populated for Docs Editors or shortcut files.
sha256ChecksumstringOutput only. The SHA256 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it's not populated for Docs Editors or shortcut files.
sharedbooleanOutput only. Whether the file has been shared. Not populated for items in shared drives.
sharedWithMeTimestring (date-time)The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
sharingUserobjectInformation about a Drive user. (id: User)
shortcutDetailsobjectInformation about a shortcut file.
sizestring (int64)Output only. Size in bytes of blobs and Google Workspace editor files. Won't be populated for files that have no size, like shortcuts and folders.
spacesarrayOutput only. The list of spaces which contain the file. The currently supported values are drive, appDataFolder, and photos.
starredbooleanWhether the user has starred the file.
teamDriveIdstringDeprecated: Output only. Use driveId instead.
thumbnailLinkstringOutput only. A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Not intended for direct usage on web applications due to Cross-Origin Resource Sharing (CORS) policies. Consider using a proxy server. Only populated when the requesting app can access the file's content. If the file isn't shared publicly, the URL returned in files.thumbnailLink must be fetched using a credentialed request.
thumbnailVersionstring (int64)Output only. The thumbnail version for use in thumbnail cache invalidation.
trashedbooleanWhether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, but other users can still access the file in the owner's trash until it's permanently deleted.
trashedTimestring (date-time)The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
trashingUserobjectInformation about a Drive user. (id: User)
versionstring (int64)Output only. A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the user.
videoMediaMetadataobjectOutput only. Additional metadata about video media. This may not be available immediately upon upload.
viewedByMebooleanOutput only. Whether the file has been viewed by this user.
viewedByMeTimestring (date-time)The last time the file was viewed by the user (RFC 3339 date-time).
viewersCanCopyContentbooleanDeprecated: Use copyRequiresWriterPermission instead.
webContentLinkstringOutput only. A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive.
webViewLinkstringOutput only. A link for opening the file in a relevant Google editor or viewer in a browser.
writersCanSharebooleanWhether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectfileIdacknowledgeAbuse, includeLabels, includePermissionsForView, supportsTeamDrives, supportsAllDrives Gets a file's metadata or content by ID. For more information, see Search for files and folders. If you provide the URL parameter alt=media, then the response includes the file contents in the response body. Downloading content with alt=media only works if the file is stored in Drive. To download Google Docs, Sheets, and Slides use files.export instead. For more information, see Download and export files.
listselectq, includePermissionsForView, driveId, pageSize, includeTeamDriveItems, orderBy, corpora, supportsTeamDrives, includeItemsFromAllDrives, spaces, pageToken, corpus, includeLabels, supportsAllDrives, teamDriveId Lists the user's files. For more information, see Search for files and folders. This method accepts the q parameter, which is a search query combining one or more search terms. This method returns all files by default, including trashed files. If you don't want trashed files to appear in the list, use the trashed=false query parameter to remove trashed files from the results.
createinsertocrLanguage, includePermissionsForView, ignoreDefaultVisibility, keepRevisionForever, enforceSingleParent, includeLabels, supportsAllDrives, supportsTeamDrives, useContentAsIndexableText Creates a file. For more information, see Create and manage files. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types: */* (Specify a valid MIME type, rather than the literal */* value. The literal */* is only used to indicate that any valid MIME type can be uploaded. For more information, see Google Workspace and Google Drive supported MIME types.) For more information on uploading files, see Upload file data. Apps creating shortcuts with the create method must specify the MIME type application/vnd.google-apps.shortcut. Apps should specify a file extension in the name property when inserting files with the API. For example, an operation to insert a JPEG file should specify something like "name": "cat.jpg" in the metadata. Subsequent GET requests include the read-only fileExtension property populated with the extension originally specified in the name property. When a Google Drive user requests to download a file, or when the file is downloaded through the sync client, Drive builds a full filename (with extension) based on the name. In cases where the extension is missing, Drive attempts to determine the extension based on the file's MIME type.
updateupdatefileIdremoveParents, includePermissionsForView, ocrLanguage, keepRevisionForever, includeLabels, enforceSingleParent, addParents, supportsTeamDrives, useContentAsIndexableText, supportsAllDrives Updates a file's metadata, content, or both. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed automatically, such as modifiedDate. This method supports patch semantics. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types: */* (Specify a valid MIME type, rather than the literal */* value. The literal */* is only used to indicate that any valid MIME type can be uploaded. For more information, see Google Workspace and Google Drive supported MIME types.) For more information on uploading files, see Upload file data.
deletedeletefileIdsupportsAllDrives, enforceSingleParent, supportsTeamDrivesPermanently deletes a file owned by the user without moving it to the trash. For more information, see Trash or delete files and folders. If the file belongs to a shared drive, the user must be an organizer on the parent folder. If the target is a folder, all descendants owned by the user are also deleted.
watchexecfileIdsupportsAllDrives, supportsTeamDrives, includePermissionsForView, acknowledgeAbuse, includeLabelsSubscribes to changes to a file. For more information, see Notifications for resource changes.
empty_trashexecenforceSingleParent, driveIdPermanently deletes all of the user's trashed files. For more information, see Trash or delete files and folders.
downloadexecfileIdmimeType, revisionIdDownloads the content of a file. For more information, see Download and export files. Operations are valid for 24 hours from the time of creation.
exportexecfileId, mimeTypeExports a Google Workspace document to the requested MIME type and returns exported byte content. For more information, see Download and export files. Note that the exported content is limited to 10 MB.
generate_idsexeccount, type, spaceGenerates a set of file IDs which can be provided in create or copy requests. For more information, see Create and manage files.
copyexecfileIdsupportsAllDrives, supportsTeamDrives, enforceSingleParent, includeLabels, ignoreDefaultVisibility, keepRevisionForever, ocrLanguage, includePermissionsForViewCreates a copy of a file and applies any requested updates with patch semantics. For more information, see Create and manage files.
modify_labelsexecfileIdModifies the set of labels applied to a file. For more information, see Set a label field on a file. Returns a list of the labels that were added or modified.
generate_cse_tokenexecfileId, parentGenerates a CSE token which can be used to create or update CSE files.

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
fileIdstring
mimeTypestring
acknowledgeAbuseboolean
addParentsstring
corporastring
corpusstring
countinteger (int32)
driveIdstring
enforceSingleParentboolean
fileIdstring
ignoreDefaultVisibilityboolean
includeItemsFromAllDrivesboolean
includeLabelsstring
includePermissionsForViewstring
includeTeamDriveItemsboolean
keepRevisionForeverboolean
mimeTypestring
ocrLanguagestring
orderBystring
pageSizeinteger (int32)
pageTokenstring
parentstring
qstring
removeParentsstring
revisionIdstring
spacestring
spacesstring
supportsAllDrivesboolean
supportsTeamDrivesboolean
teamDriveIdstring
typestring
useContentAsIndexableTextboolean

SELECT examples

Gets a file's metadata or content by ID. For more information, see Search for files and folders. If you provide the URL parameter alt=media, then the response includes the file contents in the response body. Downloading content with alt=media only works if the file is stored in Drive. To download Google Docs, Sheets, and Slides use files.export instead. For more information, see Download and export files.

SELECT
id,
name,
appProperties,
capabilities,
clientEncryptionDetails,
contentHints,
contentRestrictions,
copyRequiresWriterPermission,
createdTime,
description,
downloadRestrictions,
driveId,
explicitlyTrashed,
exportLinks,
fileExtension,
folderColorRgb,
fullFileExtension,
hasAugmentedPermissions,
hasThumbnail,
headRevisionId,
iconLink,
imageMediaMetadata,
inheritedPermissionsDisabled,
isAppAuthorized,
kind,
labelInfo,
lastModifyingUser,
linkShareMetadata,
md5Checksum,
mimeType,
modifiedByMe,
modifiedByMeTime,
modifiedTime,
originalFilename,
ownedByMe,
owners,
parents,
permissionIds,
permissions,
properties,
quotaBytesUsed,
resourceKey,
sha1Checksum,
sha256Checksum,
shared,
sharedWithMeTime,
sharingUser,
shortcutDetails,
size,
spaces,
starred,
teamDriveId,
thumbnailLink,
thumbnailVersion,
trashed,
trashedTime,
trashingUser,
version,
videoMediaMetadata,
viewedByMe,
viewedByMeTime,
viewersCanCopyContent,
webContentLink,
webViewLink,
writersCanShare
FROM googleworkspace.drivev3.files
WHERE fileId = '{{ fileId }}' -- required
AND acknowledgeAbuse = '{{ acknowledgeAbuse }}'
AND includeLabels = '{{ includeLabels }}'
AND includePermissionsForView = '{{ includePermissionsForView }}'
AND supportsTeamDrives = '{{ supportsTeamDrives }}'
AND supportsAllDrives = '{{ supportsAllDrives }}'
;

INSERT examples

Creates a file. For more information, see Create and manage files. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types: */* (Specify a valid MIME type, rather than the literal */* value. The literal */* is only used to indicate that any valid MIME type can be uploaded. For more information, see Google Workspace and Google Drive supported MIME types.) For more information on uploading files, see Upload file data. Apps creating shortcuts with the create method must specify the MIME type application/vnd.google-apps.shortcut. Apps should specify a file extension in the name property when inserting files with the API. For example, an operation to insert a JPEG file should specify something like "name": "cat.jpg" in the metadata. Subsequent GET requests include the read-only fileExtension property populated with the extension originally specified in the name property. When a Google Drive user requests to download a file, or when the file is downloaded through the sync client, Drive builds a full filename (with extension) based on the name. In cases where the extension is missing, Drive attempts to determine the extension based on the file's MIME type.

INSERT INTO googleworkspace.drivev3.files (
data__kind,
data__sharingUser,
data__thumbnailLink,
data__viewedByMeTime,
data__webViewLink,
data__modifiedByMeTime,
data__fullFileExtension,
data__trashingUser,
data__size,
data__trashed,
data__permissions,
data__videoMediaMetadata,
data__id,
data__isAppAuthorized,
data__contentRestrictions,
data__shared,
data__lastModifyingUser,
data__sha256Checksum,
data__iconLink,
data__properties,
data__driveId,
data__parents,
data__inheritedPermissionsDisabled,
data__starred,
data__version,
data__trashedTime,
data__contentHints,
data__quotaBytesUsed,
data__clientEncryptionDetails,
data__hasThumbnail,
data__copyRequiresWriterPermission,
data__headRevisionId,
data__sha1Checksum,
data__explicitlyTrashed,
data__createdTime,
data__permissionIds,
data__md5Checksum,
data__ownedByMe,
data__imageMediaMetadata,
data__hasAugmentedPermissions,
data__modifiedByMe,
data__labelInfo,
data__linkShareMetadata,
data__downloadRestrictions,
data__originalFilename,
data__teamDriveId,
data__sharedWithMeTime,
data__owners,
data__writersCanShare,
data__shortcutDetails,
data__description,
data__mimeType,
data__webContentLink,
data__capabilities,
data__viewedByMe,
data__spaces,
data__appProperties,
data__folderColorRgb,
data__thumbnailVersion,
data__resourceKey,
data__fileExtension,
data__viewersCanCopyContent,
data__modifiedTime,
data__name,
ocrLanguage,
includePermissionsForView,
ignoreDefaultVisibility,
keepRevisionForever,
enforceSingleParent,
includeLabels,
supportsAllDrives,
supportsTeamDrives,
useContentAsIndexableText
)
SELECT
'{{ kind }}',
'{{ sharingUser }}',
'{{ thumbnailLink }}',
'{{ viewedByMeTime }}',
'{{ webViewLink }}',
'{{ modifiedByMeTime }}',
'{{ fullFileExtension }}',
'{{ trashingUser }}',
'{{ size }}',
{{ trashed }},
'{{ permissions }}',
'{{ videoMediaMetadata }}',
'{{ id }}',
{{ isAppAuthorized }},
'{{ contentRestrictions }}',
{{ shared }},
'{{ lastModifyingUser }}',
'{{ sha256Checksum }}',
'{{ iconLink }}',
'{{ properties }}',
'{{ driveId }}',
'{{ parents }}',
{{ inheritedPermissionsDisabled }},
{{ starred }},
'{{ version }}',
'{{ trashedTime }}',
'{{ contentHints }}',
'{{ quotaBytesUsed }}',
'{{ clientEncryptionDetails }}',
{{ hasThumbnail }},
{{ copyRequiresWriterPermission }},
'{{ headRevisionId }}',
'{{ sha1Checksum }}',
{{ explicitlyTrashed }},
'{{ createdTime }}',
'{{ permissionIds }}',
'{{ md5Checksum }}',
{{ ownedByMe }},
'{{ imageMediaMetadata }}',
{{ hasAugmentedPermissions }},
{{ modifiedByMe }},
'{{ labelInfo }}',
'{{ linkShareMetadata }}',
'{{ downloadRestrictions }}',
'{{ originalFilename }}',
'{{ teamDriveId }}',
'{{ sharedWithMeTime }}',
'{{ owners }}',
{{ writersCanShare }},
'{{ shortcutDetails }}',
'{{ description }}',
'{{ mimeType }}',
'{{ webContentLink }}',
'{{ capabilities }}',
{{ viewedByMe }},
'{{ spaces }}',
'{{ appProperties }}',
'{{ folderColorRgb }}',
'{{ thumbnailVersion }}',
'{{ resourceKey }}',
'{{ fileExtension }}',
{{ viewersCanCopyContent }},
'{{ modifiedTime }}',
'{{ name }}',
'{{ ocrLanguage }}',
'{{ includePermissionsForView }}',
'{{ ignoreDefaultVisibility }}',
'{{ keepRevisionForever }}',
'{{ enforceSingleParent }}',
'{{ includeLabels }}',
'{{ supportsAllDrives }}',
'{{ supportsTeamDrives }}',
'{{ useContentAsIndexableText }}'
RETURNING
id,
name,
appProperties,
capabilities,
clientEncryptionDetails,
contentHints,
contentRestrictions,
copyRequiresWriterPermission,
createdTime,
description,
downloadRestrictions,
driveId,
explicitlyTrashed,
exportLinks,
fileExtension,
folderColorRgb,
fullFileExtension,
hasAugmentedPermissions,
hasThumbnail,
headRevisionId,
iconLink,
imageMediaMetadata,
inheritedPermissionsDisabled,
isAppAuthorized,
kind,
labelInfo,
lastModifyingUser,
linkShareMetadata,
md5Checksum,
mimeType,
modifiedByMe,
modifiedByMeTime,
modifiedTime,
originalFilename,
ownedByMe,
owners,
parents,
permissionIds,
permissions,
properties,
quotaBytesUsed,
resourceKey,
sha1Checksum,
sha256Checksum,
shared,
sharedWithMeTime,
sharingUser,
shortcutDetails,
size,
spaces,
starred,
teamDriveId,
thumbnailLink,
thumbnailVersion,
trashed,
trashedTime,
trashingUser,
version,
videoMediaMetadata,
viewedByMe,
viewedByMeTime,
viewersCanCopyContent,
webContentLink,
webViewLink,
writersCanShare
;

UPDATE examples

Updates a file's metadata, content, or both. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed automatically, such as modifiedDate. This method supports patch semantics. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types: */* (Specify a valid MIME type, rather than the literal */* value. The literal */* is only used to indicate that any valid MIME type can be uploaded. For more information, see Google Workspace and Google Drive supported MIME types.) For more information on uploading files, see Upload file data.

UPDATE googleworkspace.drivev3.files
SET
data__kind = '{{ kind }}',
data__sharingUser = '{{ sharingUser }}',
data__thumbnailLink = '{{ thumbnailLink }}',
data__viewedByMeTime = '{{ viewedByMeTime }}',
data__webViewLink = '{{ webViewLink }}',
data__modifiedByMeTime = '{{ modifiedByMeTime }}',
data__fullFileExtension = '{{ fullFileExtension }}',
data__trashingUser = '{{ trashingUser }}',
data__size = '{{ size }}',
data__trashed = {{ trashed }},
data__permissions = '{{ permissions }}',
data__videoMediaMetadata = '{{ videoMediaMetadata }}',
data__id = '{{ id }}',
data__isAppAuthorized = {{ isAppAuthorized }},
data__contentRestrictions = '{{ contentRestrictions }}',
data__shared = {{ shared }},
data__lastModifyingUser = '{{ lastModifyingUser }}',
data__sha256Checksum = '{{ sha256Checksum }}',
data__iconLink = '{{ iconLink }}',
data__properties = '{{ properties }}',
data__driveId = '{{ driveId }}',
data__parents = '{{ parents }}',
data__inheritedPermissionsDisabled = {{ inheritedPermissionsDisabled }},
data__starred = {{ starred }},
data__version = '{{ version }}',
data__trashedTime = '{{ trashedTime }}',
data__contentHints = '{{ contentHints }}',
data__quotaBytesUsed = '{{ quotaBytesUsed }}',
data__clientEncryptionDetails = '{{ clientEncryptionDetails }}',
data__hasThumbnail = {{ hasThumbnail }},
data__copyRequiresWriterPermission = {{ copyRequiresWriterPermission }},
data__headRevisionId = '{{ headRevisionId }}',
data__sha1Checksum = '{{ sha1Checksum }}',
data__explicitlyTrashed = {{ explicitlyTrashed }},
data__createdTime = '{{ createdTime }}',
data__permissionIds = '{{ permissionIds }}',
data__md5Checksum = '{{ md5Checksum }}',
data__ownedByMe = {{ ownedByMe }},
data__imageMediaMetadata = '{{ imageMediaMetadata }}',
data__hasAugmentedPermissions = {{ hasAugmentedPermissions }},
data__modifiedByMe = {{ modifiedByMe }},
data__labelInfo = '{{ labelInfo }}',
data__linkShareMetadata = '{{ linkShareMetadata }}',
data__downloadRestrictions = '{{ downloadRestrictions }}',
data__originalFilename = '{{ originalFilename }}',
data__teamDriveId = '{{ teamDriveId }}',
data__sharedWithMeTime = '{{ sharedWithMeTime }}',
data__owners = '{{ owners }}',
data__writersCanShare = {{ writersCanShare }},
data__shortcutDetails = '{{ shortcutDetails }}',
data__description = '{{ description }}',
data__mimeType = '{{ mimeType }}',
data__webContentLink = '{{ webContentLink }}',
data__capabilities = '{{ capabilities }}',
data__viewedByMe = {{ viewedByMe }},
data__spaces = '{{ spaces }}',
data__appProperties = '{{ appProperties }}',
data__folderColorRgb = '{{ folderColorRgb }}',
data__thumbnailVersion = '{{ thumbnailVersion }}',
data__resourceKey = '{{ resourceKey }}',
data__fileExtension = '{{ fileExtension }}',
data__viewersCanCopyContent = {{ viewersCanCopyContent }},
data__modifiedTime = '{{ modifiedTime }}',
data__name = '{{ name }}'
WHERE
fileId = '{{ fileId }}' --required
AND removeParents = '{{ removeParents}}'
AND includePermissionsForView = '{{ includePermissionsForView}}'
AND ocrLanguage = '{{ ocrLanguage}}'
AND keepRevisionForever = {{ keepRevisionForever}}
AND includeLabels = '{{ includeLabels}}'
AND enforceSingleParent = {{ enforceSingleParent}}
AND addParents = '{{ addParents}}'
AND supportsTeamDrives = {{ supportsTeamDrives}}
AND useContentAsIndexableText = {{ useContentAsIndexableText}}
AND supportsAllDrives = {{ supportsAllDrives}}
RETURNING
id,
name,
appProperties,
capabilities,
clientEncryptionDetails,
contentHints,
contentRestrictions,
copyRequiresWriterPermission,
createdTime,
description,
downloadRestrictions,
driveId,
explicitlyTrashed,
exportLinks,
fileExtension,
folderColorRgb,
fullFileExtension,
hasAugmentedPermissions,
hasThumbnail,
headRevisionId,
iconLink,
imageMediaMetadata,
inheritedPermissionsDisabled,
isAppAuthorized,
kind,
labelInfo,
lastModifyingUser,
linkShareMetadata,
md5Checksum,
mimeType,
modifiedByMe,
modifiedByMeTime,
modifiedTime,
originalFilename,
ownedByMe,
owners,
parents,
permissionIds,
permissions,
properties,
quotaBytesUsed,
resourceKey,
sha1Checksum,
sha256Checksum,
shared,
sharedWithMeTime,
sharingUser,
shortcutDetails,
size,
spaces,
starred,
teamDriveId,
thumbnailLink,
thumbnailVersion,
trashed,
trashedTime,
trashingUser,
version,
videoMediaMetadata,
viewedByMe,
viewedByMeTime,
viewersCanCopyContent,
webContentLink,
webViewLink,
writersCanShare;

DELETE examples

Permanently deletes a file owned by the user without moving it to the trash. For more information, see Trash or delete files and folders. If the file belongs to a shared drive, the user must be an organizer on the parent folder. If the target is a folder, all descendants owned by the user are also deleted.

DELETE FROM googleworkspace.drivev3.files
WHERE fileId = '{{ fileId }}' --required
AND supportsAllDrives = '{{ supportsAllDrives }}'
AND enforceSingleParent = '{{ enforceSingleParent }}'
AND supportsTeamDrives = '{{ supportsTeamDrives }}'
;

Lifecycle Methods

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

EXEC googleworkspace.drivev3.files.watch
@fileId='{{ fileId }}' --required,
@supportsAllDrives={{ supportsAllDrives }},
@supportsTeamDrives={{ supportsTeamDrives }},
@includePermissionsForView='{{ includePermissionsForView }}',
@acknowledgeAbuse={{ acknowledgeAbuse }},
@includeLabels='{{ includeLabels }}'
@@json=
'{
"token": "{{ token }}",
"params": "{{ params }}",
"address": "{{ address }}",
"payload": {{ payload }},
"resourceId": "{{ resourceId }}",
"id": "{{ id }}",
"kind": "{{ kind }}",
"type": "{{ type }}",
"resourceUri": "{{ resourceUri }}",
"expiration": "{{ expiration }}"
}'
;