files
Creates, updates, deletes, gets or lists a files
resource.
Overview
Name | files |
Type | Resource |
Id | googleworkspace.drivev3.files |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Name | Datatype | Description |
---|---|---|
id | string | The ID of the file. |
name | string | The 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. |
appProperties | object | A 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. |
capabilities | object | Output only. Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. |
contentHints | object | Additional information about the content of the file. These fields are never populated in responses. |
contentRestrictions | array | Restrictions for accessing the content of the file. Only populated if such a restriction exists. |
copyRequiresWriterPermission | boolean | Whether the options to copy, print, or download this file, should be disabled for readers and commenters. |
createdTime | string (date-time) | The time at which the file was created (RFC 3339 date-time). |
description | string | A short description of the file. |
downloadRestrictions | object | Download restrictions applied on the file. (id: DownloadRestrictionsMetadata) |
driveId | string | Output only. ID of the shared drive the file resides in. Only populated for items in shared drives. |
explicitlyTrashed | boolean | Output only. Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. |
exportLinks | object | Output only. Links for exporting Docs Editors files to specific formats. |
fileExtension | string | Output only. The final component of fullFileExtension . This is only available for files with binary content in Google Drive. |
folderColorRgb | string | The 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. |
fullFileExtension | string | Output 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. |
hasAugmentedPermissions | boolean | Output only. Whether there are permissions directly on this file. This field is only populated for items in shared drives. |
hasThumbnail | boolean | Output 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. |
headRevisionId | string | Output only. The ID of the file's head revision. This is currently only available for files with binary content in Google Drive. |
iconLink | string | Output only. A static, unauthenticated link to the file's icon. |
imageMediaMetadata | object | Output only. Additional metadata about image media, if available. |
inheritedPermissionsDisabled | boolean | Whether this file has inherited permissions disabled. Inherited permissions are enabled by default. |
isAppAuthorized | boolean | Output only. Whether the file was created or opened by the requesting app. |
kind | string | Output only. Identifies what kind of resource this is. Value: the fixed string "drive#file" . (default: drive#file) |
labelInfo | object | Output only. An overview of the labels on the file. |
lastModifyingUser | object | Output 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) |
linkShareMetadata | object | Contains details about the link URLs that clients are using to refer to this item. |
md5Checksum | string | Output only. The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive. |
mimeType | string | The 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. |
modifiedByMe | boolean | Output only. Whether the file has been modified by this user. |
modifiedByMeTime | string (date-time) | The last time the file was modified by the user (RFC 3339 date-time). |
modifiedTime | string (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. |
originalFilename | string | The 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. |
ownedByMe | boolean | Output only. Whether the user owns the file. Not populated for items in shared drives. |
owners | array | Output 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. |
parents | array | The 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. |
permissionIds | array | Output only. List of permission IDs for users with access to this file. |
permissions | array | Output 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. |
properties | object | A collection of arbitrary key-value pairs which are visible to all apps. Entries with null values are cleared in update and copy requests. |
quotaBytesUsed | string (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. |
resourceKey | string | Output only. A key needed to access the item via a shared link. |
sha1Checksum | string | Output 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. |
sha256Checksum | string | Output 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. |
shared | boolean | Output only. Whether the file has been shared. Not populated for items in shared drives. |
sharedWithMeTime | string (date-time) | The time at which the file was shared with the user, if applicable (RFC 3339 date-time). |
sharingUser | object | Information about a Drive user. (id: User) |
shortcutDetails | object | Shortcut 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. |
size | string (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. |
spaces | array | Output only. The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. |
starred | boolean | Whether the user has starred the file. |
teamDriveId | string | Deprecated: Output only. Use driveId instead. |
thumbnailLink | string | Output 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. |
thumbnailVersion | string (int64) | Output only. The thumbnail version for use in thumbnail cache invalidation. |
trashed | boolean | Whether 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. |
trashedTime | string (date-time) | The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives. |
trashingUser | object | Information about a Drive user. (id: User) |
version | string (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. |
videoMediaMetadata | object | Output only. Additional metadata about video media. This may not be available immediately upon upload. |
viewedByMe | boolean | Output only. Whether the file has been viewed by this user. |
viewedByMeTime | string (date-time) | The last time the file was viewed by the user (RFC 3339 date-time). |
viewersCanCopyContent | boolean | Deprecated: Use copyRequiresWriterPermission instead. |
webContentLink | string | Output 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. |
webViewLink | string | Output only. A link for opening the file in a relevant Google editor or viewer in a browser. |
writersCanShare | boolean | Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. |
Name | Datatype | Description |
---|---|---|
id | string | The ID of the file. |
name | string | The 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. |
appProperties | object | A 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. |
capabilities | object | Output only. Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. |
contentHints | object | Additional information about the content of the file. These fields are never populated in responses. |
contentRestrictions | array | Restrictions for accessing the content of the file. Only populated if such a restriction exists. |
copyRequiresWriterPermission | boolean | Whether the options to copy, print, or download this file, should be disabled for readers and commenters. |
createdTime | string (date-time) | The time at which the file was created (RFC 3339 date-time). |
description | string | A short description of the file. |
downloadRestrictions | object | Download restrictions applied on the file. (id: DownloadRestrictionsMetadata) |
driveId | string | Output only. ID of the shared drive the file resides in. Only populated for items in shared drives. |
explicitlyTrashed | boolean | Output only. Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. |
exportLinks | object | Output only. Links for exporting Docs Editors files to specific formats. |
fileExtension | string | Output only. The final component of fullFileExtension . This is only available for files with binary content in Google Drive. |
folderColorRgb | string | The 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. |
fullFileExtension | string | Output 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. |
hasAugmentedPermissions | boolean | Output only. Whether there are permissions directly on this file. This field is only populated for items in shared drives. |
hasThumbnail | boolean | Output 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. |
headRevisionId | string | Output only. The ID of the file's head revision. This is currently only available for files with binary content in Google Drive. |
iconLink | string | Output only. A static, unauthenticated link to the file's icon. |
imageMediaMetadata | object | Output only. Additional metadata about image media, if available. |
inheritedPermissionsDisabled | boolean | Whether this file has inherited permissions disabled. Inherited permissions are enabled by default. |
isAppAuthorized | boolean | Output only. Whether the file was created or opened by the requesting app. |
kind | string | Output only. Identifies what kind of resource this is. Value: the fixed string "drive#file" . (default: drive#file) |
labelInfo | object | Output only. An overview of the labels on the file. |
lastModifyingUser | object | Output 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) |
linkShareMetadata | object | Contains details about the link URLs that clients are using to refer to this item. |
md5Checksum | string | Output only. The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive. |
mimeType | string | The 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. |
modifiedByMe | boolean | Output only. Whether the file has been modified by this user. |
modifiedByMeTime | string (date-time) | The last time the file was modified by the user (RFC 3339 date-time). |
modifiedTime | string (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. |
originalFilename | string | The 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. |
ownedByMe | boolean | Output only. Whether the user owns the file. Not populated for items in shared drives. |
owners | array | Output 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. |
parents | array | The 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. |
permissionIds | array | Output only. List of permission IDs for users with access to this file. |
permissions | array | Output 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. |
properties | object | A collection of arbitrary key-value pairs which are visible to all apps. Entries with null values are cleared in update and copy requests. |
quotaBytesUsed | string (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. |
resourceKey | string | Output only. A key needed to access the item via a shared link. |
sha1Checksum | string | Output 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. |
sha256Checksum | string | Output 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. |
shared | boolean | Output only. Whether the file has been shared. Not populated for items in shared drives. |
sharedWithMeTime | string (date-time) | The time at which the file was shared with the user, if applicable (RFC 3339 date-time). |
sharingUser | object | Information about a Drive user. (id: User) |
shortcutDetails | object | Shortcut 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. |
size | string (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. |
spaces | array | Output only. The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. |
starred | boolean | Whether the user has starred the file. |
teamDriveId | string | Deprecated: Output only. Use driveId instead. |
thumbnailLink | string | Output 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. |
thumbnailVersion | string (int64) | Output only. The thumbnail version for use in thumbnail cache invalidation. |
trashed | boolean | Whether 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. |
trashedTime | string (date-time) | The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives. |
trashingUser | object | Information about a Drive user. (id: User) |
version | string (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. |
videoMediaMetadata | object | Output only. Additional metadata about video media. This may not be available immediately upon upload. |
viewedByMe | boolean | Output only. Whether the file has been viewed by this user. |
viewedByMeTime | string (date-time) | The last time the file was viewed by the user (RFC 3339 date-time). |
viewersCanCopyContent | boolean | Deprecated: Use copyRequiresWriterPermission instead. |
webContentLink | string | Output 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. |
webViewLink | string | Output only. A link for opening the file in a relevant Google editor or viewer in a browser. |
writersCanShare | boolean | Whether 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:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | fileId | acknowledgeAbuse , 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. |
list | select | corpora , 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. | |
create | insert | enforceSingleParent , 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. | |
update | update | fileId | addParents , 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. |
delete | delete | fileId | supportsAllDrives , supportsTeamDrives , enforceSingleParent | 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. |
copy | exec | fileId | enforceSingleParent , ignoreDefaultVisibility , keepRevisionForever , ocrLanguage , supportsAllDrives , supportsTeamDrives , includePermissionsForView , includeLabels | Creates a copy of a file and applies any requested updates with patch semantics. |
empty_trash | exec | enforceSingleParent , driveId | Permanently deletes all of the user's trashed files. | |
export | exec | fileId , mimeType | Exports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB. | |
generate_ids | exec | count , space , type | Generates a set of file IDs which can be provided in create or copy requests. | |
modify_labels | exec | fileId | Modifies the set of labels applied to a file. Returns a list of the labels that were added or modified. | |
watch | exec | fileId | supportsAllDrives , supportsTeamDrives , acknowledgeAbuse , includePermissionsForView , includeLabels | Subscribes to changes to a file. |
download | exec | fileId | mimeType , revisionId | Downloads 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.
Name | Datatype | Description |
---|---|---|
fileId | string | |
mimeType | string | |
acknowledgeAbuse | boolean | |
addParents | string | |
corpora | string | |
corpus | string | |
count | integer (int32) | |
driveId | string | |
enforceSingleParent | boolean | |
ignoreDefaultVisibility | boolean | |
includeItemsFromAllDrives | boolean | |
includeLabels | string | |
includePermissionsForView | string | |
includeTeamDriveItems | boolean | |
keepRevisionForever | boolean | |
mimeType | string | |
ocrLanguage | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
q | string | |
removeParents | string | |
revisionId | string | |
space | string | |
spaces | string | |
supportsAllDrives | boolean | |
supportsTeamDrives | boolean | |
teamDriveId | string | |
type | string | |
useContentAsIndexableText | boolean |
SELECT
examples
- get
- list
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 }}'
;
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.
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 corpora = '{{ corpora }}'
AND corpus = '{{ corpus }}'
AND driveId = '{{ driveId }}'
AND includeItemsFromAllDrives = '{{ includeItemsFromAllDrives }}'
AND includeTeamDriveItems = '{{ includeTeamDriveItems }}'
AND orderBy = '{{ orderBy }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND q = '{{ q }}'
AND spaces = '{{ spaces }}'
AND supportsAllDrives = '{{ supportsAllDrives }}'
AND supportsTeamDrives = '{{ supportsTeamDrives }}'
AND teamDriveId = '{{ teamDriveId }}'
AND includePermissionsForView = '{{ includePermissionsForView }}'
AND includeLabels = '{{ includeLabels }}'
;
INSERT
examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: files
props:
- name: kind
value: string
description: >
Output only. Identifies what kind of resource this is. Value: the fixed string `"drive#file"`.
default: drive#file
- name: driveId
value: string
description: >
Output only. ID of the shared drive the file resides in. Only populated for items in shared drives.
- name: fileExtension
value: string
description: >
Output only. The final component of `fullFileExtension`. This is only available for files with binary content in Google Drive.
- name: copyRequiresWriterPermission
value: boolean
description: >
Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
- name: md5Checksum
value: string
description: >
Output only. The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
- name: contentHints
value: object
description: >
Additional information about the content of the file. These fields are never populated in responses.
- name: writersCanShare
value: boolean
description: >
Whether users with only `writer` permission can modify the file's permissions. Not populated for items in shared drives.
- name: viewedByMe
value: boolean
description: >
Output only. Whether the file has been viewed by this user.
- name: mimeType
value: string
description: >
The 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.
- name: parents
value: array
description: >
The 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.
- name: thumbnailLink
value: string
description: >
Output 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)](https://developer.mozilla.org/en-US/docs/Web/HTTP/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.
- name: iconLink
value: string
description: >
Output only. A static, unauthenticated link to the file's icon.
- name: shared
value: boolean
description: >
Output only. Whether the file has been shared. Not populated for items in shared drives.
- name: lastModifyingUser
value: object
description: >
Output only. The last user to modify the file. This field is only populated when the last modification was performed by a signed-in user.
- name: owners
value: array
description: >
Output 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.
- name: headRevisionId
value: string
description: >
Output only. The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.
- name: sharingUser
value: object
description: >
Information about a Drive user.
- name: webViewLink
value: string
description: >
Output only. A link for opening the file in a relevant Google editor or viewer in a browser.
- name: webContentLink
value: string
description: >
Output 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.
- name: size
value: string
description: >
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.
- name: viewersCanCopyContent
value: boolean
description: >
Deprecated: Use `copyRequiresWriterPermission` instead.
- name: permissions
value: array
description: >
Output 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.
- name: hasThumbnail
value: boolean
description: >
Output 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.
- name: spaces
value: array
description: >
Output only. The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
- name: folderColorRgb
value: string
description: >
The 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.
- name: id
value: string
description: >
The ID of the file.
- name: name
value: string
description: >
The 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.
- name: description
value: string
description: >
A short description of the file.
- name: starred
value: boolean
description: >
Whether the user has starred the file.
- name: trashed
value: boolean
description: >
Whether 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.
- name: explicitlyTrashed
value: boolean
description: >
Output only. Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
- name: createdTime
value: string
description: >
The time at which the file was created (RFC 3339 date-time).
- name: modifiedTime
value: string
description: >
he last time the file was modified by anyone (RFC 3339 date-time). Note that setting modifiedTime will also update modifiedByMeTime for the user.
- name: modifiedByMeTime
value: string
description: >
The last time the file was modified by the user (RFC 3339 date-time).
- name: viewedByMeTime
value: string
description: >
The last time the file was viewed by the user (RFC 3339 date-time).
- name: sharedWithMeTime
value: string
description: >
The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
- name: quotaBytesUsed
value: string
description: >
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.
- name: version
value: string
description: >
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.
- name: originalFilename
value: string
description: >
The 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.
- name: ownedByMe
value: boolean
description: >
Output only. Whether the user owns the file. Not populated for items in shared drives.
- name: fullFileExtension
value: string
description: >
Output 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.
- name: properties
value: object
description: >
A collection of arbitrary key-value pairs which are visible to all apps.
Entries with null values are cleared in update and copy requests.
- name: appProperties
value: object
description: >
A 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.
- name: isAppAuthorized
value: boolean
description: >
Output only. Whether the file was created or opened by the requesting app.
- name: teamDriveId
value: string
description: >
Deprecated: Output only. Use `driveId` instead.
- name: capabilities
value: object
description: >
Output only. Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
- name: hasAugmentedPermissions
value: boolean
description: >
Output only. Whether there are permissions directly on this file. This field is only populated for items in shared drives.
- name: trashingUser
value: object
description: >
Information about a Drive user.
- name: thumbnailVersion
value: string
description: >
Output only. The thumbnail version for use in thumbnail cache invalidation.
- name: trashedTime
value: string
description: >
The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
- name: modifiedByMe
value: boolean
description: >
Output only. Whether the file has been modified by this user.
- name: permissionIds
value: array
description: >
Output only. List of permission IDs for users with access to this file.
- name: imageMediaMetadata
value: object
description: >
Output only. Additional metadata about image media, if available.
- name: videoMediaMetadata
value: object
description: >
Output only. Additional metadata about video media. This may not be available immediately upon upload.
- name: shortcutDetails
value: object
description: >
Shortcut 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.
- name: contentRestrictions
value: array
description: >
Restrictions for accessing the content of the file. Only populated if such a restriction exists.
- name: resourceKey
value: string
description: >
Output only. A key needed to access the item via a shared link.
- name: linkShareMetadata
value: object
description: >
Contains details about the link URLs that clients are using to refer to this item.
- name: labelInfo
value: object
description: >
Output only. An overview of the labels on the file.
- name: sha1Checksum
value: string
description: >
Output 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.
- name: sha256Checksum
value: string
description: >
Output 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.
- name: inheritedPermissionsDisabled
value: boolean
description: >
Whether this file has inherited permissions disabled. Inherited permissions are enabled by default.
- name: downloadRestrictions
value: object
description: >
Download restrictions applied on the file.
- name: enforceSingleParent
value: boolean
- name: ignoreDefaultVisibility
value: boolean
- name: keepRevisionForever
value: boolean
- name: ocrLanguage
value: string
- name: supportsAllDrives
value: boolean
- name: supportsTeamDrives
value: boolean
- name: useContentAsIndexableText
value: boolean
- name: includePermissionsForView
value: string
- name: includeLabels
value: string
UPDATE
examples
- update
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
- delete
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
- copy
- empty_trash
- export
- generate_ids
- modify_labels
- watch
- download
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 }}"
}'
;
Permanently deletes all of the user's trashed files.
EXEC googleworkspace.drivev3.files.empty_trash
@enforceSingleParent={{ enforceSingleParent }},
@driveId='{{ driveId }}'
;
Exports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB.
EXEC googleworkspace.drivev3.files.export
@fileId='{{ fileId }}' --required,
@mimeType='{{ mimeType }}' --required
;
Generates a set of file IDs which can be provided in create or copy requests.
EXEC googleworkspace.drivev3.files.generate_ids
@count='{{ count }}',
@space='{{ space }}',
@type='{{ type }}'
;
Modifies the set of labels applied to a file. Returns a list of the labels that were added or modified.
EXEC googleworkspace.drivev3.files.modify_labels
@fileId='{{ fileId }}' --required
@@json=
'{
"labelModifications": "{{ labelModifications }}",
"kind": "{{ kind }}"
}'
;
Subscribes to changes to a file.
EXEC googleworkspace.drivev3.files.watch
@fileId='{{ fileId }}' --required,
@supportsAllDrives={{ supportsAllDrives }},
@supportsTeamDrives={{ supportsTeamDrives }},
@acknowledgeAbuse={{ acknowledgeAbuse }},
@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 }}"
}'
;
Downloads content of a file. Operations are valid for 24 hours from the time of creation.
EXEC googleworkspace.drivev3.files.download
@fileId='{{ fileId }}' --required,
@mimeType='{{ mimeType }}',
@revisionId='{{ revisionId }}'
;