For a list of methods for this resource, see the end of this page.
Resource representations
The metadata for a file.
{ "kind": "drive#file", "id": string, "name": string, "mimeType": string, "description": string, "starred": boolean, "trashed": boolean, "explicitlyTrashed": boolean, "trashingUser": { "kind": "drive#user", "displayName": string, "photoLink": string, "me": boolean, "permissionId": string, "emailAddress": string }, "trashedTime": datetime, "parents": [ string ], "properties": { (key): string }, "appProperties": { (key): string }, "spaces": [ string ], "version": long, "webContentLink": string, "webViewLink": string, "iconLink": string, "hasThumbnail": boolean, "thumbnailLink": string, "thumbnailVersion": long, "viewedByMe": boolean, "viewedByMeTime": datetime, "createdTime": datetime, "modifiedTime": datetime, "modifiedByMeTime": datetime, "modifiedByMe": boolean, "sharedWithMeTime": datetime, "sharingUser": { "kind": "drive#user", "displayName": string, "photoLink": string, "me": boolean, "permissionId": string, "emailAddress": string }, "owners": [ { "kind": "drive#user", "displayName": string, "photoLink": string, "me": boolean, "permissionId": string, "emailAddress": string } ], "teamDriveId": string, "driveId": string, "lastModifyingUser": { "kind": "drive#user", "displayName": string, "photoLink": string, "me": boolean, "permissionId": string, "emailAddress": string }, "shared": boolean, "ownedByMe": boolean, "capabilities": { "canAcceptOwnership": boolean, "canAddChildren": boolean, "canAddFolderFromAnotherDrive": boolean, "canAddMyDriveParent": boolean, "canChangeCopyRequiresWriterPermission": boolean, "canChangeSecurityUpdateEnabled": boolean, "canChangeViewersCanCopyContent": boolean, "canComment": boolean, "canCopy": boolean, "canDelete": boolean, "canDeleteChildren": boolean, "canDownload": boolean, "canEdit": boolean, "canListChildren": boolean, "canModifyContent": boolean, "canModifyContentRestriction": boolean, "canModifyLabels": boolean, "canMoveChildrenOutOfTeamDrive": boolean, "canMoveChildrenOutOfDrive": boolean, "canMoveChildrenWithinTeamDrive": boolean, "canMoveChildrenWithinDrive": boolean, "canMoveItemIntoTeamDrive": boolean, "canMoveItemOutOfTeamDrive": boolean, "canMoveItemOutOfDrive": boolean, "canMoveItemWithinTeamDrive": boolean, "canMoveItemWithinDrive": boolean, "canMoveTeamDriveItem": boolean, "canReadLabels": boolean, "canReadRevisions": boolean, "canReadTeamDrive": boolean, "canReadDrive": boolean, "canRemoveChildren": boolean, "canRemoveMyDriveParent": boolean, "canRename": boolean, "canShare": boolean, "canTrash": boolean, "canTrashChildren": boolean, "canUntrash": boolean }, "viewersCanCopyContent": boolean, "copyRequiresWriterPermission": boolean, "writersCanShare": boolean, "permissions": [ permissions Resource ], "permissionIds": [ string ], "hasAugmentedPermissions": boolean, "folderColorRgb": string, "originalFilename": string, "fullFileExtension": string, "fileExtension": string, "md5Checksum": string, "sha1Checksum": string, "sha256Checksum": string, "size": long, "quotaBytesUsed": long, "headRevisionId": string, "contentHints": { "thumbnail": { "image": bytes, "mimeType": string }, "indexableText": string }, "imageMediaMetadata": { "width": integer, "height": integer, "rotation": integer, "location": { "latitude": double, "longitude": double, "altitude": double }, "time": string, "cameraMake": string, "cameraModel": string, "exposureTime": float, "aperture": float, "flashUsed": boolean, "focalLength": float, "isoSpeed": integer, "meteringMode": string, "sensor": string, "exposureMode": string, "colorSpace": string, "whiteBalance": string, "exposureBias": float, "maxApertureValue": float, "subjectDistance": integer, "lens": string }, "videoMediaMetadata": { "width": integer, "height": integer, "durationMillis": long }, "isAppAuthorized": boolean, "exportLinks": { (key): string }, "shortcutDetails": { "targetId": string, "targetMimeType": string, "targetResourceKey": string }, "contentRestrictions": [ { "readOnly": boolean, "reason": string, "restrictingUser": { "kind": "drive#user", "displayName": string, "photoLink": string, "me": boolean, "permissionId": string, "emailAddress": string }, "restrictionTime": datetime, "type": string } ], "labelInfo": { "labels": [ { "kind": "drive#label", "id": string, "revisionId": string, "fields": { (key): { "kind": "drive#labelField", "id": string, "valueType": string, "dateString": [ date ], "integer": [ long ], "selection": [ string ], "text": [ string ], "user": [ { "kind": "drive#user", "displayName": string, "photoLink": string, "me": boolean, "permissionId": string, "emailAddress": string } ] } } } ] }, "resourceKey": string, "linkShareMetadata": { "securityUpdateEligible": boolean, "securityUpdateEnabled": boolean } }
Property name | Value | Description | Notes |
---|---|---|---|
kind |
string |
Identifies what kind of resource this is. Value: the fixed string "drive#file" . |
|
id |
string |
The ID of the file. | writable |
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. | writable |
mimeType |
string |
The MIME type of the file. Google Drive will attempt 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 will be imported if possible. The supported import formats are published in the About resource. |
writable |
description |
string |
A short description of the file. | writable |
starred |
boolean |
Whether the user has starred the file. | writable |
trashed |
boolean |
Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. | writable |
explicitlyTrashed |
boolean |
Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. | |
parents[] |
list |
The IDs of the parent folders which contain the file. If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests must use the |
writable |
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. |
writable |
properties.(key) |
string |
||
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. |
writable |
appProperties.(key) |
string |
||
spaces[] |
list |
The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. | |
version |
long |
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. | |
webContentLink |
string |
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 |
A link for opening the file in a relevant Google editor or viewer in a browser. | |
iconLink |
string |
A static, unauthenticated link to the file's icon. | |
thumbnailLink |
string |
A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. 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. |
|
viewedByMe |
boolean |
Whether the file has been viewed by this user. | |
viewedByMeTime |
datetime |
The last time the file was viewed by the user (RFC 3339 date-time). | writable |
createdTime |
datetime |
The time at which the file was created (RFC 3339 date-time). | writable |
modifiedTime |
datetime |
The last time the file was modified by anyone (RFC 3339 date-time). Note that setting modifiedTime will also update modifiedByMeTime for the user. |
writable |
modifiedByMeTime |
datetime |
The last time the file was modified by the user (RFC 3339 date-time). | |
sharedWithMeTime |
datetime |
The time at which the file was shared with the user, if applicable (RFC 3339 date-time). | |
sharingUser |
nested object |
The user who shared the file with the requesting user, if applicable. | |
sharingUser.kind |
string |
Identifies what kind of resource this is. Value: the fixed string "drive#user" . |
|
sharingUser.displayName |
string |
A plain text displayable name for this user. | |
sharingUser.photoLink |
string |
A link to the user's profile photo, if available. | |
sharingUser.me |
boolean |
Whether this user is the requesting user. | |
sharingUser.permissionId |
string |
The user's ID as visible in Permission resources. | |
sharingUser.emailAddress |
string |
The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. | |
owners[] |
list |
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. | |
owners[].kind |
string |
Identifies what kind of resource this is. Value: the fixed string "drive#user" . |
|
owners[].displayName |
string |
A plain text displayable name for this user. | |
owners[].photoLink |
string |
A link to the user's profile photo, if available. | |
owners[].me |
boolean |
Whether this user is the requesting user. | |
owners[].permissionId |
string |
The user's ID as visible in Permission resources. | |
owners[].emailAddress |
string |
The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. | |
lastModifyingUser |
nested object |
The last user to modify the file. | |
lastModifyingUser.kind |
string |
Identifies what kind of resource this is. Value: the fixed string "drive#user" . |
|
lastModifyingUser.displayName |
string |
A plain text displayable name for this user. | |
lastModifyingUser.photoLink |
string |
A link to the user's profile photo, if available. | |
lastModifyingUser.me |
boolean |
Whether this user is the requesting user. | |
lastModifyingUser.permissionId |
string |
The user's ID as visible in Permission resources. | |
lastModifyingUser.emailAddress |
string |
The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. | |
shared |
boolean |
Whether the file has been shared. Not populated for items in shared drives. | |
ownedByMe |
boolean |
Whether the user owns the file. Not populated for items in shared drives. | |
viewersCanCopyContent |
boolean |
Deprecated - use copyRequiresWriterPermission instead. |
|
writersCanShare |
boolean |
Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. |
writable |
permissions[] |
list |
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. | |
folderColorRgb |
string |
The color for a folder or 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 will be used instead. |
writable |
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. |
writable |
fullFileExtension |
string |
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 |
|
fileExtension |
string |
The final component of fullFileExtension . This is only available for files with binary content in Google Drive. |
|
md5Checksum |
string |
The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive. | |
size |
long |
The size of the file's content in bytes. This field is populated for files with binary content stored in Google Drive and for Docs Editors files; it is not populated for shortcuts or folders. | |
quotaBytesUsed |
long |
The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled. |
|
headRevisionId |
string |
The ID of the file's head revision. This is currently only available for files with binary content in Google Drive. | |
contentHints |
object |
Additional information about the content of the file. These fields are never populated in responses. | |
contentHints.thumbnail |
object |
A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail. | |
contentHints.thumbnail.image |
bytes |
The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5). | writable |
contentHints.thumbnail.mimeType |
string |
The MIME type of the thumbnail. | writable |
contentHints.indexableText |
string |
Text to be indexed for the file to improve fullText queries. This is limited to 128 KB in length and may contain HTML elements. For more information, see Manage file metadata. | writable |
imageMediaMetadata |
object |
Additional metadata about image media, if available. | |
imageMediaMetadata.width |
integer |
The width of the image in pixels. | |
imageMediaMetadata.height |
integer |
The height of the image in pixels. | |
imageMediaMetadata.rotation |
integer |
The number of clockwise 90 degree rotations applied from the image's original orientation. | |
imageMediaMetadata.location |
object |
Geographic location information stored in the image. | |
imageMediaMetadata.location.latitude |
double |
The latitude stored in the image. | |
imageMediaMetadata.location.longitude |
double |
The longitude stored in the image. | |
imageMediaMetadata.location.altitude |
double |
The altitude stored in the image. | |
imageMediaMetadata.time |
string |
The date and time the photo was taken (EXIF DateTime). | |
imageMediaMetadata.cameraMake |
string |
The make of the camera used to create the photo. | |
imageMediaMetadata.cameraModel |
string |
The model of the camera used to create the photo. | |
imageMediaMetadata.exposureTime |
float |
The length of the exposure, in seconds. | |
imageMediaMetadata.aperture |
float |
The aperture used to create the photo (f-number). | |
imageMediaMetadata.flashUsed |
boolean |
Whether a flash was used to create the photo. | |
imageMediaMetadata.focalLength |
float |
The focal length used to create the photo, in millimeters. | |
imageMediaMetadata.isoSpeed |
integer |
The ISO speed used to create the photo. | |
imageMediaMetadata.meteringMode |
string |
The metering mode used to create the photo. | |
imageMediaMetadata.sensor |
string |
The type of sensor used to create the photo. | |
imageMediaMetadata.exposureMode |
string |
The exposure mode used to create the photo. | |
imageMediaMetadata.colorSpace |
string |
The color space of the photo. | |
imageMediaMetadata.whiteBalance |
string |
The white balance mode used to create the photo. | |
imageMediaMetadata.exposureBias |
float |
The exposure bias of the photo (APEX value). | |
imageMediaMetadata.maxApertureValue |
float |
The smallest f-number of the lens at the focal length used to create the photo (APEX value). | |
imageMediaMetadata.subjectDistance |
integer |
The distance to the subject of the photo, in meters. | |
imageMediaMetadata.lens |
string |
The lens used to create the photo. | |
videoMediaMetadata |
object |
Additional metadata about video media. This may not be available immediately upon upload. | |
videoMediaMetadata.width |
integer |
The width of the video in pixels. | |
videoMediaMetadata.height |
integer |
The height of the video in pixels. | |
videoMediaMetadata.durationMillis |
long |
The duration of the video in milliseconds. | |
capabilities |
object |
Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. | |
capabilities.canEdit |
boolean |
Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent . |
|
capabilities.canComment |
boolean |
Whether the current user can comment on this file. | |
capabilities.canShare |
boolean |
Whether the current user can modify the sharing settings for this file. | |
capabilities.canCopy |
boolean |
Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. | |
capabilities.canReadRevisions |
boolean |
Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it isn't a folder, can be read. | |
isAppAuthorized |
boolean |
Whether the file was created or opened by the requesting app. | |
hasThumbnail |
boolean |
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. | |
thumbnailVersion |
long |
The thumbnail version for use in thumbnail cache invalidation. | |
modifiedByMe |
boolean |
Whether the file has been modified by this user. | |
trashingUser |
nested object |
If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. | |
trashingUser.kind |
string |
Identifies what kind of resource this is. Value: the fixed string "drive#user" . |
|
trashingUser.displayName |
string |
A plain text displayable name for this user. | |
trashingUser.photoLink |
string |
A link to the user's profile photo, if available. | |
trashingUser.me |
boolean |
Whether this user is the requesting user. | |
trashingUser.permissionId |
string |
The user's ID as visible in Permission resources. | |
trashingUser.emailAddress |
string |
The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. | |
trashedTime |
datetime |
The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives. | |
teamDriveId |
string |
Deprecated - use driveId instead. |
|
capabilities.canAddChildren |
boolean |
Whether the current user can add children to this folder. This is always false when the item is not a folder. | |
capabilities.canDelete |
boolean |
Whether the current user can delete this file. | |
capabilities.canDownload |
boolean |
Whether the current user can download this file. | |
capabilities.canListChildren |
boolean |
Whether the current user can list the children of this folder. This is always false when the item is not a folder. | |
capabilities.canMoveTeamDriveItem |
boolean |
Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. |
|
capabilities.canMoveItemIntoTeamDrive |
boolean |
Deprecated - use canMoveItemOutOfDrive instead. |
|
capabilities.canReadTeamDrive |
boolean |
Deprecated - use canReadDrive instead. |
|
capabilities.canRemoveChildren |
boolean |
Whether the current user can remove children from this folder. This is always false when the item is not a folder. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. |
|
capabilities.canRename |
boolean |
Whether the current user can rename this file. | |
capabilities.canTrash |
boolean |
Whether the current user can move this file to trash. | |
capabilities.canUntrash |
boolean |
Whether the current user can restore this file from trash. | |
hasAugmentedPermissions |
boolean |
Whether there are permissions directly on this file. This field is only populated for items in shared drives. | |
capabilities.canChangeViewersCanCopyContent |
boolean |
Deprecated | |
permissionIds[] |
list |
List of permission IDs for users with access to this file. | |
capabilities.canChangeCopyRequiresWriterPermission |
boolean |
Whether the current user can change the copyRequiresWriterPermission restriction of this file. |
|
copyRequiresWriterPermission |
boolean |
Whether the options to copy, print, or download this file, should be disabled for readers and commenters. | writable |
capabilities.canDeleteChildren |
boolean |
Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. | |
capabilities.canMoveChildrenOutOfTeamDrive |
boolean |
Deprecated - use canMoveChildrenOutOfDrive instead. |
|
capabilities.canMoveChildrenWithinTeamDrive |
boolean |
Deprecated - use canMoveChildrenWithinDrive instead. |
|
capabilities.canMoveItemOutOfTeamDrive |
boolean |
Deprecated - use canMoveItemOutOfDrive instead. |
|
capabilities.canMoveItemWithinTeamDrive |
boolean |
Deprecated - use canMoveItemWithinDrive instead. |
|
capabilities.canTrashChildren |
boolean |
Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. | |
exportLinks |
object |
Links for exporting Docs Editors files to specific formats. | |
exportLinks.(key) |
string |
A mapping from export format to URL | |
driveId |
string |
ID of the shared drive the file resides in. Only populated for items in shared drives. | |
capabilities.canMoveChildrenOutOfDrive |
boolean |
Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. | |
capabilities.canMoveChildrenWithinDrive |
boolean |
Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. | |
capabilities.canMoveItemOutOfDrive |
boolean |
Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. | |
capabilities.canMoveItemWithinDrive |
boolean |
Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. | |
capabilities.canReadDrive |
boolean |
Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. | |
capabilities.canModifyContent |
boolean |
Whether the current user can modify the content of this file. | |
capabilities.canAddMyDriveParent |
boolean |
Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. | |
capabilities.canRemoveMyDriveParent |
boolean |
Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. | |
shortcutDetails |
object |
Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut . |
|
shortcutDetails.targetId |
string |
The ID of the file that this shortcut points to. | writable |
shortcutDetails.targetMimeType |
string |
The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. | |
capabilities.canAddFolderFromAnotherDrive |
boolean |
Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. | |
capabilities.canModifyContentRestriction |
boolean |
Whether the current user can modify restrictions on content of this file. | |
contentRestrictions[] |
list |
Restrictions for accessing the content of the file. Only populated if such a restriction exists. | |
contentRestrictions[].readOnly |
boolean |
Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. | writable |
contentRestrictions[].reason |
string |
Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true . |
writable |
contentRestrictions[].restrictingUser |
nested object |
The user who set the content restriction. Only populated if readOnly is true. |
|
contentRestrictions[].restrictingUser.kind |
string |
Identifies what kind of resource this is. Value: the fixed string "drive#user" . |
|
contentRestrictions[].restrictingUser.displayName |
string |
A plain text displayable name for this user. | |
contentRestrictions[].restrictingUser.photoLink |
string |
A link to the user's profile photo, if available. | |
contentRestrictions[].restrictingUser.me |
boolean |
Whether this user is the requesting user. | |
contentRestrictions[].restrictingUser.permissionId |
string |
The user's ID as visible in Permission resources. | |
contentRestrictions[].restrictingUser.emailAddress |
string |
The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. | |
contentRestrictions[].restrictionTime |
datetime |
The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. |
|
contentRestrictions[].type |
string |
The type of the content restriction. Currently the only possible value is globalContentRestriction . |
|
capabilities.canChangeSecurityUpdateEnabled |
boolean |
Whether the current user can change the securityUpdateEnabled field on link share metadata. | |
shortcutDetails.targetResourceKey |
string |
The ResourceKey for the target file. | |
resourceKey |
string |
A key needed to access the item via a shared link. | |
linkShareMetadata |
object |
Contains details about the link URLs that clients are using to refer to this item. | |
linkShareMetadata.securityUpdateEligible |
boolean |
Whether the file is eligible for security update. | |
linkShareMetadata.securityUpdateEnabled |
boolean |
Whether the security update is enabled for this file. | |
capabilities.canAcceptOwnership |
boolean |
Whether the current user is the pending owner of the file. Not populated for shared drive files. | |
capabilities.canModifyLabels |
boolean |
Whether the current user can modify the labels on this file. | |
capabilities.canReadLabels |
boolean |
Whether the current user can read the labels on this file. | |
labelInfo |
object |
An overview of the labels on the file. | |
labelInfo.labels[] |
list |
The set of labels on the file as requested by the label IDs in the includeLabels parameter. By default, no labels are returned. |
|
labelInfo.labels[].kind |
string |
This is always drive#label | |
labelInfo.labels[].id |
string |
The ID of the label. | |
labelInfo.labels[].revisionId |
string |
The revision ID of the label. | |
labelInfo.labels[].fields |
object |
A map of the label's fields keyed by the field ID. | |
labelInfo.labels[].fields.(key) |
nested object |
||
labelInfo.labels[].fields.(key).kind |
string |
This is always drive#labelField. | |
labelInfo.labels[].fields.(key).id |
string |
The identifier of this field. | |
labelInfo.labels[].fields.(key).valueType |
string |
The field type. While new values may be supported in the future, the following are currently allowed:
|
|
labelInfo.labels[].fields.(key).dateString[] |
list |
Only present if valueType is dateString . RFC 3339 formatted date: YYYY-MM-DD. |
|
labelInfo.labels[].fields.(key).integer[] |
list |
Only present if valueType is integer . |
|
labelInfo.labels[].fields.(key).selection[] |
list |
Only present if valueType is selection . |
|
labelInfo.labels[].fields.(key).text[] |
list |
Only present if valueType is text . |
|
labelInfo.labels[].fields.(key).user[] |
list |
Only present if valueType is user . |
|
labelInfo.labels[].fields.(key).user[].kind |
string |
Identifies what kind of resource this is. Value: the fixed string "drive#user" . |
|
labelInfo.labels[].fields.(key).user[].displayName |
string |
A plain text displayable name for this user. | |
labelInfo.labels[].fields.(key).user[].photoLink |
string |
A link to the user's profile photo, if available. | |
labelInfo.labels[].fields.(key).user[].me |
boolean |
Whether this user is the requesting user. | |
labelInfo.labels[].fields.(key).user[].permissionId |
string |
The user's ID as visible in Permission resources. | |
labelInfo.labels[].fields.(key).user[].emailAddress |
string |
The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. | |
sha1Checksum |
string |
The SHA1 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it isn't populated for Docs Editors or shortcut files. | |
sha256Checksum |
string |
The SHA256 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it isn't populated for Docs Editors or shortcut files. |
Methods
- copy
- Creates a copy of a file and applies any requested updates with patch semantics. Folders cannot be copied.
- create
- Creates a file.
- 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. If the target is a folder, all descendants owned by the user are also deleted.
- emptyTrash
- Permanently deletes all of the user's trashed files.
- export
- Exports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB.
- generateIds
- Generates a set of file IDs which can be provided in create or copy requests.
- get
- Gets a file's metadata or content by ID.
- list
- Lists or searches files.
- 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 change automatically, such as modifiedDate. This method supports patch semantics.
- watch
- Subscribes to changes to a file. While you can establish a channel for changes to a file on a shared drive, a change to a shared drive file won't create a notification.
- listLabels
- Lists the labels on a file.
- modifyLabels
- Modifies the set of labels on a file.