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 is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and 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.
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 is not cleared if the new name does not 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 does not 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)
labelInfoobjectOutput only. An overview of the labels on the file.
lastModifyingUserobjectOutput only. The last user to modify the file. This field is only populated when the last modification was performed by a signed-in 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 is 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 is 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)
shortcutDetailsobjectShortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. Can only be set on files.create requests.
sizestring (int64)Output only. Size in bytes of blobs and first party 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, and other users cannot see files in the owner's trash.
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, supportsAllDrives, supportsTeamDrives, includePermissionsForView, includeLabels Gets a file's metadata or content by ID. 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 & export files.
listselectcorpora, corpus, driveId, includeItemsFromAllDrives, includeTeamDriveItems, orderBy, pageSize, pageToken, q, spaces, supportsAllDrives, supportsTeamDrives, teamDriveId, includePermissionsForView, includeLabels Lists the user's files. This method accepts the q parameter, which is a search query combining one or more search terms. For more information, see the Search for files & folders guide. Note: 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.
createinsertenforceSingleParent, ignoreDefaultVisibility, keepRevisionForever, ocrLanguage, supportsAllDrives, supportsTeamDrives, useContentAsIndexableText, includePermissionsForView, includeLabels Creates a new file. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types:*/* Note: 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 on uploading files, see Upload file data. Apps creating shortcuts with files.create 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 title 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 title. In cases where the extension is missing, Drive attempts to determine the extension based on the file's MIME type.
updateupdatefileIdaddParents, enforceSingleParent, keepRevisionForever, ocrLanguage, removeParents, supportsAllDrives, supportsTeamDrives, useContentAsIndexableText, includePermissionsForView, includeLabels Updates a file's metadata and/or content. 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:*/* Note: 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 on uploading files, see Upload file data.
deletedeletefileIdsupportsAllDrives, supportsTeamDrives, enforceSingleParentPermanently deletes a file owned by the user without moving it to the trash. 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.
copyexecfileIdenforceSingleParent, ignoreDefaultVisibility, keepRevisionForever, ocrLanguage, supportsAllDrives, supportsTeamDrives, includePermissionsForView, includeLabelsCreates a copy of a file and applies any requested updates with patch semantics.
empty_trashexecenforceSingleParent, driveIdPermanently deletes all of the user's trashed files.
exportexecfileId, mimeTypeExports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB.
generate_idsexeccount, space, typeGenerates a set of file IDs which can be provided in create or copy requests.
modify_labelsexecfileIdModifies the set of labels applied to a file. Returns a list of the labels that were added or modified.
watchexecfileIdsupportsAllDrives, supportsTeamDrives, acknowledgeAbuse, includePermissionsForView, includeLabelsSubscribes to changes to a file.
downloadexecfileIdmimeType, revisionIdDownloads content of a file. Operations are valid for 24 hours from the time of creation.

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
ignoreDefaultVisibilityboolean
includeItemsFromAllDrivesboolean
includeLabelsstring
includePermissionsForViewstring
includeTeamDriveItemsboolean
keepRevisionForeverboolean
mimeTypestring
ocrLanguagestring
orderBystring
pageSizeinteger (int32)
pageTokenstring
qstring
removeParentsstring
revisionIdstring
spacestring
spacesstring
supportsAllDrivesboolean
supportsTeamDrivesboolean
teamDriveIdstring
typestring
useContentAsIndexableTextboolean

SELECT examples

Gets a file's metadata or content by ID. 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 & export files.

SELECT
id,
name,
appProperties,
capabilities,
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 supportsAllDrives = '{{ supportsAllDrives }}'
AND supportsTeamDrives = '{{ supportsTeamDrives }}'
AND includePermissionsForView = '{{ includePermissionsForView }}'
AND includeLabels = '{{ includeLabels }}'
;

INSERT examples

