Regen docs (#364)
diff --git a/docs/dyn/drive_v2.files.html b/docs/dyn/drive_v2.files.html
index 834122b..35b29bd 100644
--- a/docs/dyn/drive_v2.files.html
+++ b/docs/dyn/drive_v2.files.html
@@ -75,11 +75,11 @@
<h1><a href="drive_v2.html">Drive API</a> . <a href="drive_v2.files.html">files</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
- <code><a href="#copy">copy(fileId, body, pinned=None, convert=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None)</a></code></p>
+ <code><a href="#copy">copy(fileId, body, pinned=None, convert=None, supportsTeamDrives=None, ocrLanguage=None, visibility=None, ocr=None, timedTextTrackName=None, timedTextLanguage=None)</a></code></p>
<p class="firstline">Creates a copy of the specified file.</p>
<p class="toc_element">
- <code><a href="#delete">delete(fileId)</a></code></p>
-<p class="firstline">Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file.</p>
+ <code><a href="#delete">delete(fileId, supportsTeamDrives=None)</a></code></p>
+<p class="firstline">Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file or be an organizer on the parent for Team Drive files.</p>
<p class="toc_element">
<code><a href="#emptyTrash">emptyTrash()</a></code></p>
<p class="firstline">Permanently deletes all of the user's trashed files.</p>
@@ -93,44 +93,44 @@
<code><a href="#generateIds">generateIds(space=None, maxResults=None)</a></code></p>
<p class="firstline">Generates a set of file IDs which can be provided in insert requests.</p>
<p class="toc_element">
- <code><a href="#get">get(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
+ <code><a href="#get">get(fileId, projection=None, revisionId=None, supportsTeamDrives=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
<p class="firstline">Gets a file's metadata by ID.</p>
<p class="toc_element">
- <code><a href="#get_media">get_media(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
+ <code><a href="#get_media">get_media(fileId, projection=None, revisionId=None, supportsTeamDrives=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
<p class="firstline">Gets a file's metadata by ID.</p>
<p class="toc_element">
- <code><a href="#insert">insert(body=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, visibility=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, media_mime_type=None, timedTextLanguage=None)</a></code></p>
+ <code><a href="#insert">insert(body=None, supportsTeamDrives=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, visibility=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, media_mime_type=None, timedTextLanguage=None)</a></code></p>
<p class="firstline">Insert a new file.</p>
<p class="toc_element">
- <code><a href="#list">list(orderBy=None, q=None, projection=None, pageToken=None, maxResults=None, spaces=None, corpus=None)</a></code></p>
+ <code><a href="#list">list(orderBy=None, projection=None, supportsTeamDrives=None, spaces=None, pageToken=None, corpus=None, maxResults=None, teamDriveId=None, includeTeamDriveItems=None, corpora=None, q=None)</a></code></p>
<p class="firstline">Lists the user's files.</p>
<p class="toc_element">
<code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<p class="toc_element">
- <code><a href="#patch">patch(fileId, body, newRevision=None, modifiedDateBehavior=None, pinned=None, ocrLanguage=None, ocr=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
+ <code><a href="#patch">patch(fileId, body, supportsTeamDrives=None, newRevision=None, modifiedDateBehavior=None, pinned=None, ocrLanguage=None, ocr=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
<p class="firstline">Updates file metadata and/or content. This method supports patch semantics.</p>
<p class="toc_element">
- <code><a href="#touch">touch(fileId)</a></code></p>
+ <code><a href="#touch">touch(fileId, supportsTeamDrives=None)</a></code></p>
<p class="firstline">Set the file's updated time to the current server time.</p>
<p class="toc_element">
- <code><a href="#trash">trash(fileId)</a></code></p>
-<p class="firstline">Moves a file to the trash. The currently authenticated user must own the file.</p>
+ <code><a href="#trash">trash(fileId, supportsTeamDrives=None)</a></code></p>
+<p class="firstline">Moves a file to the trash. The currently authenticated user must own the file or be an organizer on the parent for Team Drive files.</p>
<p class="toc_element">
- <code><a href="#untrash">untrash(fileId)</a></code></p>
+ <code><a href="#untrash">untrash(fileId, supportsTeamDrives=None)</a></code></p>
<p class="firstline">Restores a file from the trash.</p>
<p class="toc_element">
- <code><a href="#update">update(fileId, body=None, newRevision=None, modifiedDateBehavior=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, media_mime_type=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
+ <code><a href="#update">update(fileId, body=None, supportsTeamDrives=None, newRevision=None, modifiedDateBehavior=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, media_mime_type=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
<p class="firstline">Updates file metadata and/or content.</p>
<p class="toc_element">
- <code><a href="#watch">watch(fileId, body, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
+ <code><a href="#watch">watch(fileId, body, projection=None, revisionId=None, supportsTeamDrives=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
<p class="firstline">Subscribe to changes on a file</p>
<p class="toc_element">
- <code><a href="#watch_media">watch_media(fileId, body, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
+ <code><a href="#watch_media">watch_media(fileId, body, projection=None, revisionId=None, supportsTeamDrives=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
<p class="firstline">Subscribe to changes on a file</p>
<h3>Method Details</h3>
<div class="method">
- <code class="details" id="copy">copy(fileId, body, pinned=None, convert=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None)</code>
+ <code class="details" id="copy">copy(fileId, body, pinned=None, convert=None, supportsTeamDrives=None, ocrLanguage=None, visibility=None, ocr=None, timedTextTrackName=None, timedTextLanguage=None)</code>
<pre>Creates a copy of the specified file.
Args:
@@ -141,6 +141,7 @@
{ # The metadata for a file.
"hasThumbnail": True or False, # Whether this file has a thumbnail.
"lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
+ "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files.
"version": "A String", # 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 requesting user.
"appDataContents": True or False, # Whether this file is in the Application Data folder.
"thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
@@ -155,12 +156,12 @@
"indexableText": { # Indexable text attributes for the file (can only be written)
"text": "A String", # The text to be indexed for this file.
},
- "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
+ "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
"explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
"isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
"lastModifyingUserName": "A String", # Name of the last user to modify this file.
- "writersCanShare": True or False, # Whether writers can share the document with other users.
- "owners": [ # The owner(s) of this file.
+ "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for Team Drive files.
+ "owners": [ # The owner(s) of this file. Not populated for Team Drive files.
{ # Information about a Drive user.
"picture": { # The user's profile picture.
"url": "A String", # A URL that points to a profile picture of this user.
@@ -172,7 +173,7 @@
"emailAddress": "A String", # The email address of the user.
},
],
- "ownedByMe": True or False, # Whether the file is owned by the current user.
+ "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for Team Drive files.
"id": "A String", # The ID of the file.
"sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
"picture": { # The user's profile picture.
@@ -184,6 +185,16 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
+ "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
+ "picture": { # The user's profile picture.
+ "url": "A String", # A URL that points to a profile picture of this user.
+ },
+ "kind": "drive#user", # This is always drive#user.
+ "displayName": "A String", # A plain text displayable name for this user.
+ "permissionId": "A String", # The user's ID as visible in the permissions collection.
+ "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
+ "emailAddress": "A String", # The email address of the user.
+ },
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
"lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
"picture": { # The user's profile picture.
@@ -195,12 +206,30 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
- "copyable": True or False, # Whether the file can be copied by the current user.
- "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
+ "copyable": True or False, # Whether the file can be copied by the current user. Deprecated: use capabilities/canCopy.
+ "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files.
"markedViewedByMeDate": "A String", # Deprecated.
- "ownerNames": [ # Name(s) of the owner(s) of this file.
+ "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for Team Drive files.
"A String",
],
+ "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
+ "canTrash": True or False, # Whether the file can be trashed by the current user.
+ "canCopy": True or False, # Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
+ "canShare": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "canDelete": True or False, # Whether the file can be deleted by the current user.
+ "canMoveTeamDriveItem": True or False, # Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
+ "canRename": True or False, # Whether the file can be renamed by the current user.
+ "canListChildren": True or False, # Whether the current user can list the children of this folder. This is always false when the item is not a folder.
+ "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
+ "canDownload": True or False, # Whether the file can be downloaded by the current user.
+ "canComment": True or False, # Whether the current user can comment on the file.
+ "canRemoveChildren": True or False, # Whether the current user can remove children from this folder. This is always false when the item is not a folder.
+ "canReadTeamDrive": True or False, # Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
+ "canAddChildren": True or False, # Whether the current user can add children to this folder. This is always false when the item is not a folder.
+ "canEdit": True or False, # Whether the file can be edited by the current user.
+ "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
+ },
"sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
"webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
"etag": "A String", # ETag of the file.
@@ -217,20 +246,41 @@
"exportLinks": { # Links for exporting Google Docs to specific formats.
"a_key": "A String", # A mapping from export format to URL
},
- "shared": True or False, # Whether the file has been shared.
- "permissions": [ # The list of permissions for users with access to this file.
+ "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
+ "permissions": [ # The list of permissions for users with access to this file. Not populated for Team Drive files.
{ # A permission for a file.
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -239,7 +289,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -250,7 +300,7 @@
"openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
"a_key": "A String",
},
- "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. Deprecated: use capabilities/canReadRevisions.
"imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
"exposureBias": 3.14, # The exposure bias of the photo (APEX value).
"exposureTime": 3.14, # The length of the exposure, in seconds.
@@ -285,12 +335,13 @@
"durationMillis": "A String", # The duration of the video in milliseconds.
"height": 42, # The height of the video in pixels.
},
- "editable": True or False, # Whether the file can be edited by the current user.
+ "editable": True or False, # Whether the file can be edited by the current user. Deprecated: use capabilities/canEdit.
"kind": "drive#file", # The type of file. This is always drive#file.
- "canComment": True or False, # Whether the current user can comment on the file.
+ "canComment": True or False, # Whether the current user can comment on the file. Deprecated: use capabilities/canComment.
"quotaBytesUsed": "A String", # The number of quota bytes used by this file.
"fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
+ "teamDriveId": "A String", # ID of the Team Drive the file resides in.
"properties": [ # The list of properties.
{ # A key-value pair attached to a file that is either public or private to an application.
# The following limits apply to file properties:
@@ -322,14 +373,35 @@
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -338,7 +410,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -347,9 +419,10 @@
"spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
"A String",
],
- "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "shareable": True or False, # Whether the file's sharing settings can be modified by the current user. Deprecated: use capabilities/canShare.
"originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
"fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
+ "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
"headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"selfLink": "A String", # A link back to this file.
"modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
@@ -357,14 +430,15 @@
pinned: boolean, Whether to pin the head revision of the new copy. A file can have a maximum of 200 pinned revisions.
convert: boolean, Whether to convert this file to the corresponding Google Docs format.
+ supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
+ ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
visibility: string, The visibility of the new file. This parameter is only relevant when the source is not a native Google Doc and convert=false.
Allowed values
DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
PRIVATE - The new file will be visible to only the owner.
- ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
- timedTextLanguage: string, The language of the timed text.
timedTextTrackName: string, The timed text track name.
+ timedTextLanguage: string, The language of the timed text.
Returns:
An object of the form:
@@ -372,6 +446,7 @@
{ # The metadata for a file.
"hasThumbnail": True or False, # Whether this file has a thumbnail.
"lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
+ "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files.
"version": "A String", # 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 requesting user.
"appDataContents": True or False, # Whether this file is in the Application Data folder.
"thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
@@ -386,12 +461,12 @@
"indexableText": { # Indexable text attributes for the file (can only be written)
"text": "A String", # The text to be indexed for this file.
},
- "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
+ "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
"explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
"isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
"lastModifyingUserName": "A String", # Name of the last user to modify this file.
- "writersCanShare": True or False, # Whether writers can share the document with other users.
- "owners": [ # The owner(s) of this file.
+ "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for Team Drive files.
+ "owners": [ # The owner(s) of this file. Not populated for Team Drive files.
{ # Information about a Drive user.
"picture": { # The user's profile picture.
"url": "A String", # A URL that points to a profile picture of this user.
@@ -403,7 +478,7 @@
"emailAddress": "A String", # The email address of the user.
},
],
- "ownedByMe": True or False, # Whether the file is owned by the current user.
+ "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for Team Drive files.
"id": "A String", # The ID of the file.
"sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
"picture": { # The user's profile picture.
@@ -415,6 +490,16 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
+ "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
+ "picture": { # The user's profile picture.
+ "url": "A String", # A URL that points to a profile picture of this user.
+ },
+ "kind": "drive#user", # This is always drive#user.
+ "displayName": "A String", # A plain text displayable name for this user.
+ "permissionId": "A String", # The user's ID as visible in the permissions collection.
+ "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
+ "emailAddress": "A String", # The email address of the user.
+ },
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
"lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
"picture": { # The user's profile picture.
@@ -426,12 +511,30 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
- "copyable": True or False, # Whether the file can be copied by the current user.
- "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
+ "copyable": True or False, # Whether the file can be copied by the current user. Deprecated: use capabilities/canCopy.
+ "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files.
"markedViewedByMeDate": "A String", # Deprecated.
- "ownerNames": [ # Name(s) of the owner(s) of this file.
+ "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for Team Drive files.
"A String",
],
+ "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
+ "canTrash": True or False, # Whether the file can be trashed by the current user.
+ "canCopy": True or False, # Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
+ "canShare": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "canDelete": True or False, # Whether the file can be deleted by the current user.
+ "canMoveTeamDriveItem": True or False, # Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
+ "canRename": True or False, # Whether the file can be renamed by the current user.
+ "canListChildren": True or False, # Whether the current user can list the children of this folder. This is always false when the item is not a folder.
+ "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
+ "canDownload": True or False, # Whether the file can be downloaded by the current user.
+ "canComment": True or False, # Whether the current user can comment on the file.
+ "canRemoveChildren": True or False, # Whether the current user can remove children from this folder. This is always false when the item is not a folder.
+ "canReadTeamDrive": True or False, # Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
+ "canAddChildren": True or False, # Whether the current user can add children to this folder. This is always false when the item is not a folder.
+ "canEdit": True or False, # Whether the file can be edited by the current user.
+ "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
+ },
"sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
"webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
"etag": "A String", # ETag of the file.
@@ -448,20 +551,41 @@
"exportLinks": { # Links for exporting Google Docs to specific formats.
"a_key": "A String", # A mapping from export format to URL
},
- "shared": True or False, # Whether the file has been shared.
- "permissions": [ # The list of permissions for users with access to this file.
+ "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
+ "permissions": [ # The list of permissions for users with access to this file. Not populated for Team Drive files.
{ # A permission for a file.
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -470,7 +594,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -481,7 +605,7 @@
"openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
"a_key": "A String",
},
- "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. Deprecated: use capabilities/canReadRevisions.
"imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
"exposureBias": 3.14, # The exposure bias of the photo (APEX value).
"exposureTime": 3.14, # The length of the exposure, in seconds.
@@ -516,12 +640,13 @@
"durationMillis": "A String", # The duration of the video in milliseconds.
"height": 42, # The height of the video in pixels.
},
- "editable": True or False, # Whether the file can be edited by the current user.
+ "editable": True or False, # Whether the file can be edited by the current user. Deprecated: use capabilities/canEdit.
"kind": "drive#file", # The type of file. This is always drive#file.
- "canComment": True or False, # Whether the current user can comment on the file.
+ "canComment": True or False, # Whether the current user can comment on the file. Deprecated: use capabilities/canComment.
"quotaBytesUsed": "A String", # The number of quota bytes used by this file.
"fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
+ "teamDriveId": "A String", # ID of the Team Drive the file resides in.
"properties": [ # The list of properties.
{ # A key-value pair attached to a file that is either public or private to an application.
# The following limits apply to file properties:
@@ -553,14 +678,35 @@
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -569,7 +715,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -578,9 +724,10 @@
"spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
"A String",
],
- "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "shareable": True or False, # Whether the file's sharing settings can be modified by the current user. Deprecated: use capabilities/canShare.
"originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
"fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
+ "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
"headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"selfLink": "A String", # A link back to this file.
"modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
@@ -588,11 +735,12 @@
</div>
<div class="method">
- <code class="details" id="delete">delete(fileId)</code>
- <pre>Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file.
+ <code class="details" id="delete">delete(fileId, supportsTeamDrives=None)</code>
+ <pre>Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file or be an organizer on the parent for Team Drive files.
Args:
fileId: string, The ID of the file to delete. (required)
+ supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
</pre>
</div>
@@ -645,7 +793,7 @@
</div>
<div class="method">
- <code class="details" id="get">get(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
+ <code class="details" id="get">get(fileId, projection=None, revisionId=None, supportsTeamDrives=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
<pre>Gets a file's metadata by ID.
Args:
@@ -655,6 +803,7 @@
BASIC - Deprecated
FULL - Deprecated
revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
+ supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.
@@ -664,6 +813,7 @@
{ # The metadata for a file.
"hasThumbnail": True or False, # Whether this file has a thumbnail.
"lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
+ "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files.
"version": "A String", # 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 requesting user.
"appDataContents": True or False, # Whether this file is in the Application Data folder.
"thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
@@ -678,12 +828,12 @@
"indexableText": { # Indexable text attributes for the file (can only be written)
"text": "A String", # The text to be indexed for this file.
},
- "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
+ "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
"explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
"isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
"lastModifyingUserName": "A String", # Name of the last user to modify this file.
- "writersCanShare": True or False, # Whether writers can share the document with other users.
- "owners": [ # The owner(s) of this file.
+ "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for Team Drive files.
+ "owners": [ # The owner(s) of this file. Not populated for Team Drive files.
{ # Information about a Drive user.
"picture": { # The user's profile picture.
"url": "A String", # A URL that points to a profile picture of this user.
@@ -695,7 +845,7 @@
"emailAddress": "A String", # The email address of the user.
},
],
- "ownedByMe": True or False, # Whether the file is owned by the current user.
+ "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for Team Drive files.
"id": "A String", # The ID of the file.
"sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
"picture": { # The user's profile picture.
@@ -707,6 +857,16 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
+ "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
+ "picture": { # The user's profile picture.
+ "url": "A String", # A URL that points to a profile picture of this user.
+ },
+ "kind": "drive#user", # This is always drive#user.
+ "displayName": "A String", # A plain text displayable name for this user.
+ "permissionId": "A String", # The user's ID as visible in the permissions collection.
+ "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
+ "emailAddress": "A String", # The email address of the user.
+ },
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
"lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
"picture": { # The user's profile picture.
@@ -718,12 +878,30 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
- "copyable": True or False, # Whether the file can be copied by the current user.
- "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
+ "copyable": True or False, # Whether the file can be copied by the current user. Deprecated: use capabilities/canCopy.
+ "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files.
"markedViewedByMeDate": "A String", # Deprecated.
- "ownerNames": [ # Name(s) of the owner(s) of this file.
+ "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for Team Drive files.
"A String",
],
+ "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
+ "canTrash": True or False, # Whether the file can be trashed by the current user.
+ "canCopy": True or False, # Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
+ "canShare": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "canDelete": True or False, # Whether the file can be deleted by the current user.
+ "canMoveTeamDriveItem": True or False, # Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
+ "canRename": True or False, # Whether the file can be renamed by the current user.
+ "canListChildren": True or False, # Whether the current user can list the children of this folder. This is always false when the item is not a folder.
+ "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
+ "canDownload": True or False, # Whether the file can be downloaded by the current user.
+ "canComment": True or False, # Whether the current user can comment on the file.
+ "canRemoveChildren": True or False, # Whether the current user can remove children from this folder. This is always false when the item is not a folder.
+ "canReadTeamDrive": True or False, # Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
+ "canAddChildren": True or False, # Whether the current user can add children to this folder. This is always false when the item is not a folder.
+ "canEdit": True or False, # Whether the file can be edited by the current user.
+ "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
+ },
"sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
"webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
"etag": "A String", # ETag of the file.
@@ -740,20 +918,41 @@
"exportLinks": { # Links for exporting Google Docs to specific formats.
"a_key": "A String", # A mapping from export format to URL
},
- "shared": True or False, # Whether the file has been shared.
- "permissions": [ # The list of permissions for users with access to this file.
+ "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
+ "permissions": [ # The list of permissions for users with access to this file. Not populated for Team Drive files.
{ # A permission for a file.
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -762,7 +961,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -773,7 +972,7 @@
"openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
"a_key": "A String",
},
- "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. Deprecated: use capabilities/canReadRevisions.
"imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
"exposureBias": 3.14, # The exposure bias of the photo (APEX value).
"exposureTime": 3.14, # The length of the exposure, in seconds.
@@ -808,12 +1007,13 @@
"durationMillis": "A String", # The duration of the video in milliseconds.
"height": 42, # The height of the video in pixels.
},
- "editable": True or False, # Whether the file can be edited by the current user.
+ "editable": True or False, # Whether the file can be edited by the current user. Deprecated: use capabilities/canEdit.
"kind": "drive#file", # The type of file. This is always drive#file.
- "canComment": True or False, # Whether the current user can comment on the file.
+ "canComment": True or False, # Whether the current user can comment on the file. Deprecated: use capabilities/canComment.
"quotaBytesUsed": "A String", # The number of quota bytes used by this file.
"fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
+ "teamDriveId": "A String", # ID of the Team Drive the file resides in.
"properties": [ # The list of properties.
{ # A key-value pair attached to a file that is either public or private to an application.
# The following limits apply to file properties:
@@ -845,14 +1045,35 @@
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -861,7 +1082,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -870,9 +1091,10 @@
"spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
"A String",
],
- "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "shareable": True or False, # Whether the file's sharing settings can be modified by the current user. Deprecated: use capabilities/canShare.
"originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
"fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
+ "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
"headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"selfLink": "A String", # A link back to this file.
"modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
@@ -880,7 +1102,7 @@
</div>
<div class="method">
- <code class="details" id="get_media">get_media(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
+ <code class="details" id="get_media">get_media(fileId, projection=None, revisionId=None, supportsTeamDrives=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
<pre>Gets a file's metadata by ID.
Args:
@@ -890,6 +1112,7 @@
BASIC - Deprecated
FULL - Deprecated
revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
+ supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.
@@ -900,7 +1123,7 @@
</div>
<div class="method">
- <code class="details" id="insert">insert(body=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, visibility=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, media_mime_type=None, timedTextLanguage=None)</code>
+ <code class="details" id="insert">insert(body=None, supportsTeamDrives=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, visibility=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, media_mime_type=None, timedTextLanguage=None)</code>
<pre>Insert a new file.
Args:
@@ -910,6 +1133,7 @@
{ # The metadata for a file.
"hasThumbnail": True or False, # Whether this file has a thumbnail.
"lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
+ "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files.
"version": "A String", # 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 requesting user.
"appDataContents": True or False, # Whether this file is in the Application Data folder.
"thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
@@ -924,12 +1148,12 @@
"indexableText": { # Indexable text attributes for the file (can only be written)
"text": "A String", # The text to be indexed for this file.
},
- "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
+ "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
"explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
"isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
"lastModifyingUserName": "A String", # Name of the last user to modify this file.
- "writersCanShare": True or False, # Whether writers can share the document with other users.
- "owners": [ # The owner(s) of this file.
+ "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for Team Drive files.
+ "owners": [ # The owner(s) of this file. Not populated for Team Drive files.
{ # Information about a Drive user.
"picture": { # The user's profile picture.
"url": "A String", # A URL that points to a profile picture of this user.
@@ -941,7 +1165,7 @@
"emailAddress": "A String", # The email address of the user.
},
],
- "ownedByMe": True or False, # Whether the file is owned by the current user.
+ "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for Team Drive files.
"id": "A String", # The ID of the file.
"sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
"picture": { # The user's profile picture.
@@ -953,6 +1177,16 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
+ "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
+ "picture": { # The user's profile picture.
+ "url": "A String", # A URL that points to a profile picture of this user.
+ },
+ "kind": "drive#user", # This is always drive#user.
+ "displayName": "A String", # A plain text displayable name for this user.
+ "permissionId": "A String", # The user's ID as visible in the permissions collection.
+ "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
+ "emailAddress": "A String", # The email address of the user.
+ },
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
"lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
"picture": { # The user's profile picture.
@@ -964,12 +1198,30 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
- "copyable": True or False, # Whether the file can be copied by the current user.
- "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
+ "copyable": True or False, # Whether the file can be copied by the current user. Deprecated: use capabilities/canCopy.
+ "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files.
"markedViewedByMeDate": "A String", # Deprecated.
- "ownerNames": [ # Name(s) of the owner(s) of this file.
+ "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for Team Drive files.
"A String",
],
+ "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
+ "canTrash": True or False, # Whether the file can be trashed by the current user.
+ "canCopy": True or False, # Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
+ "canShare": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "canDelete": True or False, # Whether the file can be deleted by the current user.
+ "canMoveTeamDriveItem": True or False, # Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
+ "canRename": True or False, # Whether the file can be renamed by the current user.
+ "canListChildren": True or False, # Whether the current user can list the children of this folder. This is always false when the item is not a folder.
+ "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
+ "canDownload": True or False, # Whether the file can be downloaded by the current user.
+ "canComment": True or False, # Whether the current user can comment on the file.
+ "canRemoveChildren": True or False, # Whether the current user can remove children from this folder. This is always false when the item is not a folder.
+ "canReadTeamDrive": True or False, # Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
+ "canAddChildren": True or False, # Whether the current user can add children to this folder. This is always false when the item is not a folder.
+ "canEdit": True or False, # Whether the file can be edited by the current user.
+ "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
+ },
"sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
"webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
"etag": "A String", # ETag of the file.
@@ -986,20 +1238,41 @@
"exportLinks": { # Links for exporting Google Docs to specific formats.
"a_key": "A String", # A mapping from export format to URL
},
- "shared": True or False, # Whether the file has been shared.
- "permissions": [ # The list of permissions for users with access to this file.
+ "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
+ "permissions": [ # The list of permissions for users with access to this file. Not populated for Team Drive files.
{ # A permission for a file.
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -1008,7 +1281,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -1019,7 +1292,7 @@
"openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
"a_key": "A String",
},
- "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. Deprecated: use capabilities/canReadRevisions.
"imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
"exposureBias": 3.14, # The exposure bias of the photo (APEX value).
"exposureTime": 3.14, # The length of the exposure, in seconds.
@@ -1054,12 +1327,13 @@
"durationMillis": "A String", # The duration of the video in milliseconds.
"height": 42, # The height of the video in pixels.
},
- "editable": True or False, # Whether the file can be edited by the current user.
+ "editable": True or False, # Whether the file can be edited by the current user. Deprecated: use capabilities/canEdit.
"kind": "drive#file", # The type of file. This is always drive#file.
- "canComment": True or False, # Whether the current user can comment on the file.
+ "canComment": True or False, # Whether the current user can comment on the file. Deprecated: use capabilities/canComment.
"quotaBytesUsed": "A String", # The number of quota bytes used by this file.
"fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
+ "teamDriveId": "A String", # ID of the Team Drive the file resides in.
"properties": [ # The list of properties.
{ # A key-value pair attached to a file that is either public or private to an application.
# The following limits apply to file properties:
@@ -1091,14 +1365,35 @@
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -1107,7 +1402,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -1116,14 +1411,16 @@
"spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
"A String",
],
- "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "shareable": True or False, # Whether the file's sharing settings can be modified by the current user. Deprecated: use capabilities/canShare.
"originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
"fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
+ "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
"headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"selfLink": "A String", # A link back to this file.
"modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
}
+ supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
@@ -1144,6 +1441,7 @@
{ # The metadata for a file.
"hasThumbnail": True or False, # Whether this file has a thumbnail.
"lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
+ "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files.
"version": "A String", # 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 requesting user.
"appDataContents": True or False, # Whether this file is in the Application Data folder.
"thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
@@ -1158,12 +1456,12 @@
"indexableText": { # Indexable text attributes for the file (can only be written)
"text": "A String", # The text to be indexed for this file.
},
- "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
+ "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
"explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
"isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
"lastModifyingUserName": "A String", # Name of the last user to modify this file.
- "writersCanShare": True or False, # Whether writers can share the document with other users.
- "owners": [ # The owner(s) of this file.
+ "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for Team Drive files.
+ "owners": [ # The owner(s) of this file. Not populated for Team Drive files.
{ # Information about a Drive user.
"picture": { # The user's profile picture.
"url": "A String", # A URL that points to a profile picture of this user.
@@ -1175,7 +1473,7 @@
"emailAddress": "A String", # The email address of the user.
},
],
- "ownedByMe": True or False, # Whether the file is owned by the current user.
+ "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for Team Drive files.
"id": "A String", # The ID of the file.
"sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
"picture": { # The user's profile picture.
@@ -1187,6 +1485,16 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
+ "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
+ "picture": { # The user's profile picture.
+ "url": "A String", # A URL that points to a profile picture of this user.
+ },
+ "kind": "drive#user", # This is always drive#user.
+ "displayName": "A String", # A plain text displayable name for this user.
+ "permissionId": "A String", # The user's ID as visible in the permissions collection.
+ "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
+ "emailAddress": "A String", # The email address of the user.
+ },
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
"lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
"picture": { # The user's profile picture.
@@ -1198,12 +1506,30 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
- "copyable": True or False, # Whether the file can be copied by the current user.
- "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
+ "copyable": True or False, # Whether the file can be copied by the current user. Deprecated: use capabilities/canCopy.
+ "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files.
"markedViewedByMeDate": "A String", # Deprecated.
- "ownerNames": [ # Name(s) of the owner(s) of this file.
+ "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for Team Drive files.
"A String",
],
+ "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
+ "canTrash": True or False, # Whether the file can be trashed by the current user.
+ "canCopy": True or False, # Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
+ "canShare": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "canDelete": True or False, # Whether the file can be deleted by the current user.
+ "canMoveTeamDriveItem": True or False, # Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
+ "canRename": True or False, # Whether the file can be renamed by the current user.
+ "canListChildren": True or False, # Whether the current user can list the children of this folder. This is always false when the item is not a folder.
+ "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
+ "canDownload": True or False, # Whether the file can be downloaded by the current user.
+ "canComment": True or False, # Whether the current user can comment on the file.
+ "canRemoveChildren": True or False, # Whether the current user can remove children from this folder. This is always false when the item is not a folder.
+ "canReadTeamDrive": True or False, # Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
+ "canAddChildren": True or False, # Whether the current user can add children to this folder. This is always false when the item is not a folder.
+ "canEdit": True or False, # Whether the file can be edited by the current user.
+ "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
+ },
"sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
"webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
"etag": "A String", # ETag of the file.
@@ -1220,20 +1546,41 @@
"exportLinks": { # Links for exporting Google Docs to specific formats.
"a_key": "A String", # A mapping from export format to URL
},
- "shared": True or False, # Whether the file has been shared.
- "permissions": [ # The list of permissions for users with access to this file.
+ "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
+ "permissions": [ # The list of permissions for users with access to this file. Not populated for Team Drive files.
{ # A permission for a file.
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -1242,7 +1589,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -1253,7 +1600,7 @@
"openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
"a_key": "A String",
},
- "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. Deprecated: use capabilities/canReadRevisions.
"imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
"exposureBias": 3.14, # The exposure bias of the photo (APEX value).
"exposureTime": 3.14, # The length of the exposure, in seconds.
@@ -1288,12 +1635,13 @@
"durationMillis": "A String", # The duration of the video in milliseconds.
"height": 42, # The height of the video in pixels.
},
- "editable": True or False, # Whether the file can be edited by the current user.
+ "editable": True or False, # Whether the file can be edited by the current user. Deprecated: use capabilities/canEdit.
"kind": "drive#file", # The type of file. This is always drive#file.
- "canComment": True or False, # Whether the current user can comment on the file.
+ "canComment": True or False, # Whether the current user can comment on the file. Deprecated: use capabilities/canComment.
"quotaBytesUsed": "A String", # The number of quota bytes used by this file.
"fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
+ "teamDriveId": "A String", # ID of the Team Drive the file resides in.
"properties": [ # The list of properties.
{ # A key-value pair attached to a file that is either public or private to an application.
# The following limits apply to file properties:
@@ -1325,14 +1673,35 @@
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -1341,7 +1710,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -1350,9 +1719,10 @@
"spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
"A String",
],
- "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "shareable": True or False, # Whether the file's sharing settings can be modified by the current user. Deprecated: use capabilities/canShare.
"originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
"fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
+ "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
"headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"selfLink": "A String", # A link back to this file.
"modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
@@ -1360,34 +1730,40 @@
</div>
<div class="method">
- <code class="details" id="list">list(orderBy=None, q=None, projection=None, pageToken=None, maxResults=None, spaces=None, corpus=None)</code>
+ <code class="details" id="list">list(orderBy=None, projection=None, supportsTeamDrives=None, spaces=None, pageToken=None, corpus=None, maxResults=None, teamDriveId=None, includeTeamDriveItems=None, corpora=None, q=None)</code>
<pre>Lists the user's files.
Args:
orderBy: string, A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.
- q: string, Query string for searching files.
projection: string, This parameter is deprecated and has no function.
Allowed values
BASIC - Deprecated
FULL - Deprecated
- pageToken: string, Page token for files.
- maxResults: integer, Maximum number of files to return.
+ supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
spaces: string, A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.
- corpus: string, The body of items (files/documents) to which the query applies.
+ pageToken: string, Page token for files.
+ corpus: string, The body of items (files/documents) to which the query applies. Deprecated: use 'corpora' instead.
Allowed values
DEFAULT - The items that the user has accessed.
DOMAIN - Items shared to the user's domain.
+ maxResults: integer, Maximum number of files to return.
+ teamDriveId: string, ID of Team Drive to search.
+ includeTeamDriveItems: boolean, Whether Team Drive items should be included in results.
+ corpora: string, Comma-separated list of bodies of items (files/documents) to which the query applies. Supported bodies are 'default', 'domain', 'teamDrive' and 'allTeamDrives'. 'allTeamDrives' must be combined with 'default'; all other values must be used in isolation. Prefer 'default' or 'teamDrive' to 'allTeamDrives' for efficiency.
+ q: string, Query string for searching files.
Returns:
An object of the form:
{ # A list of files.
- "nextPageToken": "A String", # The page token for the next page of files.
+ "incompleteSearch": True or False, # Whether the search process was incomplete. If true, then some search results may be missing, since all documents were not searched. This may occur when searching multiple Team Drives with the "default,allTeamDrives" corpora, but all corpora could not be searched. When this happens, it is suggested that clients narrow their query by choosing a different corpus such as "default" or "teamDrive".
+ "nextPageToken": "A String", # The page token for the next page of files. This will be absent if the end of the files list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
"kind": "drive#fileList", # This is always drive#fileList.
- "items": [ # The actual list of files.
+ "items": [ # The list of files. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
{ # The metadata for a file.
"hasThumbnail": True or False, # Whether this file has a thumbnail.
"lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
+ "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files.
"version": "A String", # 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 requesting user.
"appDataContents": True or False, # Whether this file is in the Application Data folder.
"thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
@@ -1402,12 +1778,12 @@
"indexableText": { # Indexable text attributes for the file (can only be written)
"text": "A String", # The text to be indexed for this file.
},
- "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
+ "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
"explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
"isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
"lastModifyingUserName": "A String", # Name of the last user to modify this file.
- "writersCanShare": True or False, # Whether writers can share the document with other users.
- "owners": [ # The owner(s) of this file.
+ "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for Team Drive files.
+ "owners": [ # The owner(s) of this file. Not populated for Team Drive files.
{ # Information about a Drive user.
"picture": { # The user's profile picture.
"url": "A String", # A URL that points to a profile picture of this user.
@@ -1419,7 +1795,7 @@
"emailAddress": "A String", # The email address of the user.
},
],
- "ownedByMe": True or False, # Whether the file is owned by the current user.
+ "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for Team Drive files.
"id": "A String", # The ID of the file.
"sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
"picture": { # The user's profile picture.
@@ -1431,6 +1807,16 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
+ "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
+ "picture": { # The user's profile picture.
+ "url": "A String", # A URL that points to a profile picture of this user.
+ },
+ "kind": "drive#user", # This is always drive#user.
+ "displayName": "A String", # A plain text displayable name for this user.
+ "permissionId": "A String", # The user's ID as visible in the permissions collection.
+ "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
+ "emailAddress": "A String", # The email address of the user.
+ },
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
"lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
"picture": { # The user's profile picture.
@@ -1442,12 +1828,30 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
- "copyable": True or False, # Whether the file can be copied by the current user.
- "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
+ "copyable": True or False, # Whether the file can be copied by the current user. Deprecated: use capabilities/canCopy.
+ "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files.
"markedViewedByMeDate": "A String", # Deprecated.
- "ownerNames": [ # Name(s) of the owner(s) of this file.
+ "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for Team Drive files.
"A String",
],
+ "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
+ "canTrash": True or False, # Whether the file can be trashed by the current user.
+ "canCopy": True or False, # Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
+ "canShare": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "canDelete": True or False, # Whether the file can be deleted by the current user.
+ "canMoveTeamDriveItem": True or False, # Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
+ "canRename": True or False, # Whether the file can be renamed by the current user.
+ "canListChildren": True or False, # Whether the current user can list the children of this folder. This is always false when the item is not a folder.
+ "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
+ "canDownload": True or False, # Whether the file can be downloaded by the current user.
+ "canComment": True or False, # Whether the current user can comment on the file.
+ "canRemoveChildren": True or False, # Whether the current user can remove children from this folder. This is always false when the item is not a folder.
+ "canReadTeamDrive": True or False, # Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
+ "canAddChildren": True or False, # Whether the current user can add children to this folder. This is always false when the item is not a folder.
+ "canEdit": True or False, # Whether the file can be edited by the current user.
+ "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
+ },
"sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
"webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
"etag": "A String", # ETag of the file.
@@ -1464,20 +1868,41 @@
"exportLinks": { # Links for exporting Google Docs to specific formats.
"a_key": "A String", # A mapping from export format to URL
},
- "shared": True or False, # Whether the file has been shared.
- "permissions": [ # The list of permissions for users with access to this file.
+ "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
+ "permissions": [ # The list of permissions for users with access to this file. Not populated for Team Drive files.
{ # A permission for a file.
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -1486,7 +1911,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -1497,7 +1922,7 @@
"openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
"a_key": "A String",
},
- "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. Deprecated: use capabilities/canReadRevisions.
"imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
"exposureBias": 3.14, # The exposure bias of the photo (APEX value).
"exposureTime": 3.14, # The length of the exposure, in seconds.
@@ -1532,12 +1957,13 @@
"durationMillis": "A String", # The duration of the video in milliseconds.
"height": 42, # The height of the video in pixels.
},
- "editable": True or False, # Whether the file can be edited by the current user.
+ "editable": True or False, # Whether the file can be edited by the current user. Deprecated: use capabilities/canEdit.
"kind": "drive#file", # The type of file. This is always drive#file.
- "canComment": True or False, # Whether the current user can comment on the file.
+ "canComment": True or False, # Whether the current user can comment on the file. Deprecated: use capabilities/canComment.
"quotaBytesUsed": "A String", # The number of quota bytes used by this file.
"fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
+ "teamDriveId": "A String", # ID of the Team Drive the file resides in.
"properties": [ # The list of properties.
{ # A key-value pair attached to a file that is either public or private to an application.
# The following limits apply to file properties:
@@ -1569,14 +1995,35 @@
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -1585,7 +2032,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -1594,9 +2041,10 @@
"spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
"A String",
],
- "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "shareable": True or False, # Whether the file's sharing settings can be modified by the current user. Deprecated: use capabilities/canShare.
"originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
"fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
+ "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
"headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"selfLink": "A String", # A link back to this file.
"modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
@@ -1623,7 +2071,7 @@
</div>
<div class="method">
- <code class="details" id="patch">patch(fileId, body, newRevision=None, modifiedDateBehavior=None, pinned=None, ocrLanguage=None, ocr=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</code>
+ <code class="details" id="patch">patch(fileId, body, supportsTeamDrives=None, newRevision=None, modifiedDateBehavior=None, pinned=None, ocrLanguage=None, ocr=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</code>
<pre>Updates file metadata and/or content. This method supports patch semantics.
Args:
@@ -1634,6 +2082,7 @@
{ # The metadata for a file.
"hasThumbnail": True or False, # Whether this file has a thumbnail.
"lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
+ "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files.
"version": "A String", # 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 requesting user.
"appDataContents": True or False, # Whether this file is in the Application Data folder.
"thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
@@ -1648,12 +2097,12 @@
"indexableText": { # Indexable text attributes for the file (can only be written)
"text": "A String", # The text to be indexed for this file.
},
- "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
+ "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
"explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
"isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
"lastModifyingUserName": "A String", # Name of the last user to modify this file.
- "writersCanShare": True or False, # Whether writers can share the document with other users.
- "owners": [ # The owner(s) of this file.
+ "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for Team Drive files.
+ "owners": [ # The owner(s) of this file. Not populated for Team Drive files.
{ # Information about a Drive user.
"picture": { # The user's profile picture.
"url": "A String", # A URL that points to a profile picture of this user.
@@ -1665,7 +2114,7 @@
"emailAddress": "A String", # The email address of the user.
},
],
- "ownedByMe": True or False, # Whether the file is owned by the current user.
+ "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for Team Drive files.
"id": "A String", # The ID of the file.
"sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
"picture": { # The user's profile picture.
@@ -1677,6 +2126,16 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
+ "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
+ "picture": { # The user's profile picture.
+ "url": "A String", # A URL that points to a profile picture of this user.
+ },
+ "kind": "drive#user", # This is always drive#user.
+ "displayName": "A String", # A plain text displayable name for this user.
+ "permissionId": "A String", # The user's ID as visible in the permissions collection.
+ "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
+ "emailAddress": "A String", # The email address of the user.
+ },
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
"lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
"picture": { # The user's profile picture.
@@ -1688,12 +2147,30 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
- "copyable": True or False, # Whether the file can be copied by the current user.
- "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
+ "copyable": True or False, # Whether the file can be copied by the current user. Deprecated: use capabilities/canCopy.
+ "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files.
"markedViewedByMeDate": "A String", # Deprecated.
- "ownerNames": [ # Name(s) of the owner(s) of this file.
+ "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for Team Drive files.
"A String",
],
+ "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
+ "canTrash": True or False, # Whether the file can be trashed by the current user.
+ "canCopy": True or False, # Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
+ "canShare": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "canDelete": True or False, # Whether the file can be deleted by the current user.
+ "canMoveTeamDriveItem": True or False, # Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
+ "canRename": True or False, # Whether the file can be renamed by the current user.
+ "canListChildren": True or False, # Whether the current user can list the children of this folder. This is always false when the item is not a folder.
+ "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
+ "canDownload": True or False, # Whether the file can be downloaded by the current user.
+ "canComment": True or False, # Whether the current user can comment on the file.
+ "canRemoveChildren": True or False, # Whether the current user can remove children from this folder. This is always false when the item is not a folder.
+ "canReadTeamDrive": True or False, # Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
+ "canAddChildren": True or False, # Whether the current user can add children to this folder. This is always false when the item is not a folder.
+ "canEdit": True or False, # Whether the file can be edited by the current user.
+ "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
+ },
"sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
"webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
"etag": "A String", # ETag of the file.
@@ -1710,20 +2187,41 @@
"exportLinks": { # Links for exporting Google Docs to specific formats.
"a_key": "A String", # A mapping from export format to URL
},
- "shared": True or False, # Whether the file has been shared.
- "permissions": [ # The list of permissions for users with access to this file.
+ "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
+ "permissions": [ # The list of permissions for users with access to this file. Not populated for Team Drive files.
{ # A permission for a file.
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -1732,7 +2230,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -1743,7 +2241,7 @@
"openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
"a_key": "A String",
},
- "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. Deprecated: use capabilities/canReadRevisions.
"imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
"exposureBias": 3.14, # The exposure bias of the photo (APEX value).
"exposureTime": 3.14, # The length of the exposure, in seconds.
@@ -1778,12 +2276,13 @@
"durationMillis": "A String", # The duration of the video in milliseconds.
"height": 42, # The height of the video in pixels.
},
- "editable": True or False, # Whether the file can be edited by the current user.
+ "editable": True or False, # Whether the file can be edited by the current user. Deprecated: use capabilities/canEdit.
"kind": "drive#file", # The type of file. This is always drive#file.
- "canComment": True or False, # Whether the current user can comment on the file.
+ "canComment": True or False, # Whether the current user can comment on the file. Deprecated: use capabilities/canComment.
"quotaBytesUsed": "A String", # The number of quota bytes used by this file.
"fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
+ "teamDriveId": "A String", # ID of the Team Drive the file resides in.
"properties": [ # The list of properties.
{ # A key-value pair attached to a file that is either public or private to an application.
# The following limits apply to file properties:
@@ -1815,14 +2314,35 @@
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -1831,7 +2351,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -1840,14 +2360,16 @@
"spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
"A String",
],
- "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "shareable": True or False, # Whether the file's sharing settings can be modified by the current user. Deprecated: use capabilities/canShare.
"originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
"fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
+ "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
"headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"selfLink": "A String", # A link back to this file.
"modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
}
+ supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center.
modifiedDateBehavior: string, Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.
Allowed values
@@ -1875,6 +2397,7 @@
{ # The metadata for a file.
"hasThumbnail": True or False, # Whether this file has a thumbnail.
"lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
+ "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files.
"version": "A String", # 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 requesting user.
"appDataContents": True or False, # Whether this file is in the Application Data folder.
"thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
@@ -1889,12 +2412,12 @@
"indexableText": { # Indexable text attributes for the file (can only be written)
"text": "A String", # The text to be indexed for this file.
},
- "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
+ "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
"explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
"isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
"lastModifyingUserName": "A String", # Name of the last user to modify this file.
- "writersCanShare": True or False, # Whether writers can share the document with other users.
- "owners": [ # The owner(s) of this file.
+ "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for Team Drive files.
+ "owners": [ # The owner(s) of this file. Not populated for Team Drive files.
{ # Information about a Drive user.
"picture": { # The user's profile picture.
"url": "A String", # A URL that points to a profile picture of this user.
@@ -1906,7 +2429,7 @@
"emailAddress": "A String", # The email address of the user.
},
],
- "ownedByMe": True or False, # Whether the file is owned by the current user.
+ "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for Team Drive files.
"id": "A String", # The ID of the file.
"sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
"picture": { # The user's profile picture.
@@ -1918,6 +2441,16 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
+ "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
+ "picture": { # The user's profile picture.
+ "url": "A String", # A URL that points to a profile picture of this user.
+ },
+ "kind": "drive#user", # This is always drive#user.
+ "displayName": "A String", # A plain text displayable name for this user.
+ "permissionId": "A String", # The user's ID as visible in the permissions collection.
+ "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
+ "emailAddress": "A String", # The email address of the user.
+ },
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
"lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
"picture": { # The user's profile picture.
@@ -1929,12 +2462,30 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
- "copyable": True or False, # Whether the file can be copied by the current user.
- "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
+ "copyable": True or False, # Whether the file can be copied by the current user. Deprecated: use capabilities/canCopy.
+ "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files.
"markedViewedByMeDate": "A String", # Deprecated.
- "ownerNames": [ # Name(s) of the owner(s) of this file.
+ "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for Team Drive files.
"A String",
],
+ "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
+ "canTrash": True or False, # Whether the file can be trashed by the current user.
+ "canCopy": True or False, # Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
+ "canShare": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "canDelete": True or False, # Whether the file can be deleted by the current user.
+ "canMoveTeamDriveItem": True or False, # Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
+ "canRename": True or False, # Whether the file can be renamed by the current user.
+ "canListChildren": True or False, # Whether the current user can list the children of this folder. This is always false when the item is not a folder.
+ "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
+ "canDownload": True or False, # Whether the file can be downloaded by the current user.
+ "canComment": True or False, # Whether the current user can comment on the file.
+ "canRemoveChildren": True or False, # Whether the current user can remove children from this folder. This is always false when the item is not a folder.
+ "canReadTeamDrive": True or False, # Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
+ "canAddChildren": True or False, # Whether the current user can add children to this folder. This is always false when the item is not a folder.
+ "canEdit": True or False, # Whether the file can be edited by the current user.
+ "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
+ },
"sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
"webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
"etag": "A String", # ETag of the file.
@@ -1951,20 +2502,41 @@
"exportLinks": { # Links for exporting Google Docs to specific formats.
"a_key": "A String", # A mapping from export format to URL
},
- "shared": True or False, # Whether the file has been shared.
- "permissions": [ # The list of permissions for users with access to this file.
+ "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
+ "permissions": [ # The list of permissions for users with access to this file. Not populated for Team Drive files.
{ # A permission for a file.
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -1973,7 +2545,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -1984,7 +2556,7 @@
"openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
"a_key": "A String",
},
- "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. Deprecated: use capabilities/canReadRevisions.
"imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
"exposureBias": 3.14, # The exposure bias of the photo (APEX value).
"exposureTime": 3.14, # The length of the exposure, in seconds.
@@ -2019,12 +2591,13 @@
"durationMillis": "A String", # The duration of the video in milliseconds.
"height": 42, # The height of the video in pixels.
},
- "editable": True or False, # Whether the file can be edited by the current user.
+ "editable": True or False, # Whether the file can be edited by the current user. Deprecated: use capabilities/canEdit.
"kind": "drive#file", # The type of file. This is always drive#file.
- "canComment": True or False, # Whether the current user can comment on the file.
+ "canComment": True or False, # Whether the current user can comment on the file. Deprecated: use capabilities/canComment.
"quotaBytesUsed": "A String", # The number of quota bytes used by this file.
"fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
+ "teamDriveId": "A String", # ID of the Team Drive the file resides in.
"properties": [ # The list of properties.
{ # A key-value pair attached to a file that is either public or private to an application.
# The following limits apply to file properties:
@@ -2056,14 +2629,35 @@
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -2072,7 +2666,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -2081,9 +2675,10 @@
"spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
"A String",
],
- "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "shareable": True or False, # Whether the file's sharing settings can be modified by the current user. Deprecated: use capabilities/canShare.
"originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
"fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
+ "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
"headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"selfLink": "A String", # A link back to this file.
"modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
@@ -2091,11 +2686,12 @@
</div>
<div class="method">
- <code class="details" id="touch">touch(fileId)</code>
+ <code class="details" id="touch">touch(fileId, supportsTeamDrives=None)</code>
<pre>Set the file's updated time to the current server time.
Args:
fileId: string, The ID of the file to update. (required)
+ supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Returns:
An object of the form:
@@ -2103,6 +2699,7 @@
{ # The metadata for a file.
"hasThumbnail": True or False, # Whether this file has a thumbnail.
"lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
+ "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files.
"version": "A String", # 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 requesting user.
"appDataContents": True or False, # Whether this file is in the Application Data folder.
"thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
@@ -2117,12 +2714,12 @@
"indexableText": { # Indexable text attributes for the file (can only be written)
"text": "A String", # The text to be indexed for this file.
},
- "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
+ "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
"explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
"isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
"lastModifyingUserName": "A String", # Name of the last user to modify this file.
- "writersCanShare": True or False, # Whether writers can share the document with other users.
- "owners": [ # The owner(s) of this file.
+ "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for Team Drive files.
+ "owners": [ # The owner(s) of this file. Not populated for Team Drive files.
{ # Information about a Drive user.
"picture": { # The user's profile picture.
"url": "A String", # A URL that points to a profile picture of this user.
@@ -2134,7 +2731,7 @@
"emailAddress": "A String", # The email address of the user.
},
],
- "ownedByMe": True or False, # Whether the file is owned by the current user.
+ "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for Team Drive files.
"id": "A String", # The ID of the file.
"sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
"picture": { # The user's profile picture.
@@ -2146,6 +2743,16 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
+ "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
+ "picture": { # The user's profile picture.
+ "url": "A String", # A URL that points to a profile picture of this user.
+ },
+ "kind": "drive#user", # This is always drive#user.
+ "displayName": "A String", # A plain text displayable name for this user.
+ "permissionId": "A String", # The user's ID as visible in the permissions collection.
+ "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
+ "emailAddress": "A String", # The email address of the user.
+ },
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
"lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
"picture": { # The user's profile picture.
@@ -2157,12 +2764,30 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
- "copyable": True or False, # Whether the file can be copied by the current user.
- "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
+ "copyable": True or False, # Whether the file can be copied by the current user. Deprecated: use capabilities/canCopy.
+ "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files.
"markedViewedByMeDate": "A String", # Deprecated.
- "ownerNames": [ # Name(s) of the owner(s) of this file.
+ "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for Team Drive files.
"A String",
],
+ "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
+ "canTrash": True or False, # Whether the file can be trashed by the current user.
+ "canCopy": True or False, # Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
+ "canShare": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "canDelete": True or False, # Whether the file can be deleted by the current user.
+ "canMoveTeamDriveItem": True or False, # Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
+ "canRename": True or False, # Whether the file can be renamed by the current user.
+ "canListChildren": True or False, # Whether the current user can list the children of this folder. This is always false when the item is not a folder.
+ "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
+ "canDownload": True or False, # Whether the file can be downloaded by the current user.
+ "canComment": True or False, # Whether the current user can comment on the file.
+ "canRemoveChildren": True or False, # Whether the current user can remove children from this folder. This is always false when the item is not a folder.
+ "canReadTeamDrive": True or False, # Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
+ "canAddChildren": True or False, # Whether the current user can add children to this folder. This is always false when the item is not a folder.
+ "canEdit": True or False, # Whether the file can be edited by the current user.
+ "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
+ },
"sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
"webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
"etag": "A String", # ETag of the file.
@@ -2179,20 +2804,41 @@
"exportLinks": { # Links for exporting Google Docs to specific formats.
"a_key": "A String", # A mapping from export format to URL
},
- "shared": True or False, # Whether the file has been shared.
- "permissions": [ # The list of permissions for users with access to this file.
+ "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
+ "permissions": [ # The list of permissions for users with access to this file. Not populated for Team Drive files.
{ # A permission for a file.
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -2201,7 +2847,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -2212,7 +2858,7 @@
"openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
"a_key": "A String",
},
- "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. Deprecated: use capabilities/canReadRevisions.
"imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
"exposureBias": 3.14, # The exposure bias of the photo (APEX value).
"exposureTime": 3.14, # The length of the exposure, in seconds.
@@ -2247,12 +2893,13 @@
"durationMillis": "A String", # The duration of the video in milliseconds.
"height": 42, # The height of the video in pixels.
},
- "editable": True or False, # Whether the file can be edited by the current user.
+ "editable": True or False, # Whether the file can be edited by the current user. Deprecated: use capabilities/canEdit.
"kind": "drive#file", # The type of file. This is always drive#file.
- "canComment": True or False, # Whether the current user can comment on the file.
+ "canComment": True or False, # Whether the current user can comment on the file. Deprecated: use capabilities/canComment.
"quotaBytesUsed": "A String", # The number of quota bytes used by this file.
"fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
+ "teamDriveId": "A String", # ID of the Team Drive the file resides in.
"properties": [ # The list of properties.
{ # A key-value pair attached to a file that is either public or private to an application.
# The following limits apply to file properties:
@@ -2284,14 +2931,35 @@
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -2300,7 +2968,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -2309,9 +2977,10 @@
"spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
"A String",
],
- "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "shareable": True or False, # Whether the file's sharing settings can be modified by the current user. Deprecated: use capabilities/canShare.
"originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
"fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
+ "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
"headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"selfLink": "A String", # A link back to this file.
"modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
@@ -2319,11 +2988,12 @@
</div>
<div class="method">
- <code class="details" id="trash">trash(fileId)</code>
- <pre>Moves a file to the trash. The currently authenticated user must own the file.
+ <code class="details" id="trash">trash(fileId, supportsTeamDrives=None)</code>
+ <pre>Moves a file to the trash. The currently authenticated user must own the file or be an organizer on the parent for Team Drive files.
Args:
fileId: string, The ID of the file to trash. (required)
+ supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Returns:
An object of the form:
@@ -2331,6 +3001,7 @@
{ # The metadata for a file.
"hasThumbnail": True or False, # Whether this file has a thumbnail.
"lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
+ "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files.
"version": "A String", # 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 requesting user.
"appDataContents": True or False, # Whether this file is in the Application Data folder.
"thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
@@ -2345,12 +3016,12 @@
"indexableText": { # Indexable text attributes for the file (can only be written)
"text": "A String", # The text to be indexed for this file.
},
- "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
+ "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
"explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
"isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
"lastModifyingUserName": "A String", # Name of the last user to modify this file.
- "writersCanShare": True or False, # Whether writers can share the document with other users.
- "owners": [ # The owner(s) of this file.
+ "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for Team Drive files.
+ "owners": [ # The owner(s) of this file. Not populated for Team Drive files.
{ # Information about a Drive user.
"picture": { # The user's profile picture.
"url": "A String", # A URL that points to a profile picture of this user.
@@ -2362,7 +3033,7 @@
"emailAddress": "A String", # The email address of the user.
},
],
- "ownedByMe": True or False, # Whether the file is owned by the current user.
+ "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for Team Drive files.
"id": "A String", # The ID of the file.
"sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
"picture": { # The user's profile picture.
@@ -2374,6 +3045,16 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
+ "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
+ "picture": { # The user's profile picture.
+ "url": "A String", # A URL that points to a profile picture of this user.
+ },
+ "kind": "drive#user", # This is always drive#user.
+ "displayName": "A String", # A plain text displayable name for this user.
+ "permissionId": "A String", # The user's ID as visible in the permissions collection.
+ "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
+ "emailAddress": "A String", # The email address of the user.
+ },
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
"lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
"picture": { # The user's profile picture.
@@ -2385,12 +3066,30 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
- "copyable": True or False, # Whether the file can be copied by the current user.
- "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
+ "copyable": True or False, # Whether the file can be copied by the current user. Deprecated: use capabilities/canCopy.
+ "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files.
"markedViewedByMeDate": "A String", # Deprecated.
- "ownerNames": [ # Name(s) of the owner(s) of this file.
+ "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for Team Drive files.
"A String",
],
+ "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
+ "canTrash": True or False, # Whether the file can be trashed by the current user.
+ "canCopy": True or False, # Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
+ "canShare": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "canDelete": True or False, # Whether the file can be deleted by the current user.
+ "canMoveTeamDriveItem": True or False, # Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
+ "canRename": True or False, # Whether the file can be renamed by the current user.
+ "canListChildren": True or False, # Whether the current user can list the children of this folder. This is always false when the item is not a folder.
+ "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
+ "canDownload": True or False, # Whether the file can be downloaded by the current user.
+ "canComment": True or False, # Whether the current user can comment on the file.
+ "canRemoveChildren": True or False, # Whether the current user can remove children from this folder. This is always false when the item is not a folder.
+ "canReadTeamDrive": True or False, # Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
+ "canAddChildren": True or False, # Whether the current user can add children to this folder. This is always false when the item is not a folder.
+ "canEdit": True or False, # Whether the file can be edited by the current user.
+ "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
+ },
"sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
"webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
"etag": "A String", # ETag of the file.
@@ -2407,20 +3106,41 @@
"exportLinks": { # Links for exporting Google Docs to specific formats.
"a_key": "A String", # A mapping from export format to URL
},
- "shared": True or False, # Whether the file has been shared.
- "permissions": [ # The list of permissions for users with access to this file.
+ "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
+ "permissions": [ # The list of permissions for users with access to this file. Not populated for Team Drive files.
{ # A permission for a file.
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -2429,7 +3149,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -2440,7 +3160,7 @@
"openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
"a_key": "A String",
},
- "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. Deprecated: use capabilities/canReadRevisions.
"imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
"exposureBias": 3.14, # The exposure bias of the photo (APEX value).
"exposureTime": 3.14, # The length of the exposure, in seconds.
@@ -2475,12 +3195,13 @@
"durationMillis": "A String", # The duration of the video in milliseconds.
"height": 42, # The height of the video in pixels.
},
- "editable": True or False, # Whether the file can be edited by the current user.
+ "editable": True or False, # Whether the file can be edited by the current user. Deprecated: use capabilities/canEdit.
"kind": "drive#file", # The type of file. This is always drive#file.
- "canComment": True or False, # Whether the current user can comment on the file.
+ "canComment": True or False, # Whether the current user can comment on the file. Deprecated: use capabilities/canComment.
"quotaBytesUsed": "A String", # The number of quota bytes used by this file.
"fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
+ "teamDriveId": "A String", # ID of the Team Drive the file resides in.
"properties": [ # The list of properties.
{ # A key-value pair attached to a file that is either public or private to an application.
# The following limits apply to file properties:
@@ -2512,14 +3233,35 @@
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -2528,7 +3270,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -2537,9 +3279,10 @@
"spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
"A String",
],
- "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "shareable": True or False, # Whether the file's sharing settings can be modified by the current user. Deprecated: use capabilities/canShare.
"originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
"fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
+ "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
"headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"selfLink": "A String", # A link back to this file.
"modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
@@ -2547,11 +3290,12 @@
</div>
<div class="method">
- <code class="details" id="untrash">untrash(fileId)</code>
+ <code class="details" id="untrash">untrash(fileId, supportsTeamDrives=None)</code>
<pre>Restores a file from the trash.
Args:
fileId: string, The ID of the file to untrash. (required)
+ supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Returns:
An object of the form:
@@ -2559,6 +3303,7 @@
{ # The metadata for a file.
"hasThumbnail": True or False, # Whether this file has a thumbnail.
"lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
+ "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files.
"version": "A String", # 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 requesting user.
"appDataContents": True or False, # Whether this file is in the Application Data folder.
"thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
@@ -2573,12 +3318,12 @@
"indexableText": { # Indexable text attributes for the file (can only be written)
"text": "A String", # The text to be indexed for this file.
},
- "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
+ "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
"explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
"isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
"lastModifyingUserName": "A String", # Name of the last user to modify this file.
- "writersCanShare": True or False, # Whether writers can share the document with other users.
- "owners": [ # The owner(s) of this file.
+ "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for Team Drive files.
+ "owners": [ # The owner(s) of this file. Not populated for Team Drive files.
{ # Information about a Drive user.
"picture": { # The user's profile picture.
"url": "A String", # A URL that points to a profile picture of this user.
@@ -2590,7 +3335,7 @@
"emailAddress": "A String", # The email address of the user.
},
],
- "ownedByMe": True or False, # Whether the file is owned by the current user.
+ "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for Team Drive files.
"id": "A String", # The ID of the file.
"sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
"picture": { # The user's profile picture.
@@ -2602,6 +3347,16 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
+ "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
+ "picture": { # The user's profile picture.
+ "url": "A String", # A URL that points to a profile picture of this user.
+ },
+ "kind": "drive#user", # This is always drive#user.
+ "displayName": "A String", # A plain text displayable name for this user.
+ "permissionId": "A String", # The user's ID as visible in the permissions collection.
+ "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
+ "emailAddress": "A String", # The email address of the user.
+ },
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
"lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
"picture": { # The user's profile picture.
@@ -2613,12 +3368,30 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
- "copyable": True or False, # Whether the file can be copied by the current user.
- "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
+ "copyable": True or False, # Whether the file can be copied by the current user. Deprecated: use capabilities/canCopy.
+ "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files.
"markedViewedByMeDate": "A String", # Deprecated.
- "ownerNames": [ # Name(s) of the owner(s) of this file.
+ "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for Team Drive files.
"A String",
],
+ "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
+ "canTrash": True or False, # Whether the file can be trashed by the current user.
+ "canCopy": True or False, # Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
+ "canShare": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "canDelete": True or False, # Whether the file can be deleted by the current user.
+ "canMoveTeamDriveItem": True or False, # Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
+ "canRename": True or False, # Whether the file can be renamed by the current user.
+ "canListChildren": True or False, # Whether the current user can list the children of this folder. This is always false when the item is not a folder.
+ "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
+ "canDownload": True or False, # Whether the file can be downloaded by the current user.
+ "canComment": True or False, # Whether the current user can comment on the file.
+ "canRemoveChildren": True or False, # Whether the current user can remove children from this folder. This is always false when the item is not a folder.
+ "canReadTeamDrive": True or False, # Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
+ "canAddChildren": True or False, # Whether the current user can add children to this folder. This is always false when the item is not a folder.
+ "canEdit": True or False, # Whether the file can be edited by the current user.
+ "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
+ },
"sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
"webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
"etag": "A String", # ETag of the file.
@@ -2635,20 +3408,41 @@
"exportLinks": { # Links for exporting Google Docs to specific formats.
"a_key": "A String", # A mapping from export format to URL
},
- "shared": True or False, # Whether the file has been shared.
- "permissions": [ # The list of permissions for users with access to this file.
+ "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
+ "permissions": [ # The list of permissions for users with access to this file. Not populated for Team Drive files.
{ # A permission for a file.
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -2657,7 +3451,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -2668,7 +3462,7 @@
"openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
"a_key": "A String",
},
- "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. Deprecated: use capabilities/canReadRevisions.
"imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
"exposureBias": 3.14, # The exposure bias of the photo (APEX value).
"exposureTime": 3.14, # The length of the exposure, in seconds.
@@ -2703,12 +3497,13 @@
"durationMillis": "A String", # The duration of the video in milliseconds.
"height": 42, # The height of the video in pixels.
},
- "editable": True or False, # Whether the file can be edited by the current user.
+ "editable": True or False, # Whether the file can be edited by the current user. Deprecated: use capabilities/canEdit.
"kind": "drive#file", # The type of file. This is always drive#file.
- "canComment": True or False, # Whether the current user can comment on the file.
+ "canComment": True or False, # Whether the current user can comment on the file. Deprecated: use capabilities/canComment.
"quotaBytesUsed": "A String", # The number of quota bytes used by this file.
"fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
+ "teamDriveId": "A String", # ID of the Team Drive the file resides in.
"properties": [ # The list of properties.
{ # A key-value pair attached to a file that is either public or private to an application.
# The following limits apply to file properties:
@@ -2740,14 +3535,35 @@
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -2756,7 +3572,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -2765,9 +3581,10 @@
"spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
"A String",
],
- "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "shareable": True or False, # Whether the file's sharing settings can be modified by the current user. Deprecated: use capabilities/canShare.
"originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
"fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
+ "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
"headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"selfLink": "A String", # A link back to this file.
"modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
@@ -2775,7 +3592,7 @@
</div>
<div class="method">
- <code class="details" id="update">update(fileId, body=None, newRevision=None, modifiedDateBehavior=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, media_mime_type=None, setModifiedDate=None, timedTextLanguage=None)</code>
+ <code class="details" id="update">update(fileId, body=None, supportsTeamDrives=None, newRevision=None, modifiedDateBehavior=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, media_mime_type=None, setModifiedDate=None, timedTextLanguage=None)</code>
<pre>Updates file metadata and/or content.
Args:
@@ -2786,6 +3603,7 @@
{ # The metadata for a file.
"hasThumbnail": True or False, # Whether this file has a thumbnail.
"lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
+ "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files.
"version": "A String", # 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 requesting user.
"appDataContents": True or False, # Whether this file is in the Application Data folder.
"thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
@@ -2800,12 +3618,12 @@
"indexableText": { # Indexable text attributes for the file (can only be written)
"text": "A String", # The text to be indexed for this file.
},
- "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
+ "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
"explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
"isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
"lastModifyingUserName": "A String", # Name of the last user to modify this file.
- "writersCanShare": True or False, # Whether writers can share the document with other users.
- "owners": [ # The owner(s) of this file.
+ "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for Team Drive files.
+ "owners": [ # The owner(s) of this file. Not populated for Team Drive files.
{ # Information about a Drive user.
"picture": { # The user's profile picture.
"url": "A String", # A URL that points to a profile picture of this user.
@@ -2817,7 +3635,7 @@
"emailAddress": "A String", # The email address of the user.
},
],
- "ownedByMe": True or False, # Whether the file is owned by the current user.
+ "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for Team Drive files.
"id": "A String", # The ID of the file.
"sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
"picture": { # The user's profile picture.
@@ -2829,6 +3647,16 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
+ "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
+ "picture": { # The user's profile picture.
+ "url": "A String", # A URL that points to a profile picture of this user.
+ },
+ "kind": "drive#user", # This is always drive#user.
+ "displayName": "A String", # A plain text displayable name for this user.
+ "permissionId": "A String", # The user's ID as visible in the permissions collection.
+ "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
+ "emailAddress": "A String", # The email address of the user.
+ },
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
"lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
"picture": { # The user's profile picture.
@@ -2840,12 +3668,30 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
- "copyable": True or False, # Whether the file can be copied by the current user.
- "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
+ "copyable": True or False, # Whether the file can be copied by the current user. Deprecated: use capabilities/canCopy.
+ "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files.
"markedViewedByMeDate": "A String", # Deprecated.
- "ownerNames": [ # Name(s) of the owner(s) of this file.
+ "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for Team Drive files.
"A String",
],
+ "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
+ "canTrash": True or False, # Whether the file can be trashed by the current user.
+ "canCopy": True or False, # Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
+ "canShare": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "canDelete": True or False, # Whether the file can be deleted by the current user.
+ "canMoveTeamDriveItem": True or False, # Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
+ "canRename": True or False, # Whether the file can be renamed by the current user.
+ "canListChildren": True or False, # Whether the current user can list the children of this folder. This is always false when the item is not a folder.
+ "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
+ "canDownload": True or False, # Whether the file can be downloaded by the current user.
+ "canComment": True or False, # Whether the current user can comment on the file.
+ "canRemoveChildren": True or False, # Whether the current user can remove children from this folder. This is always false when the item is not a folder.
+ "canReadTeamDrive": True or False, # Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
+ "canAddChildren": True or False, # Whether the current user can add children to this folder. This is always false when the item is not a folder.
+ "canEdit": True or False, # Whether the file can be edited by the current user.
+ "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
+ },
"sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
"webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
"etag": "A String", # ETag of the file.
@@ -2862,20 +3708,41 @@
"exportLinks": { # Links for exporting Google Docs to specific formats.
"a_key": "A String", # A mapping from export format to URL
},
- "shared": True or False, # Whether the file has been shared.
- "permissions": [ # The list of permissions for users with access to this file.
+ "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
+ "permissions": [ # The list of permissions for users with access to this file. Not populated for Team Drive files.
{ # A permission for a file.
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -2884,7 +3751,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -2895,7 +3762,7 @@
"openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
"a_key": "A String",
},
- "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. Deprecated: use capabilities/canReadRevisions.
"imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
"exposureBias": 3.14, # The exposure bias of the photo (APEX value).
"exposureTime": 3.14, # The length of the exposure, in seconds.
@@ -2930,12 +3797,13 @@
"durationMillis": "A String", # The duration of the video in milliseconds.
"height": 42, # The height of the video in pixels.
},
- "editable": True or False, # Whether the file can be edited by the current user.
+ "editable": True or False, # Whether the file can be edited by the current user. Deprecated: use capabilities/canEdit.
"kind": "drive#file", # The type of file. This is always drive#file.
- "canComment": True or False, # Whether the current user can comment on the file.
+ "canComment": True or False, # Whether the current user can comment on the file. Deprecated: use capabilities/canComment.
"quotaBytesUsed": "A String", # The number of quota bytes used by this file.
"fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
+ "teamDriveId": "A String", # ID of the Team Drive the file resides in.
"properties": [ # The list of properties.
{ # A key-value pair attached to a file that is either public or private to an application.
# The following limits apply to file properties:
@@ -2967,14 +3835,35 @@
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -2983,7 +3872,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -2992,14 +3881,16 @@
"spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
"A String",
],
- "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "shareable": True or False, # Whether the file's sharing settings can be modified by the current user. Deprecated: use capabilities/canShare.
"originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
"fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
+ "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
"headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"selfLink": "A String", # A link back to this file.
"modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
}
+ supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center.
modifiedDateBehavior: string, Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.
Allowed values
@@ -3029,6 +3920,7 @@
{ # The metadata for a file.
"hasThumbnail": True or False, # Whether this file has a thumbnail.
"lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
+ "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files.
"version": "A String", # 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 requesting user.
"appDataContents": True or False, # Whether this file is in the Application Data folder.
"thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
@@ -3043,12 +3935,12 @@
"indexableText": { # Indexable text attributes for the file (can only be written)
"text": "A String", # The text to be indexed for this file.
},
- "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
+ "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
"explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
"isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
"lastModifyingUserName": "A String", # Name of the last user to modify this file.
- "writersCanShare": True or False, # Whether writers can share the document with other users.
- "owners": [ # The owner(s) of this file.
+ "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for Team Drive files.
+ "owners": [ # The owner(s) of this file. Not populated for Team Drive files.
{ # Information about a Drive user.
"picture": { # The user's profile picture.
"url": "A String", # A URL that points to a profile picture of this user.
@@ -3060,7 +3952,7 @@
"emailAddress": "A String", # The email address of the user.
},
],
- "ownedByMe": True or False, # Whether the file is owned by the current user.
+ "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for Team Drive files.
"id": "A String", # The ID of the file.
"sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
"picture": { # The user's profile picture.
@@ -3072,6 +3964,16 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
+ "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
+ "picture": { # The user's profile picture.
+ "url": "A String", # A URL that points to a profile picture of this user.
+ },
+ "kind": "drive#user", # This is always drive#user.
+ "displayName": "A String", # A plain text displayable name for this user.
+ "permissionId": "A String", # The user's ID as visible in the permissions collection.
+ "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
+ "emailAddress": "A String", # The email address of the user.
+ },
"mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
"lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
"picture": { # The user's profile picture.
@@ -3083,12 +3985,30 @@
"isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
"emailAddress": "A String", # The email address of the user.
},
- "copyable": True or False, # Whether the file can be copied by the current user.
- "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
+ "copyable": True or False, # Whether the file can be copied by the current user. Deprecated: use capabilities/canCopy.
+ "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files.
"markedViewedByMeDate": "A String", # Deprecated.
- "ownerNames": [ # Name(s) of the owner(s) of this file.
+ "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for Team Drive files.
"A String",
],
+ "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
+ "canTrash": True or False, # Whether the file can be trashed by the current user.
+ "canCopy": True or False, # Whether the file can be copied by the current user. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
+ "canShare": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "canDelete": True or False, # Whether the file can be deleted by the current user.
+ "canMoveTeamDriveItem": True or False, # Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
+ "canRename": True or False, # Whether the file can be renamed by the current user.
+ "canListChildren": True or False, # Whether the current user can list the children of this folder. This is always false when the item is not a folder.
+ "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
+ "canDownload": True or False, # Whether the file can be downloaded by the current user.
+ "canComment": True or False, # Whether the current user can comment on the file.
+ "canRemoveChildren": True or False, # Whether the current user can remove children from this folder. This is always false when the item is not a folder.
+ "canReadTeamDrive": True or False, # Whether the current user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
+ "canAddChildren": True or False, # Whether the current user can add children to this folder. This is always false when the item is not a folder.
+ "canEdit": True or False, # Whether the file can be edited by the current user.
+ "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
+ },
"sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
"webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
"etag": "A String", # ETag of the file.
@@ -3105,20 +4025,41 @@
"exportLinks": { # Links for exporting Google Docs to specific formats.
"a_key": "A String", # A mapping from export format to URL
},
- "shared": True or False, # Whether the file has been shared.
- "permissions": [ # The list of permissions for users with access to this file.
+ "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
+ "permissions": [ # The list of permissions for users with access to this file. Not populated for Team Drive files.
{ # A permission for a file.
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -3127,7 +4068,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -3138,7 +4079,7 @@
"openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
"a_key": "A String",
},
- "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
+ "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file. Deprecated: use capabilities/canReadRevisions.
"imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
"exposureBias": 3.14, # The exposure bias of the photo (APEX value).
"exposureTime": 3.14, # The length of the exposure, in seconds.
@@ -3173,12 +4114,13 @@
"durationMillis": "A String", # The duration of the video in milliseconds.
"height": 42, # The height of the video in pixels.
},
- "editable": True or False, # Whether the file can be edited by the current user.
+ "editable": True or False, # Whether the file can be edited by the current user. Deprecated: use capabilities/canEdit.
"kind": "drive#file", # The type of file. This is always drive#file.
- "canComment": True or False, # Whether the current user can comment on the file.
+ "canComment": True or False, # Whether the current user can comment on the file. Deprecated: use capabilities/canComment.
"quotaBytesUsed": "A String", # The number of quota bytes used by this file.
"fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
+ "teamDriveId": "A String", # ID of the Team Drive the file resides in.
"properties": [ # The list of properties.
{ # A key-value pair attached to a file that is either public or private to an application.
# The following limits apply to file properties:
@@ -3210,14 +4152,35 @@
"withLink": True or False, # Whether the link is required for this permission.
"domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
"name": "A String", # The name for this permission.
+ "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
+ {
+ "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
+ "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
+ # - organizer
+ # - reader
+ # - writer
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
+ "A String",
+ ],
+ "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
+ # - file
+ # - member
+ "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
+ },
+ ],
"kind": "drive#permission", # This is always drive#permission.
"value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
"authKey": "A String", # The authkey parameter required for this permission.
"etag": "A String", # The ETag of the permission.
"emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
- "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
- "role": "A String", # The primary role for this user. Allowed values are:
+ "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
+ # - They can only be set on user and group permissions
+ # - The date must be in the future
+ # - The date cannot be more than a year in the future
+ # - The date can only be set on drive.permissions.update requests
+ "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
+ # - organizer
# - owner
# - reader
# - writer
@@ -3226,7 +4189,7 @@
# - group
# - domain
# - anyone
- "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
+ "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
"A String",
],
"selfLink": "A String", # A link back to this permission.
@@ -3235,9 +4198,10 @@
"spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
"A String",
],
- "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
+ "shareable": True or False, # Whether the file's sharing settings can be modified by the current user. Deprecated: use capabilities/canShare.
"originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
"fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
+ "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
"headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
"selfLink": "A String", # A link back to this file.
"modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
@@ -3245,7 +4209,7 @@
</div>
<div class="method">
- <code class="details" id="watch">watch(fileId, body, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
+ <code class="details" id="watch">watch(fileId, body, projection=None, revisionId=None, supportsTeamDrives=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
<pre>Subscribe to changes on a file
Args:
@@ -3273,6 +4237,7 @@
BASIC - Deprecated
FULL - Deprecated
revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
+ supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.
@@ -3296,7 +4261,7 @@
</div>
<div class="method">
- <code class="details" id="watch_media">watch_media(fileId, body, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
+ <code class="details" id="watch_media">watch_media(fileId, body, projection=None, revisionId=None, supportsTeamDrives=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
<pre>Subscribe to changes on a file
Args:
@@ -3324,6 +4289,7 @@
BASIC - Deprecated
FULL - Deprecated
revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
+ supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.