Creates a new file. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types:*/* Note: 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 on uploading files, see Upload file data. Apps creating shortcuts with files.create 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 title 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 title. 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__driveId,
data__fileExtension,
data__copyRequiresWriterPermission,
data__md5Checksum,
data__contentHints,
data__writersCanShare,
data__viewedByMe,
data__mimeType,
data__parents,
data__thumbnailLink,
data__iconLink,
data__shared,
data__lastModifyingUser,
data__owners,
data__headRevisionId,
data__sharingUser,
data__webViewLink,
data__webContentLink,
data__size,
data__viewersCanCopyContent,
data__permissions,
data__hasThumbnail,
data__spaces,
data__folderColorRgb,
data__id,
data__name,
data__description,
data__starred,
data__trashed,
data__explicitlyTrashed,
data__createdTime,
data__modifiedTime,
data__modifiedByMeTime,
data__viewedByMeTime,
data__sharedWithMeTime,
data__quotaBytesUsed,
data__version,
data__originalFilename,
data__ownedByMe,
data__fullFileExtension,
data__properties,
data__appProperties,
data__isAppAuthorized,
data__teamDriveId,
data__capabilities,
data__hasAugmentedPermissions,
data__trashingUser,
data__thumbnailVersion,
data__trashedTime,
data__modifiedByMe,
data__permissionIds,
data__imageMediaMetadata,
data__videoMediaMetadata,
data__shortcutDetails,
data__contentRestrictions,
data__resourceKey,
data__linkShareMetadata,
data__labelInfo,
data__sha1Checksum,
data__sha256Checksum,
data__inheritedPermissionsDisabled,
data__downloadRestrictions,
enforceSingleParent,
ignoreDefaultVisibility,
keepRevisionForever,
ocrLanguage,
supportsAllDrives,
supportsTeamDrives,
useContentAsIndexableText,
includePermissionsForView,
includeLabels
)
SELECT
'{{ kind }}',
'{{ driveId }}',
'{{ fileExtension }}',
{{ copyRequiresWriterPermission }},
'{{ md5Checksum }}',
'{{ contentHints }}',
{{ writersCanShare }},
{{ viewedByMe }},
'{{ mimeType }}',
'{{ parents }}',
'{{ thumbnailLink }}',
'{{ iconLink }}',
{{ shared }},
'{{ lastModifyingUser }}',
'{{ owners }}',
'{{ headRevisionId }}',
'{{ sharingUser }}',
'{{ webViewLink }}',
'{{ webContentLink }}',
'{{ size }}',
{{ viewersCanCopyContent }},
'{{ permissions }}',
{{ hasThumbnail }},
'{{ spaces }}',
'{{ folderColorRgb }}',
'{{ id }}',
'{{ name }}',
'{{ description }}',
{{ starred }},
{{ trashed }},
{{ explicitlyTrashed }},
'{{ createdTime }}',
'{{ modifiedTime }}',
'{{ modifiedByMeTime }}',
'{{ viewedByMeTime }}',
'{{ sharedWithMeTime }}',
'{{ quotaBytesUsed }}',
'{{ version }}',
'{{ originalFilename }}',
{{ ownedByMe }},
'{{ fullFileExtension }}',
'{{ properties }}',
'{{ appProperties }}',
{{ isAppAuthorized }},
'{{ teamDriveId }}',
'{{ capabilities }}',
{{ hasAugmentedPermissions }},
'{{ trashingUser }}',
'{{ thumbnailVersion }}',
'{{ trashedTime }}',
{{ modifiedByMe }},
'{{ permissionIds }}',
'{{ imageMediaMetadata }}',
'{{ videoMediaMetadata }}',
'{{ shortcutDetails }}',
'{{ contentRestrictions }}',
'{{ resourceKey }}',
'{{ linkShareMetadata }}',
'{{ labelInfo }}',
'{{ sha1Checksum }}',
'{{ sha256Checksum }}',
{{ inheritedPermissionsDisabled }},
'{{ downloadRestrictions }}',
'{{ enforceSingleParent }}',
'{{ ignoreDefaultVisibility }}',
'{{ keepRevisionForever }}',
'{{ ocrLanguage }}',
'{{ supportsAllDrives }}',
'{{ supportsTeamDrives }}',
'{{ useContentAsIndexableText }}',
'{{ includePermissionsForView }}',
'{{ includeLabels }}'
RETURNING
id,
name,
appProperties,
capabilities,
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 and/or content. 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:*/* Note: 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 on uploading files, see Upload file data.

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

Lifecycle Methods

Creates a copy of a file and applies any requested updates with patch semantics.

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