1<html><body> 2<style> 3 4body, h1, h2, h3, div, span, p, pre, a { 5 margin: 0; 6 padding: 0; 7 border: 0; 8 font-weight: inherit; 9 font-style: inherit; 10 font-size: 100%; 11 font-family: inherit; 12 vertical-align: baseline; 13} 14 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, h2, h3 { 50 border-bottom: solid #CCC 1px; 51} 52 53.toc_element { 54 margin-top: 0.5em; 55} 56 57.firstline { 58 margin-left: 2 em; 59} 60 61.method { 62 margin-top: 1em; 63 border: solid 1px #CCC; 64 padding: 1em; 65 background: #EEE; 66} 67 68.details { 69 font-weight: bold; 70 font-size: 14px; 71} 72 73</style> 74 75<h1><a href="drive_v2.html">Drive API</a> . <a href="drive_v2.files.html">files</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#close">close()</a></code></p> 79<p class="firstline">Close httplib2 connections.</p> 80<p class="toc_element"> 81 <code><a href="#copy">copy(fileId, body=None, convert=None, enforceSingleParent=None, includePermissionsForView=None, ocr=None, ocrLanguage=None, pinned=None, supportsAllDrives=None, supportsTeamDrives=None, timedTextLanguage=None, timedTextTrackName=None, visibility=None)</a></code></p> 82<p class="firstline">Creates a copy of the specified file. Folders cannot be copied.</p> 83<p class="toc_element"> 84 <code><a href="#delete">delete(fileId, enforceSingleParent=None, supportsAllDrives=None, supportsTeamDrives=None)</a></code></p> 85<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 shared drive files.</p> 86<p class="toc_element"> 87 <code><a href="#emptyTrash">emptyTrash(enforceSingleParent=None)</a></code></p> 88<p class="firstline">Permanently deletes all of the user's trashed files.</p> 89<p class="toc_element"> 90 <code><a href="#export">export(fileId, mimeType)</a></code></p> 91<p class="firstline">Exports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB.</p> 92<p class="toc_element"> 93 <code><a href="#export_media">export_media(fileId, mimeType)</a></code></p> 94<p class="firstline">Exports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB.</p> 95<p class="toc_element"> 96 <code><a href="#generateIds">generateIds(maxResults=None, space=None, type=None)</a></code></p> 97<p class="firstline">Generates a set of file IDs which can be provided in insert or copy requests.</p> 98<p class="toc_element"> 99 <code><a href="#get">get(fileId, acknowledgeAbuse=None, includePermissionsForView=None, projection=None, revisionId=None, supportsAllDrives=None, supportsTeamDrives=None, updateViewedDate=None)</a></code></p> 100<p class="firstline">Gets a file's metadata or content by ID.</p> 101<p class="toc_element"> 102 <code><a href="#get_media">get_media(fileId, acknowledgeAbuse=None, includePermissionsForView=None, projection=None, revisionId=None, supportsAllDrives=None, supportsTeamDrives=None, updateViewedDate=None)</a></code></p> 103<p class="firstline">Gets a file's metadata or content by ID.</p> 104<p class="toc_element"> 105 <code><a href="#insert">insert(body=None, convert=None, enforceSingleParent=None, includePermissionsForView=None, media_body=None, media_mime_type=None, ocr=None, ocrLanguage=None, pinned=None, supportsAllDrives=None, supportsTeamDrives=None, timedTextLanguage=None, timedTextTrackName=None, useContentAsIndexableText=None, visibility=None)</a></code></p> 106<p class="firstline">Insert a new file.</p> 107<p class="toc_element"> 108 <code><a href="#list">list(corpora=None, corpus=None, driveId=None, includeItemsFromAllDrives=None, includePermissionsForView=None, includeTeamDriveItems=None, maxResults=None, orderBy=None, pageToken=None, projection=None, q=None, spaces=None, supportsAllDrives=None, supportsTeamDrives=None, teamDriveId=None)</a></code></p> 109<p class="firstline">Lists the user's files.</p> 110<p class="toc_element"> 111 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 112<p class="firstline">Retrieves the next page of results.</p> 113<p class="toc_element"> 114 <code><a href="#patch">patch(fileId, addParents=None, body=None, convert=None, enforceSingleParent=None, includePermissionsForView=None, modifiedDateBehavior=None, newRevision=None, ocr=None, ocrLanguage=None, pinned=None, removeParents=None, setModifiedDate=None, supportsAllDrives=None, supportsTeamDrives=None, timedTextLanguage=None, timedTextTrackName=None, updateViewedDate=None, useContentAsIndexableText=None)</a></code></p> 115<p class="firstline">Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might change automatically, such as modifiedDate. This method supports patch semantics.</p> 116<p class="toc_element"> 117 <code><a href="#touch">touch(fileId, includePermissionsForView=None, supportsAllDrives=None, supportsTeamDrives=None)</a></code></p> 118<p class="firstline">Set the file's updated time to the current server time.</p> 119<p class="toc_element"> 120 <code><a href="#trash">trash(fileId, includePermissionsForView=None, supportsAllDrives=None, supportsTeamDrives=None)</a></code></p> 121<p class="firstline">Moves a file to the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for shared drive files. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file.</p> 122<p class="toc_element"> 123 <code><a href="#untrash">untrash(fileId, includePermissionsForView=None, supportsAllDrives=None, supportsTeamDrives=None)</a></code></p> 124<p class="firstline">Restores a file from the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for shared drive files. Only the owner may untrash a file.</p> 125<p class="toc_element"> 126 <code><a href="#update">update(fileId, addParents=None, body=None, convert=None, enforceSingleParent=None, includePermissionsForView=None, media_body=None, media_mime_type=None, modifiedDateBehavior=None, newRevision=None, ocr=None, ocrLanguage=None, pinned=None, removeParents=None, setModifiedDate=None, supportsAllDrives=None, supportsTeamDrives=None, timedTextLanguage=None, timedTextTrackName=None, updateViewedDate=None, useContentAsIndexableText=None)</a></code></p> 127<p class="firstline">Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed automatically, such as modifiedDate. This method supports patch semantics.</p> 128<p class="toc_element"> 129 <code><a href="#watch">watch(fileId, acknowledgeAbuse=None, body=None, includePermissionsForView=None, projection=None, revisionId=None, supportsAllDrives=None, supportsTeamDrives=None, updateViewedDate=None)</a></code></p> 130<p class="firstline">Subscribe to changes on a file</p> 131<p class="toc_element"> 132 <code><a href="#watch_media">watch_media(fileId, acknowledgeAbuse=None, body=None, includePermissionsForView=None, projection=None, revisionId=None, supportsAllDrives=None, supportsTeamDrives=None, updateViewedDate=None)</a></code></p> 133<p class="firstline">Subscribe to changes on a file</p> 134<h3>Method Details</h3> 135<div class="method"> 136 <code class="details" id="close">close()</code> 137 <pre>Close httplib2 connections.</pre> 138</div> 139 140<div class="method"> 141 <code class="details" id="copy">copy(fileId, body=None, convert=None, enforceSingleParent=None, includePermissionsForView=None, ocr=None, ocrLanguage=None, pinned=None, supportsAllDrives=None, supportsTeamDrives=None, timedTextLanguage=None, timedTextTrackName=None, visibility=None)</code> 142 <pre>Creates a copy of the specified file. Folders cannot be copied. 143 144Args: 145 fileId: string, The ID of the file to copy. (required) 146 body: object, The request body. 147 The object takes the form of: 148 149{ # The metadata for a file. 150 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer. 151 "appDataContents": True or False, # Whether this file is in the Application Data folder. 152 "canComment": True or False, # Deprecated: use capabilities/canComment. 153 "canReadRevisions": True or False, # Deprecated: use capabilities/canReadRevisions. 154 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 155 "canAcceptOwnership": True or False, # Whether the current user is the pending owner of the file. Not populated for shared drive files. 156 "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. 157 "canAddFolderFromAnotherDrive": True or False, # Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. 158 "canAddMyDriveParent": True or False, # Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. 159 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 160 "canChangeRestrictedDownload": True or False, # Deprecated 161 "canChangeSecurityUpdateEnabled": True or False, # Whether the current user can change the securityUpdateEnabled field on link share metadata. 162 "canComment": True or False, # Whether the current user can comment on this file. 163 "canCopy": True or False, # Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. 164 "canDelete": True or False, # Whether the current user can delete this file. 165 "canDeleteChildren": True or False, # Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 166 "canDownload": True or False, # Whether the current user can download this file. 167 "canEdit": True or False, # Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. 168 "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. 169 "canModifyContent": True or False, # Whether the current user can modify the content of this file. 170 "canModifyContentRestriction": True or False, # Whether the current user can modify restrictions on content of this file. 171 "canMoveChildrenOutOfDrive": True or False, # Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 172 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 173 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. 174 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 175 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 176 "canMoveItemOutOfDrive": True or False, # Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. 177 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 178 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. 179 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 180 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 181 "canReadDrive": True or False, # Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. 182 "canReadRevisions": True or False, # Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. 183 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 184 "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. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. 185 "canRemoveMyDriveParent": True or False, # Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. 186 "canRename": True or False, # Whether the current user can rename this file. 187 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 188 "canTrash": True or False, # Whether the current user can move this file to trash. 189 "canTrashChildren": True or False, # Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 190 "canUntrash": True or False, # Whether the current user can restore this file from trash. 191 }, 192 "contentRestrictions": [ # Restrictions for accessing the content of the file. Only populated if such a restriction exists. 193 { # A restriction for accessing the content of the file. 194 "readOnly": True or False, # Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. 195 "reason": "A String", # Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. 196 "restrictingUser": { # Information about a Drive user. # The user who set the content restriction. Only populated if readOnly is true. 197 "displayName": "A String", # A plain text displayable name for this user. 198 "emailAddress": "A String", # The email address of the user. 199 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 200 "kind": "drive#user", # This is always drive#user. 201 "permissionId": "A String", # The user's ID as visible in the permissions collection. 202 "picture": { # The user's profile picture. 203 "url": "A String", # A URL that points to a profile picture of this user. 204 }, 205 }, 206 "restrictionDate": "A String", # The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. 207 "type": "A String", # The type of the content restriction. Currently the only possible value is globalContentRestriction. 208 }, 209 ], 210 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 211 "copyable": True or False, # Deprecated: use capabilities/canCopy. 212 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp). 213 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. 214 "description": "A String", # A short description of the file. 215 "downloadUrl": "A String", # Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 216 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 217 "editable": True or False, # Deprecated: use capabilities/canEdit. 218 "embedLink": "A String", # A link for embedding the file. 219 "etag": "A String", # ETag of the file. 220 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. 221 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 222 "a_key": "A String", # A mapping from export format to URL 223 }, 224 "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 Google Drive; it is not populated for Docs Editors or shortcut files. 225 "fileSize": "A String", # The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. 226 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder or a shortcut to 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. 227 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 228 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives. 229 "hasThumbnail": True or False, # Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. 230 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 231 "iconLink": "A String", # A link to the file's icon. 232 "id": "A String", # The ID of the file. 233 "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. 234 "aperture": 3.14, # The aperture used to create the photo (f-number). 235 "cameraMake": "A String", # The make of the camera used to create the photo. 236 "cameraModel": "A String", # The model of the camera used to create the photo. 237 "colorSpace": "A String", # The color space of the photo. 238 "date": "A String", # The date and time the photo was taken (EXIF format timestamp). 239 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 240 "exposureMode": "A String", # The exposure mode used to create the photo. 241 "exposureTime": 3.14, # The length of the exposure, in seconds. 242 "flashUsed": True or False, # Whether a flash was used to create the photo. 243 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 244 "height": 42, # The height of the image in pixels. 245 "isoSpeed": 42, # The ISO speed used to create the photo. 246 "lens": "A String", # The lens used to create the photo. 247 "location": { # Geographic location information stored in the image. 248 "altitude": 3.14, # The altitude stored in the image. 249 "latitude": 3.14, # The latitude stored in the image. 250 "longitude": 3.14, # The longitude stored in the image. 251 }, 252 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 253 "meteringMode": "A String", # The metering mode used to create the photo. 254 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation. 255 "sensor": "A String", # The type of sensor used to create the photo. 256 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 257 "whiteBalance": "A String", # The white balance mode used to create the photo. 258 "width": 42, # The width of the image in pixels. 259 }, 260 "indexableText": { # Indexable text attributes for the file (can only be written) 261 "text": "A String", # The text to be indexed for this file. 262 }, 263 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 264 "kind": "drive#file", # The type of file. This is always drive#file. 265 "labels": { # A group of labels for the file. 266 "hidden": True or False, # Deprecated. 267 "modified": True or False, # Whether the file has been modified by this user. 268 "restricted": True or False, # Deprecated - use copyRequiresWriterPermission instead. 269 "starred": True or False, # Whether this file is starred by the user. 270 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 271 "viewed": True or False, # Whether this file has been viewed by this user. 272 }, 273 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file. 274 "displayName": "A String", # A plain text displayable name for this user. 275 "emailAddress": "A String", # The email address of the user. 276 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 277 "kind": "drive#user", # This is always drive#user. 278 "permissionId": "A String", # The user's ID as visible in the permissions collection. 279 "picture": { # The user's profile picture. 280 "url": "A String", # A URL that points to a profile picture of this user. 281 }, 282 }, 283 "lastModifyingUserName": "A String", # Name of the last user to modify this file. 284 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp). 285 "linkShareMetadata": { # Contains details about the link URLs that clients are using to refer to this item. 286 "securityUpdateEligible": True or False, # Whether the file is eligible for security update. 287 "securityUpdateEnabled": True or False, # Whether the security update is enabled for this file. 288 }, 289 "markedViewedByMeDate": "A String", # Deprecated. 290 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 291 "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. 292 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. 293 "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. 294 "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. 295 "a_key": "A String", 296 }, 297 "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 Google Drive. 298 "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for items in shared drives. 299 "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for items in shared drives. 300 "A String", 301 ], 302 "owners": [ # The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. 303 { # Information about a Drive user. 304 "displayName": "A String", # A plain text displayable name for this user. 305 "emailAddress": "A String", # The email address of the user. 306 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 307 "kind": "drive#user", # This is always drive#user. 308 "permissionId": "A String", # The user's ID as visible in the permissions collection. 309 "picture": { # The user's profile picture. 310 "url": "A String", # A URL that points to a profile picture of this user. 311 }, 312 }, 313 ], 314 "parents": [ # Collection of parent folders which contain this file. 315 # If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list. 316 { # A reference to a file's parent. 317 "id": "A String", # The ID of the parent. 318 "isRoot": True or False, # Whether or not the parent is the root folder. 319 "kind": "drive#parentReference", # This is always drive#parentReference. 320 "parentLink": "A String", # A link to the parent. 321 "selfLink": "A String", # A link back to this reference. 322 }, 323 ], 324 "permissionIds": [ # List of permission IDs for users with access to this file. 325 "A String", 326 ], 327 "permissions": [ # The list of permissions for users with access to this file. Not populated for items in shared drives. 328 { # A permission for a file. 329 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 330 "A String", 331 ], 332 "authKey": "A String", # Deprecated. 333 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 334 "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. 335 "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. 336 "etag": "A String", # The ETag of the permission. 337 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 338 # - They cannot be set on shared drive items 339 # - They can only be set on user and group permissions 340 # - The date must be in the future 341 # - The date cannot be more than a year in the future 342 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 343 "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. 344 "kind": "drive#permission", # This is always drive#permission. 345 "name": "A String", # The name for this permission. 346 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 347 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 348 { 349 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 350 "A String", 351 ], 352 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 353 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 354 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 355 # - file 356 # - member 357 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 358 # - organizer 359 # - fileOrganizer 360 # - writer 361 # - reader 362 }, 363 ], 364 "photoLink": "A String", # A link to the profile photo, if available. 365 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 366 # - owner 367 # - organizer 368 # - fileOrganizer 369 # - writer 370 # - reader 371 "selfLink": "A String", # A link back to this permission. 372 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 373 { 374 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 375 "A String", 376 ], 377 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 378 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 379 "role": "A String", # Deprecated - use permissionDetails/role instead. 380 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 381 }, 382 ], 383 "type": "A String", # The account type. Allowed values are: 384 # - user 385 # - group 386 # - domain 387 # - anyone 388 "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. 389 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 390 "withLink": True or False, # Whether the link is required for this permission. 391 }, 392 ], 393 "properties": [ # The list of properties. 394 { # A key-value pair attached to a file that is either public or private to an application. 395 # The following limits apply to file properties: 396 # - Maximum of 100 properties total per file 397 # - Maximum of 30 private properties per app 398 # - Maximum of 30 public properties 399 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. 400 "etag": "A String", # ETag of the property. 401 "key": "A String", # The key of this property. 402 "kind": "drive#property", # This is always drive#property. 403 "selfLink": "A String", # The link back to this property. 404 "value": "A String", # The value of this property. 405 "visibility": "A String", # The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. 406 }, 407 ], 408 "quotaBytesUsed": "A String", # The number of quota bytes used by this file. 409 "resourceKey": "A String", # A key needed to access the item via a shared link. 410 "selfLink": "A String", # A link back to this file. 411 "shareable": True or False, # Deprecated: use capabilities/canShare. 412 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 413 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp). 414 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available. 415 "displayName": "A String", # A plain text displayable name for this user. 416 "emailAddress": "A String", # The email address of the user. 417 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 418 "kind": "drive#user", # This is always drive#user. 419 "permissionId": "A String", # The user's ID as visible in the permissions collection. 420 "picture": { # The user's profile picture. 421 "url": "A String", # A URL that points to a profile picture of this user. 422 }, 423 }, 424 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. 425 "targetId": "A String", # The ID of the file that this shortcut points to. 426 "targetMimeType": "A String", # The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. 427 "targetResourceKey": "A String", # The ResourceKey for the target file. 428 }, 429 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. 430 "A String", 431 ], 432 "teamDriveId": "A String", # Deprecated - use driveId instead. 433 "thumbnail": { # A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. 434 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. 435 "mimeType": "A String", # The MIME type of the thumbnail. 436 }, 437 "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. 438 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 439 "title": "A String", # The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. 440 "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. 441 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. 442 "displayName": "A String", # A plain text displayable name for this user. 443 "emailAddress": "A String", # The email address of the user. 444 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 445 "kind": "drive#user", # This is always drive#user. 446 "permissionId": "A String", # The user's ID as visible in the permissions collection. 447 "picture": { # The user's profile picture. 448 "url": "A String", # A URL that points to a profile picture of this user. 449 }, 450 }, 451 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file. 452 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 453 "A String", 454 ], 455 "authKey": "A String", # Deprecated. 456 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 457 "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. 458 "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. 459 "etag": "A String", # The ETag of the permission. 460 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 461 # - They cannot be set on shared drive items 462 # - They can only be set on user and group permissions 463 # - The date must be in the future 464 # - The date cannot be more than a year in the future 465 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 466 "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. 467 "kind": "drive#permission", # This is always drive#permission. 468 "name": "A String", # The name for this permission. 469 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 470 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 471 { 472 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 473 "A String", 474 ], 475 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 476 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 477 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 478 # - file 479 # - member 480 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 481 # - organizer 482 # - fileOrganizer 483 # - writer 484 # - reader 485 }, 486 ], 487 "photoLink": "A String", # A link to the profile photo, if available. 488 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 489 # - owner 490 # - organizer 491 # - fileOrganizer 492 # - writer 493 # - reader 494 "selfLink": "A String", # A link back to this permission. 495 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 496 { 497 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 498 "A String", 499 ], 500 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 501 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 502 "role": "A String", # Deprecated - use permissionDetails/role instead. 503 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 504 }, 505 ], 506 "type": "A String", # The account type. Allowed values are: 507 # - user 508 # - group 509 # - domain 510 # - anyone 511 "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. 512 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 513 "withLink": True or False, # Whether the link is required for this permission. 514 }, 515 "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. 516 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types. 517 "durationMillis": "A String", # The duration of the video in milliseconds. 518 "height": 42, # The height of the video in pixels. 519 "width": 42, # The width of the video in pixels. 520 }, 521 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. 522 "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. 523 "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for items in shared drives. 524} 525 526 convert: boolean, Whether to convert this file to the corresponding Docs Editors format. 527 enforceSingleParent: boolean, Deprecated. Copying files into multiple folders is no longer supported. Use shortcuts instead. 528 includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. 529 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. 530 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes. 531 pinned: boolean, Whether to pin the head revision of the new copy. A file can have a maximum of 200 pinned revisions. 532 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 533 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 534 timedTextLanguage: string, The language of the timed text. 535 timedTextTrackName: string, The timed text track name. 536 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. 537 Allowed values 538 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies. 539 PRIVATE - The new file will be visible to only the owner. 540 541Returns: 542 An object of the form: 543 544 { # The metadata for a file. 545 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer. 546 "appDataContents": True or False, # Whether this file is in the Application Data folder. 547 "canComment": True or False, # Deprecated: use capabilities/canComment. 548 "canReadRevisions": True or False, # Deprecated: use capabilities/canReadRevisions. 549 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 550 "canAcceptOwnership": True or False, # Whether the current user is the pending owner of the file. Not populated for shared drive files. 551 "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. 552 "canAddFolderFromAnotherDrive": True or False, # Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. 553 "canAddMyDriveParent": True or False, # Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. 554 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 555 "canChangeRestrictedDownload": True or False, # Deprecated 556 "canChangeSecurityUpdateEnabled": True or False, # Whether the current user can change the securityUpdateEnabled field on link share metadata. 557 "canComment": True or False, # Whether the current user can comment on this file. 558 "canCopy": True or False, # Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. 559 "canDelete": True or False, # Whether the current user can delete this file. 560 "canDeleteChildren": True or False, # Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 561 "canDownload": True or False, # Whether the current user can download this file. 562 "canEdit": True or False, # Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. 563 "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. 564 "canModifyContent": True or False, # Whether the current user can modify the content of this file. 565 "canModifyContentRestriction": True or False, # Whether the current user can modify restrictions on content of this file. 566 "canMoveChildrenOutOfDrive": True or False, # Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 567 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 568 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. 569 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 570 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 571 "canMoveItemOutOfDrive": True or False, # Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. 572 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 573 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. 574 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 575 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 576 "canReadDrive": True or False, # Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. 577 "canReadRevisions": True or False, # Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. 578 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 579 "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. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. 580 "canRemoveMyDriveParent": True or False, # Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. 581 "canRename": True or False, # Whether the current user can rename this file. 582 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 583 "canTrash": True or False, # Whether the current user can move this file to trash. 584 "canTrashChildren": True or False, # Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 585 "canUntrash": True or False, # Whether the current user can restore this file from trash. 586 }, 587 "contentRestrictions": [ # Restrictions for accessing the content of the file. Only populated if such a restriction exists. 588 { # A restriction for accessing the content of the file. 589 "readOnly": True or False, # Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. 590 "reason": "A String", # Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. 591 "restrictingUser": { # Information about a Drive user. # The user who set the content restriction. Only populated if readOnly is true. 592 "displayName": "A String", # A plain text displayable name for this user. 593 "emailAddress": "A String", # The email address of the user. 594 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 595 "kind": "drive#user", # This is always drive#user. 596 "permissionId": "A String", # The user's ID as visible in the permissions collection. 597 "picture": { # The user's profile picture. 598 "url": "A String", # A URL that points to a profile picture of this user. 599 }, 600 }, 601 "restrictionDate": "A String", # The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. 602 "type": "A String", # The type of the content restriction. Currently the only possible value is globalContentRestriction. 603 }, 604 ], 605 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 606 "copyable": True or False, # Deprecated: use capabilities/canCopy. 607 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp). 608 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. 609 "description": "A String", # A short description of the file. 610 "downloadUrl": "A String", # Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 611 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 612 "editable": True or False, # Deprecated: use capabilities/canEdit. 613 "embedLink": "A String", # A link for embedding the file. 614 "etag": "A String", # ETag of the file. 615 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. 616 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 617 "a_key": "A String", # A mapping from export format to URL 618 }, 619 "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 Google Drive; it is not populated for Docs Editors or shortcut files. 620 "fileSize": "A String", # The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. 621 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder or a shortcut to 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. 622 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 623 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives. 624 "hasThumbnail": True or False, # Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. 625 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 626 "iconLink": "A String", # A link to the file's icon. 627 "id": "A String", # The ID of the file. 628 "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. 629 "aperture": 3.14, # The aperture used to create the photo (f-number). 630 "cameraMake": "A String", # The make of the camera used to create the photo. 631 "cameraModel": "A String", # The model of the camera used to create the photo. 632 "colorSpace": "A String", # The color space of the photo. 633 "date": "A String", # The date and time the photo was taken (EXIF format timestamp). 634 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 635 "exposureMode": "A String", # The exposure mode used to create the photo. 636 "exposureTime": 3.14, # The length of the exposure, in seconds. 637 "flashUsed": True or False, # Whether a flash was used to create the photo. 638 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 639 "height": 42, # The height of the image in pixels. 640 "isoSpeed": 42, # The ISO speed used to create the photo. 641 "lens": "A String", # The lens used to create the photo. 642 "location": { # Geographic location information stored in the image. 643 "altitude": 3.14, # The altitude stored in the image. 644 "latitude": 3.14, # The latitude stored in the image. 645 "longitude": 3.14, # The longitude stored in the image. 646 }, 647 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 648 "meteringMode": "A String", # The metering mode used to create the photo. 649 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation. 650 "sensor": "A String", # The type of sensor used to create the photo. 651 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 652 "whiteBalance": "A String", # The white balance mode used to create the photo. 653 "width": 42, # The width of the image in pixels. 654 }, 655 "indexableText": { # Indexable text attributes for the file (can only be written) 656 "text": "A String", # The text to be indexed for this file. 657 }, 658 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 659 "kind": "drive#file", # The type of file. This is always drive#file. 660 "labels": { # A group of labels for the file. 661 "hidden": True or False, # Deprecated. 662 "modified": True or False, # Whether the file has been modified by this user. 663 "restricted": True or False, # Deprecated - use copyRequiresWriterPermission instead. 664 "starred": True or False, # Whether this file is starred by the user. 665 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 666 "viewed": True or False, # Whether this file has been viewed by this user. 667 }, 668 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file. 669 "displayName": "A String", # A plain text displayable name for this user. 670 "emailAddress": "A String", # The email address of the user. 671 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 672 "kind": "drive#user", # This is always drive#user. 673 "permissionId": "A String", # The user's ID as visible in the permissions collection. 674 "picture": { # The user's profile picture. 675 "url": "A String", # A URL that points to a profile picture of this user. 676 }, 677 }, 678 "lastModifyingUserName": "A String", # Name of the last user to modify this file. 679 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp). 680 "linkShareMetadata": { # Contains details about the link URLs that clients are using to refer to this item. 681 "securityUpdateEligible": True or False, # Whether the file is eligible for security update. 682 "securityUpdateEnabled": True or False, # Whether the security update is enabled for this file. 683 }, 684 "markedViewedByMeDate": "A String", # Deprecated. 685 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 686 "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. 687 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. 688 "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. 689 "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. 690 "a_key": "A String", 691 }, 692 "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 Google Drive. 693 "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for items in shared drives. 694 "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for items in shared drives. 695 "A String", 696 ], 697 "owners": [ # The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. 698 { # Information about a Drive user. 699 "displayName": "A String", # A plain text displayable name for this user. 700 "emailAddress": "A String", # The email address of the user. 701 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 702 "kind": "drive#user", # This is always drive#user. 703 "permissionId": "A String", # The user's ID as visible in the permissions collection. 704 "picture": { # The user's profile picture. 705 "url": "A String", # A URL that points to a profile picture of this user. 706 }, 707 }, 708 ], 709 "parents": [ # Collection of parent folders which contain this file. 710 # If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list. 711 { # A reference to a file's parent. 712 "id": "A String", # The ID of the parent. 713 "isRoot": True or False, # Whether or not the parent is the root folder. 714 "kind": "drive#parentReference", # This is always drive#parentReference. 715 "parentLink": "A String", # A link to the parent. 716 "selfLink": "A String", # A link back to this reference. 717 }, 718 ], 719 "permissionIds": [ # List of permission IDs for users with access to this file. 720 "A String", 721 ], 722 "permissions": [ # The list of permissions for users with access to this file. Not populated for items in shared drives. 723 { # A permission for a file. 724 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 725 "A String", 726 ], 727 "authKey": "A String", # Deprecated. 728 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 729 "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. 730 "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. 731 "etag": "A String", # The ETag of the permission. 732 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 733 # - They cannot be set on shared drive items 734 # - They can only be set on user and group permissions 735 # - The date must be in the future 736 # - The date cannot be more than a year in the future 737 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 738 "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. 739 "kind": "drive#permission", # This is always drive#permission. 740 "name": "A String", # The name for this permission. 741 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 742 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 743 { 744 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 745 "A String", 746 ], 747 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 748 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 749 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 750 # - file 751 # - member 752 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 753 # - organizer 754 # - fileOrganizer 755 # - writer 756 # - reader 757 }, 758 ], 759 "photoLink": "A String", # A link to the profile photo, if available. 760 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 761 # - owner 762 # - organizer 763 # - fileOrganizer 764 # - writer 765 # - reader 766 "selfLink": "A String", # A link back to this permission. 767 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 768 { 769 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 770 "A String", 771 ], 772 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 773 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 774 "role": "A String", # Deprecated - use permissionDetails/role instead. 775 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 776 }, 777 ], 778 "type": "A String", # The account type. Allowed values are: 779 # - user 780 # - group 781 # - domain 782 # - anyone 783 "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. 784 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 785 "withLink": True or False, # Whether the link is required for this permission. 786 }, 787 ], 788 "properties": [ # The list of properties. 789 { # A key-value pair attached to a file that is either public or private to an application. 790 # The following limits apply to file properties: 791 # - Maximum of 100 properties total per file 792 # - Maximum of 30 private properties per app 793 # - Maximum of 30 public properties 794 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. 795 "etag": "A String", # ETag of the property. 796 "key": "A String", # The key of this property. 797 "kind": "drive#property", # This is always drive#property. 798 "selfLink": "A String", # The link back to this property. 799 "value": "A String", # The value of this property. 800 "visibility": "A String", # The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. 801 }, 802 ], 803 "quotaBytesUsed": "A String", # The number of quota bytes used by this file. 804 "resourceKey": "A String", # A key needed to access the item via a shared link. 805 "selfLink": "A String", # A link back to this file. 806 "shareable": True or False, # Deprecated: use capabilities/canShare. 807 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 808 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp). 809 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available. 810 "displayName": "A String", # A plain text displayable name for this user. 811 "emailAddress": "A String", # The email address of the user. 812 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 813 "kind": "drive#user", # This is always drive#user. 814 "permissionId": "A String", # The user's ID as visible in the permissions collection. 815 "picture": { # The user's profile picture. 816 "url": "A String", # A URL that points to a profile picture of this user. 817 }, 818 }, 819 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. 820 "targetId": "A String", # The ID of the file that this shortcut points to. 821 "targetMimeType": "A String", # The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. 822 "targetResourceKey": "A String", # The ResourceKey for the target file. 823 }, 824 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. 825 "A String", 826 ], 827 "teamDriveId": "A String", # Deprecated - use driveId instead. 828 "thumbnail": { # A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. 829 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. 830 "mimeType": "A String", # The MIME type of the thumbnail. 831 }, 832 "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. 833 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 834 "title": "A String", # The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. 835 "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. 836 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. 837 "displayName": "A String", # A plain text displayable name for this user. 838 "emailAddress": "A String", # The email address of the user. 839 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 840 "kind": "drive#user", # This is always drive#user. 841 "permissionId": "A String", # The user's ID as visible in the permissions collection. 842 "picture": { # The user's profile picture. 843 "url": "A String", # A URL that points to a profile picture of this user. 844 }, 845 }, 846 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file. 847 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 848 "A String", 849 ], 850 "authKey": "A String", # Deprecated. 851 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 852 "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. 853 "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. 854 "etag": "A String", # The ETag of the permission. 855 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 856 # - They cannot be set on shared drive items 857 # - They can only be set on user and group permissions 858 # - The date must be in the future 859 # - The date cannot be more than a year in the future 860 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 861 "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. 862 "kind": "drive#permission", # This is always drive#permission. 863 "name": "A String", # The name for this permission. 864 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 865 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 866 { 867 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 868 "A String", 869 ], 870 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 871 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 872 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 873 # - file 874 # - member 875 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 876 # - organizer 877 # - fileOrganizer 878 # - writer 879 # - reader 880 }, 881 ], 882 "photoLink": "A String", # A link to the profile photo, if available. 883 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 884 # - owner 885 # - organizer 886 # - fileOrganizer 887 # - writer 888 # - reader 889 "selfLink": "A String", # A link back to this permission. 890 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 891 { 892 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 893 "A String", 894 ], 895 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 896 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 897 "role": "A String", # Deprecated - use permissionDetails/role instead. 898 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 899 }, 900 ], 901 "type": "A String", # The account type. Allowed values are: 902 # - user 903 # - group 904 # - domain 905 # - anyone 906 "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. 907 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 908 "withLink": True or False, # Whether the link is required for this permission. 909 }, 910 "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. 911 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types. 912 "durationMillis": "A String", # The duration of the video in milliseconds. 913 "height": 42, # The height of the video in pixels. 914 "width": 42, # The width of the video in pixels. 915 }, 916 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. 917 "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. 918 "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for items in shared drives. 919}</pre> 920</div> 921 922<div class="method"> 923 <code class="details" id="delete">delete(fileId, enforceSingleParent=None, supportsAllDrives=None, supportsTeamDrives=None)</code> 924 <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 shared drive files. 925 926Args: 927 fileId: string, The ID of the file to delete. (required) 928 enforceSingleParent: boolean, Deprecated. If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item will be placed under its owner's root. 929 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 930 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 931</pre> 932</div> 933 934<div class="method"> 935 <code class="details" id="emptyTrash">emptyTrash(enforceSingleParent=None)</code> 936 <pre>Permanently deletes all of the user's trashed files. 937 938Args: 939 enforceSingleParent: boolean, Deprecated. If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item will be placed under its owner's root. 940</pre> 941</div> 942 943<div class="method"> 944 <code class="details" id="export">export(fileId, mimeType)</code> 945 <pre>Exports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB. 946 947Args: 948 fileId: string, The ID of the file. (required) 949 mimeType: string, The MIME type of the format requested for this export. (required) 950</pre> 951</div> 952 953<div class="method"> 954 <code class="details" id="export_media">export_media(fileId, mimeType)</code> 955 <pre>Exports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB. 956 957Args: 958 fileId: string, The ID of the file. (required) 959 mimeType: string, The MIME type of the format requested for this export. (required) 960</pre> 961</div> 962 963<div class="method"> 964 <code class="details" id="generateIds">generateIds(maxResults=None, space=None, type=None)</code> 965 <pre>Generates a set of file IDs which can be provided in insert or copy requests. 966 967Args: 968 maxResults: integer, Maximum number of IDs to return. 969 space: string, The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. (Default: 'drive') 970 type: string, The type of items which the IDs can be used for. Supported values are 'files' and 'shortcuts'. Note that 'shortcuts' are only supported in the drive 'space'. (Default: 'files') 971 972Returns: 973 An object of the form: 974 975 { # A list of generated IDs which can be provided in insert requests 976 "ids": [ # The IDs generated for the requesting user in the specified space. 977 "A String", 978 ], 979 "kind": "drive#generatedIds", # This is always drive#generatedIds 980 "space": "A String", # The type of file that can be created with these IDs. 981}</pre> 982</div> 983 984<div class="method"> 985 <code class="details" id="get">get(fileId, acknowledgeAbuse=None, includePermissionsForView=None, projection=None, revisionId=None, supportsAllDrives=None, supportsTeamDrives=None, updateViewedDate=None)</code> 986 <pre>Gets a file's metadata or content by ID. 987 988Args: 989 fileId: string, The ID for the file in question. (required) 990 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. 991 includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. 992 projection: string, This parameter is deprecated and has no function. 993 Allowed values 994 BASIC - Deprecated 995 FULL - Deprecated 996 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. 997 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 998 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 999 updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body. 1000 1001Returns: 1002 An object of the form: 1003 1004 { # The metadata for a file. 1005 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer. 1006 "appDataContents": True or False, # Whether this file is in the Application Data folder. 1007 "canComment": True or False, # Deprecated: use capabilities/canComment. 1008 "canReadRevisions": True or False, # Deprecated: use capabilities/canReadRevisions. 1009 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 1010 "canAcceptOwnership": True or False, # Whether the current user is the pending owner of the file. Not populated for shared drive files. 1011 "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. 1012 "canAddFolderFromAnotherDrive": True or False, # Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. 1013 "canAddMyDriveParent": True or False, # Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. 1014 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 1015 "canChangeRestrictedDownload": True or False, # Deprecated 1016 "canChangeSecurityUpdateEnabled": True or False, # Whether the current user can change the securityUpdateEnabled field on link share metadata. 1017 "canComment": True or False, # Whether the current user can comment on this file. 1018 "canCopy": True or False, # Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. 1019 "canDelete": True or False, # Whether the current user can delete this file. 1020 "canDeleteChildren": True or False, # Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 1021 "canDownload": True or False, # Whether the current user can download this file. 1022 "canEdit": True or False, # Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. 1023 "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. 1024 "canModifyContent": True or False, # Whether the current user can modify the content of this file. 1025 "canModifyContentRestriction": True or False, # Whether the current user can modify restrictions on content of this file. 1026 "canMoveChildrenOutOfDrive": True or False, # Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 1027 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 1028 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. 1029 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 1030 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1031 "canMoveItemOutOfDrive": True or False, # Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. 1032 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1033 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. 1034 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 1035 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 1036 "canReadDrive": True or False, # Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. 1037 "canReadRevisions": True or False, # Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. 1038 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 1039 "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. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. 1040 "canRemoveMyDriveParent": True or False, # Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. 1041 "canRename": True or False, # Whether the current user can rename this file. 1042 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 1043 "canTrash": True or False, # Whether the current user can move this file to trash. 1044 "canTrashChildren": True or False, # Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 1045 "canUntrash": True or False, # Whether the current user can restore this file from trash. 1046 }, 1047 "contentRestrictions": [ # Restrictions for accessing the content of the file. Only populated if such a restriction exists. 1048 { # A restriction for accessing the content of the file. 1049 "readOnly": True or False, # Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. 1050 "reason": "A String", # Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. 1051 "restrictingUser": { # Information about a Drive user. # The user who set the content restriction. Only populated if readOnly is true. 1052 "displayName": "A String", # A plain text displayable name for this user. 1053 "emailAddress": "A String", # The email address of the user. 1054 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 1055 "kind": "drive#user", # This is always drive#user. 1056 "permissionId": "A String", # The user's ID as visible in the permissions collection. 1057 "picture": { # The user's profile picture. 1058 "url": "A String", # A URL that points to a profile picture of this user. 1059 }, 1060 }, 1061 "restrictionDate": "A String", # The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. 1062 "type": "A String", # The type of the content restriction. Currently the only possible value is globalContentRestriction. 1063 }, 1064 ], 1065 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 1066 "copyable": True or False, # Deprecated: use capabilities/canCopy. 1067 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp). 1068 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. 1069 "description": "A String", # A short description of the file. 1070 "downloadUrl": "A String", # Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 1071 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 1072 "editable": True or False, # Deprecated: use capabilities/canEdit. 1073 "embedLink": "A String", # A link for embedding the file. 1074 "etag": "A String", # ETag of the file. 1075 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. 1076 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 1077 "a_key": "A String", # A mapping from export format to URL 1078 }, 1079 "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 Google Drive; it is not populated for Docs Editors or shortcut files. 1080 "fileSize": "A String", # The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. 1081 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder or a shortcut to 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. 1082 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 1083 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives. 1084 "hasThumbnail": True or False, # Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. 1085 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 1086 "iconLink": "A String", # A link to the file's icon. 1087 "id": "A String", # The ID of the file. 1088 "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. 1089 "aperture": 3.14, # The aperture used to create the photo (f-number). 1090 "cameraMake": "A String", # The make of the camera used to create the photo. 1091 "cameraModel": "A String", # The model of the camera used to create the photo. 1092 "colorSpace": "A String", # The color space of the photo. 1093 "date": "A String", # The date and time the photo was taken (EXIF format timestamp). 1094 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 1095 "exposureMode": "A String", # The exposure mode used to create the photo. 1096 "exposureTime": 3.14, # The length of the exposure, in seconds. 1097 "flashUsed": True or False, # Whether a flash was used to create the photo. 1098 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 1099 "height": 42, # The height of the image in pixels. 1100 "isoSpeed": 42, # The ISO speed used to create the photo. 1101 "lens": "A String", # The lens used to create the photo. 1102 "location": { # Geographic location information stored in the image. 1103 "altitude": 3.14, # The altitude stored in the image. 1104 "latitude": 3.14, # The latitude stored in the image. 1105 "longitude": 3.14, # The longitude stored in the image. 1106 }, 1107 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 1108 "meteringMode": "A String", # The metering mode used to create the photo. 1109 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation. 1110 "sensor": "A String", # The type of sensor used to create the photo. 1111 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 1112 "whiteBalance": "A String", # The white balance mode used to create the photo. 1113 "width": 42, # The width of the image in pixels. 1114 }, 1115 "indexableText": { # Indexable text attributes for the file (can only be written) 1116 "text": "A String", # The text to be indexed for this file. 1117 }, 1118 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 1119 "kind": "drive#file", # The type of file. This is always drive#file. 1120 "labels": { # A group of labels for the file. 1121 "hidden": True or False, # Deprecated. 1122 "modified": True or False, # Whether the file has been modified by this user. 1123 "restricted": True or False, # Deprecated - use copyRequiresWriterPermission instead. 1124 "starred": True or False, # Whether this file is starred by the user. 1125 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 1126 "viewed": True or False, # Whether this file has been viewed by this user. 1127 }, 1128 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file. 1129 "displayName": "A String", # A plain text displayable name for this user. 1130 "emailAddress": "A String", # The email address of the user. 1131 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 1132 "kind": "drive#user", # This is always drive#user. 1133 "permissionId": "A String", # The user's ID as visible in the permissions collection. 1134 "picture": { # The user's profile picture. 1135 "url": "A String", # A URL that points to a profile picture of this user. 1136 }, 1137 }, 1138 "lastModifyingUserName": "A String", # Name of the last user to modify this file. 1139 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp). 1140 "linkShareMetadata": { # Contains details about the link URLs that clients are using to refer to this item. 1141 "securityUpdateEligible": True or False, # Whether the file is eligible for security update. 1142 "securityUpdateEnabled": True or False, # Whether the security update is enabled for this file. 1143 }, 1144 "markedViewedByMeDate": "A String", # Deprecated. 1145 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 1146 "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. 1147 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. 1148 "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. 1149 "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. 1150 "a_key": "A String", 1151 }, 1152 "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 Google Drive. 1153 "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for items in shared drives. 1154 "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for items in shared drives. 1155 "A String", 1156 ], 1157 "owners": [ # The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. 1158 { # Information about a Drive user. 1159 "displayName": "A String", # A plain text displayable name for this user. 1160 "emailAddress": "A String", # The email address of the user. 1161 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 1162 "kind": "drive#user", # This is always drive#user. 1163 "permissionId": "A String", # The user's ID as visible in the permissions collection. 1164 "picture": { # The user's profile picture. 1165 "url": "A String", # A URL that points to a profile picture of this user. 1166 }, 1167 }, 1168 ], 1169 "parents": [ # Collection of parent folders which contain this file. 1170 # If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list. 1171 { # A reference to a file's parent. 1172 "id": "A String", # The ID of the parent. 1173 "isRoot": True or False, # Whether or not the parent is the root folder. 1174 "kind": "drive#parentReference", # This is always drive#parentReference. 1175 "parentLink": "A String", # A link to the parent. 1176 "selfLink": "A String", # A link back to this reference. 1177 }, 1178 ], 1179 "permissionIds": [ # List of permission IDs for users with access to this file. 1180 "A String", 1181 ], 1182 "permissions": [ # The list of permissions for users with access to this file. Not populated for items in shared drives. 1183 { # A permission for a file. 1184 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 1185 "A String", 1186 ], 1187 "authKey": "A String", # Deprecated. 1188 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 1189 "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. 1190 "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. 1191 "etag": "A String", # The ETag of the permission. 1192 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 1193 # - They cannot be set on shared drive items 1194 # - They can only be set on user and group permissions 1195 # - The date must be in the future 1196 # - The date cannot be more than a year in the future 1197 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 1198 "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. 1199 "kind": "drive#permission", # This is always drive#permission. 1200 "name": "A String", # The name for this permission. 1201 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 1202 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 1203 { 1204 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 1205 "A String", 1206 ], 1207 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 1208 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 1209 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 1210 # - file 1211 # - member 1212 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 1213 # - organizer 1214 # - fileOrganizer 1215 # - writer 1216 # - reader 1217 }, 1218 ], 1219 "photoLink": "A String", # A link to the profile photo, if available. 1220 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 1221 # - owner 1222 # - organizer 1223 # - fileOrganizer 1224 # - writer 1225 # - reader 1226 "selfLink": "A String", # A link back to this permission. 1227 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 1228 { 1229 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 1230 "A String", 1231 ], 1232 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 1233 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 1234 "role": "A String", # Deprecated - use permissionDetails/role instead. 1235 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 1236 }, 1237 ], 1238 "type": "A String", # The account type. Allowed values are: 1239 # - user 1240 # - group 1241 # - domain 1242 # - anyone 1243 "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. 1244 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 1245 "withLink": True or False, # Whether the link is required for this permission. 1246 }, 1247 ], 1248 "properties": [ # The list of properties. 1249 { # A key-value pair attached to a file that is either public or private to an application. 1250 # The following limits apply to file properties: 1251 # - Maximum of 100 properties total per file 1252 # - Maximum of 30 private properties per app 1253 # - Maximum of 30 public properties 1254 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. 1255 "etag": "A String", # ETag of the property. 1256 "key": "A String", # The key of this property. 1257 "kind": "drive#property", # This is always drive#property. 1258 "selfLink": "A String", # The link back to this property. 1259 "value": "A String", # The value of this property. 1260 "visibility": "A String", # The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. 1261 }, 1262 ], 1263 "quotaBytesUsed": "A String", # The number of quota bytes used by this file. 1264 "resourceKey": "A String", # A key needed to access the item via a shared link. 1265 "selfLink": "A String", # A link back to this file. 1266 "shareable": True or False, # Deprecated: use capabilities/canShare. 1267 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 1268 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp). 1269 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available. 1270 "displayName": "A String", # A plain text displayable name for this user. 1271 "emailAddress": "A String", # The email address of the user. 1272 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 1273 "kind": "drive#user", # This is always drive#user. 1274 "permissionId": "A String", # The user's ID as visible in the permissions collection. 1275 "picture": { # The user's profile picture. 1276 "url": "A String", # A URL that points to a profile picture of this user. 1277 }, 1278 }, 1279 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. 1280 "targetId": "A String", # The ID of the file that this shortcut points to. 1281 "targetMimeType": "A String", # The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. 1282 "targetResourceKey": "A String", # The ResourceKey for the target file. 1283 }, 1284 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. 1285 "A String", 1286 ], 1287 "teamDriveId": "A String", # Deprecated - use driveId instead. 1288 "thumbnail": { # A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. 1289 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. 1290 "mimeType": "A String", # The MIME type of the thumbnail. 1291 }, 1292 "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. 1293 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 1294 "title": "A String", # The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. 1295 "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. 1296 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. 1297 "displayName": "A String", # A plain text displayable name for this user. 1298 "emailAddress": "A String", # The email address of the user. 1299 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 1300 "kind": "drive#user", # This is always drive#user. 1301 "permissionId": "A String", # The user's ID as visible in the permissions collection. 1302 "picture": { # The user's profile picture. 1303 "url": "A String", # A URL that points to a profile picture of this user. 1304 }, 1305 }, 1306 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file. 1307 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 1308 "A String", 1309 ], 1310 "authKey": "A String", # Deprecated. 1311 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 1312 "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. 1313 "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. 1314 "etag": "A String", # The ETag of the permission. 1315 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 1316 # - They cannot be set on shared drive items 1317 # - They can only be set on user and group permissions 1318 # - The date must be in the future 1319 # - The date cannot be more than a year in the future 1320 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 1321 "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. 1322 "kind": "drive#permission", # This is always drive#permission. 1323 "name": "A String", # The name for this permission. 1324 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 1325 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 1326 { 1327 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 1328 "A String", 1329 ], 1330 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 1331 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 1332 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 1333 # - file 1334 # - member 1335 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 1336 # - organizer 1337 # - fileOrganizer 1338 # - writer 1339 # - reader 1340 }, 1341 ], 1342 "photoLink": "A String", # A link to the profile photo, if available. 1343 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 1344 # - owner 1345 # - organizer 1346 # - fileOrganizer 1347 # - writer 1348 # - reader 1349 "selfLink": "A String", # A link back to this permission. 1350 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 1351 { 1352 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 1353 "A String", 1354 ], 1355 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 1356 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 1357 "role": "A String", # Deprecated - use permissionDetails/role instead. 1358 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 1359 }, 1360 ], 1361 "type": "A String", # The account type. Allowed values are: 1362 # - user 1363 # - group 1364 # - domain 1365 # - anyone 1366 "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. 1367 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 1368 "withLink": True or False, # Whether the link is required for this permission. 1369 }, 1370 "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. 1371 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types. 1372 "durationMillis": "A String", # The duration of the video in milliseconds. 1373 "height": 42, # The height of the video in pixels. 1374 "width": 42, # The width of the video in pixels. 1375 }, 1376 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. 1377 "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. 1378 "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for items in shared drives. 1379}</pre> 1380</div> 1381 1382<div class="method"> 1383 <code class="details" id="get_media">get_media(fileId, acknowledgeAbuse=None, includePermissionsForView=None, projection=None, revisionId=None, supportsAllDrives=None, supportsTeamDrives=None, updateViewedDate=None)</code> 1384 <pre>Gets a file's metadata or content by ID. 1385 1386Args: 1387 fileId: string, The ID for the file in question. (required) 1388 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. 1389 includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. 1390 projection: string, This parameter is deprecated and has no function. 1391 Allowed values 1392 BASIC - Deprecated 1393 FULL - Deprecated 1394 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. 1395 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 1396 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 1397 updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body. 1398 1399Returns: 1400 The media object as a string. 1401 1402 </pre> 1403</div> 1404 1405<div class="method"> 1406 <code class="details" id="insert">insert(body=None, convert=None, enforceSingleParent=None, includePermissionsForView=None, media_body=None, media_mime_type=None, ocr=None, ocrLanguage=None, pinned=None, supportsAllDrives=None, supportsTeamDrives=None, timedTextLanguage=None, timedTextTrackName=None, useContentAsIndexableText=None, visibility=None)</code> 1407 <pre>Insert a new file. 1408 1409Args: 1410 body: object, The request body. 1411 The object takes the form of: 1412 1413{ # The metadata for a file. 1414 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer. 1415 "appDataContents": True or False, # Whether this file is in the Application Data folder. 1416 "canComment": True or False, # Deprecated: use capabilities/canComment. 1417 "canReadRevisions": True or False, # Deprecated: use capabilities/canReadRevisions. 1418 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 1419 "canAcceptOwnership": True or False, # Whether the current user is the pending owner of the file. Not populated for shared drive files. 1420 "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. 1421 "canAddFolderFromAnotherDrive": True or False, # Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. 1422 "canAddMyDriveParent": True or False, # Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. 1423 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 1424 "canChangeRestrictedDownload": True or False, # Deprecated 1425 "canChangeSecurityUpdateEnabled": True or False, # Whether the current user can change the securityUpdateEnabled field on link share metadata. 1426 "canComment": True or False, # Whether the current user can comment on this file. 1427 "canCopy": True or False, # Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. 1428 "canDelete": True or False, # Whether the current user can delete this file. 1429 "canDeleteChildren": True or False, # Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 1430 "canDownload": True or False, # Whether the current user can download this file. 1431 "canEdit": True or False, # Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. 1432 "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. 1433 "canModifyContent": True or False, # Whether the current user can modify the content of this file. 1434 "canModifyContentRestriction": True or False, # Whether the current user can modify restrictions on content of this file. 1435 "canMoveChildrenOutOfDrive": True or False, # Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 1436 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 1437 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. 1438 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 1439 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1440 "canMoveItemOutOfDrive": True or False, # Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. 1441 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1442 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. 1443 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 1444 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 1445 "canReadDrive": True or False, # Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. 1446 "canReadRevisions": True or False, # Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. 1447 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 1448 "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. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. 1449 "canRemoveMyDriveParent": True or False, # Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. 1450 "canRename": True or False, # Whether the current user can rename this file. 1451 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 1452 "canTrash": True or False, # Whether the current user can move this file to trash. 1453 "canTrashChildren": True or False, # Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 1454 "canUntrash": True or False, # Whether the current user can restore this file from trash. 1455 }, 1456 "contentRestrictions": [ # Restrictions for accessing the content of the file. Only populated if such a restriction exists. 1457 { # A restriction for accessing the content of the file. 1458 "readOnly": True or False, # Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. 1459 "reason": "A String", # Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. 1460 "restrictingUser": { # Information about a Drive user. # The user who set the content restriction. Only populated if readOnly is true. 1461 "displayName": "A String", # A plain text displayable name for this user. 1462 "emailAddress": "A String", # The email address of the user. 1463 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 1464 "kind": "drive#user", # This is always drive#user. 1465 "permissionId": "A String", # The user's ID as visible in the permissions collection. 1466 "picture": { # The user's profile picture. 1467 "url": "A String", # A URL that points to a profile picture of this user. 1468 }, 1469 }, 1470 "restrictionDate": "A String", # The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. 1471 "type": "A String", # The type of the content restriction. Currently the only possible value is globalContentRestriction. 1472 }, 1473 ], 1474 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 1475 "copyable": True or False, # Deprecated: use capabilities/canCopy. 1476 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp). 1477 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. 1478 "description": "A String", # A short description of the file. 1479 "downloadUrl": "A String", # Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 1480 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 1481 "editable": True or False, # Deprecated: use capabilities/canEdit. 1482 "embedLink": "A String", # A link for embedding the file. 1483 "etag": "A String", # ETag of the file. 1484 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. 1485 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 1486 "a_key": "A String", # A mapping from export format to URL 1487 }, 1488 "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 Google Drive; it is not populated for Docs Editors or shortcut files. 1489 "fileSize": "A String", # The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. 1490 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder or a shortcut to 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. 1491 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 1492 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives. 1493 "hasThumbnail": True or False, # Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. 1494 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 1495 "iconLink": "A String", # A link to the file's icon. 1496 "id": "A String", # The ID of the file. 1497 "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. 1498 "aperture": 3.14, # The aperture used to create the photo (f-number). 1499 "cameraMake": "A String", # The make of the camera used to create the photo. 1500 "cameraModel": "A String", # The model of the camera used to create the photo. 1501 "colorSpace": "A String", # The color space of the photo. 1502 "date": "A String", # The date and time the photo was taken (EXIF format timestamp). 1503 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 1504 "exposureMode": "A String", # The exposure mode used to create the photo. 1505 "exposureTime": 3.14, # The length of the exposure, in seconds. 1506 "flashUsed": True or False, # Whether a flash was used to create the photo. 1507 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 1508 "height": 42, # The height of the image in pixels. 1509 "isoSpeed": 42, # The ISO speed used to create the photo. 1510 "lens": "A String", # The lens used to create the photo. 1511 "location": { # Geographic location information stored in the image. 1512 "altitude": 3.14, # The altitude stored in the image. 1513 "latitude": 3.14, # The latitude stored in the image. 1514 "longitude": 3.14, # The longitude stored in the image. 1515 }, 1516 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 1517 "meteringMode": "A String", # The metering mode used to create the photo. 1518 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation. 1519 "sensor": "A String", # The type of sensor used to create the photo. 1520 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 1521 "whiteBalance": "A String", # The white balance mode used to create the photo. 1522 "width": 42, # The width of the image in pixels. 1523 }, 1524 "indexableText": { # Indexable text attributes for the file (can only be written) 1525 "text": "A String", # The text to be indexed for this file. 1526 }, 1527 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 1528 "kind": "drive#file", # The type of file. This is always drive#file. 1529 "labels": { # A group of labels for the file. 1530 "hidden": True or False, # Deprecated. 1531 "modified": True or False, # Whether the file has been modified by this user. 1532 "restricted": True or False, # Deprecated - use copyRequiresWriterPermission instead. 1533 "starred": True or False, # Whether this file is starred by the user. 1534 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 1535 "viewed": True or False, # Whether this file has been viewed by this user. 1536 }, 1537 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file. 1538 "displayName": "A String", # A plain text displayable name for this user. 1539 "emailAddress": "A String", # The email address of the user. 1540 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 1541 "kind": "drive#user", # This is always drive#user. 1542 "permissionId": "A String", # The user's ID as visible in the permissions collection. 1543 "picture": { # The user's profile picture. 1544 "url": "A String", # A URL that points to a profile picture of this user. 1545 }, 1546 }, 1547 "lastModifyingUserName": "A String", # Name of the last user to modify this file. 1548 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp). 1549 "linkShareMetadata": { # Contains details about the link URLs that clients are using to refer to this item. 1550 "securityUpdateEligible": True or False, # Whether the file is eligible for security update. 1551 "securityUpdateEnabled": True or False, # Whether the security update is enabled for this file. 1552 }, 1553 "markedViewedByMeDate": "A String", # Deprecated. 1554 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 1555 "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. 1556 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. 1557 "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. 1558 "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. 1559 "a_key": "A String", 1560 }, 1561 "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 Google Drive. 1562 "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for items in shared drives. 1563 "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for items in shared drives. 1564 "A String", 1565 ], 1566 "owners": [ # The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. 1567 { # Information about a Drive user. 1568 "displayName": "A String", # A plain text displayable name for this user. 1569 "emailAddress": "A String", # The email address of the user. 1570 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 1571 "kind": "drive#user", # This is always drive#user. 1572 "permissionId": "A String", # The user's ID as visible in the permissions collection. 1573 "picture": { # The user's profile picture. 1574 "url": "A String", # A URL that points to a profile picture of this user. 1575 }, 1576 }, 1577 ], 1578 "parents": [ # Collection of parent folders which contain this file. 1579 # If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list. 1580 { # A reference to a file's parent. 1581 "id": "A String", # The ID of the parent. 1582 "isRoot": True or False, # Whether or not the parent is the root folder. 1583 "kind": "drive#parentReference", # This is always drive#parentReference. 1584 "parentLink": "A String", # A link to the parent. 1585 "selfLink": "A String", # A link back to this reference. 1586 }, 1587 ], 1588 "permissionIds": [ # List of permission IDs for users with access to this file. 1589 "A String", 1590 ], 1591 "permissions": [ # The list of permissions for users with access to this file. Not populated for items in shared drives. 1592 { # A permission for a file. 1593 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 1594 "A String", 1595 ], 1596 "authKey": "A String", # Deprecated. 1597 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 1598 "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. 1599 "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. 1600 "etag": "A String", # The ETag of the permission. 1601 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 1602 # - They cannot be set on shared drive items 1603 # - They can only be set on user and group permissions 1604 # - The date must be in the future 1605 # - The date cannot be more than a year in the future 1606 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 1607 "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. 1608 "kind": "drive#permission", # This is always drive#permission. 1609 "name": "A String", # The name for this permission. 1610 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 1611 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 1612 { 1613 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 1614 "A String", 1615 ], 1616 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 1617 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 1618 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 1619 # - file 1620 # - member 1621 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 1622 # - organizer 1623 # - fileOrganizer 1624 # - writer 1625 # - reader 1626 }, 1627 ], 1628 "photoLink": "A String", # A link to the profile photo, if available. 1629 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 1630 # - owner 1631 # - organizer 1632 # - fileOrganizer 1633 # - writer 1634 # - reader 1635 "selfLink": "A String", # A link back to this permission. 1636 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 1637 { 1638 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 1639 "A String", 1640 ], 1641 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 1642 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 1643 "role": "A String", # Deprecated - use permissionDetails/role instead. 1644 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 1645 }, 1646 ], 1647 "type": "A String", # The account type. Allowed values are: 1648 # - user 1649 # - group 1650 # - domain 1651 # - anyone 1652 "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. 1653 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 1654 "withLink": True or False, # Whether the link is required for this permission. 1655 }, 1656 ], 1657 "properties": [ # The list of properties. 1658 { # A key-value pair attached to a file that is either public or private to an application. 1659 # The following limits apply to file properties: 1660 # - Maximum of 100 properties total per file 1661 # - Maximum of 30 private properties per app 1662 # - Maximum of 30 public properties 1663 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. 1664 "etag": "A String", # ETag of the property. 1665 "key": "A String", # The key of this property. 1666 "kind": "drive#property", # This is always drive#property. 1667 "selfLink": "A String", # The link back to this property. 1668 "value": "A String", # The value of this property. 1669 "visibility": "A String", # The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. 1670 }, 1671 ], 1672 "quotaBytesUsed": "A String", # The number of quota bytes used by this file. 1673 "resourceKey": "A String", # A key needed to access the item via a shared link. 1674 "selfLink": "A String", # A link back to this file. 1675 "shareable": True or False, # Deprecated: use capabilities/canShare. 1676 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 1677 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp). 1678 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available. 1679 "displayName": "A String", # A plain text displayable name for this user. 1680 "emailAddress": "A String", # The email address of the user. 1681 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 1682 "kind": "drive#user", # This is always drive#user. 1683 "permissionId": "A String", # The user's ID as visible in the permissions collection. 1684 "picture": { # The user's profile picture. 1685 "url": "A String", # A URL that points to a profile picture of this user. 1686 }, 1687 }, 1688 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. 1689 "targetId": "A String", # The ID of the file that this shortcut points to. 1690 "targetMimeType": "A String", # The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. 1691 "targetResourceKey": "A String", # The ResourceKey for the target file. 1692 }, 1693 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. 1694 "A String", 1695 ], 1696 "teamDriveId": "A String", # Deprecated - use driveId instead. 1697 "thumbnail": { # A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. 1698 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. 1699 "mimeType": "A String", # The MIME type of the thumbnail. 1700 }, 1701 "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. 1702 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 1703 "title": "A String", # The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. 1704 "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. 1705 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. 1706 "displayName": "A String", # A plain text displayable name for this user. 1707 "emailAddress": "A String", # The email address of the user. 1708 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 1709 "kind": "drive#user", # This is always drive#user. 1710 "permissionId": "A String", # The user's ID as visible in the permissions collection. 1711 "picture": { # The user's profile picture. 1712 "url": "A String", # A URL that points to a profile picture of this user. 1713 }, 1714 }, 1715 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file. 1716 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 1717 "A String", 1718 ], 1719 "authKey": "A String", # Deprecated. 1720 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 1721 "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. 1722 "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. 1723 "etag": "A String", # The ETag of the permission. 1724 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 1725 # - They cannot be set on shared drive items 1726 # - They can only be set on user and group permissions 1727 # - The date must be in the future 1728 # - The date cannot be more than a year in the future 1729 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 1730 "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. 1731 "kind": "drive#permission", # This is always drive#permission. 1732 "name": "A String", # The name for this permission. 1733 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 1734 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 1735 { 1736 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 1737 "A String", 1738 ], 1739 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 1740 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 1741 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 1742 # - file 1743 # - member 1744 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 1745 # - organizer 1746 # - fileOrganizer 1747 # - writer 1748 # - reader 1749 }, 1750 ], 1751 "photoLink": "A String", # A link to the profile photo, if available. 1752 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 1753 # - owner 1754 # - organizer 1755 # - fileOrganizer 1756 # - writer 1757 # - reader 1758 "selfLink": "A String", # A link back to this permission. 1759 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 1760 { 1761 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 1762 "A String", 1763 ], 1764 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 1765 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 1766 "role": "A String", # Deprecated - use permissionDetails/role instead. 1767 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 1768 }, 1769 ], 1770 "type": "A String", # The account type. Allowed values are: 1771 # - user 1772 # - group 1773 # - domain 1774 # - anyone 1775 "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. 1776 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 1777 "withLink": True or False, # Whether the link is required for this permission. 1778 }, 1779 "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. 1780 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types. 1781 "durationMillis": "A String", # The duration of the video in milliseconds. 1782 "height": 42, # The height of the video in pixels. 1783 "width": 42, # The width of the video in pixels. 1784 }, 1785 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. 1786 "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. 1787 "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for items in shared drives. 1788} 1789 1790 convert: boolean, Whether to convert this file to the corresponding Docs Editors format. 1791 enforceSingleParent: boolean, Deprecated. Creating files in multiple folders is no longer supported. 1792 includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. 1793 media_body: string, The filename of the media request body, or an instance of a MediaUpload object. 1794 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object. 1795 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. 1796 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes. 1797 pinned: boolean, Whether to pin the head revision of the uploaded file. A file can have a maximum of 200 pinned revisions. 1798 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 1799 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 1800 timedTextLanguage: string, The language of the timed text. 1801 timedTextTrackName: string, The timed text track name. 1802 useContentAsIndexableText: boolean, Whether to use the content as indexable text. 1803 visibility: string, The visibility of the new file. This parameter is only relevant when convert=false. 1804 Allowed values 1805 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies. 1806 PRIVATE - The new file will be visible to only the owner. 1807 1808Returns: 1809 An object of the form: 1810 1811 { # The metadata for a file. 1812 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer. 1813 "appDataContents": True or False, # Whether this file is in the Application Data folder. 1814 "canComment": True or False, # Deprecated: use capabilities/canComment. 1815 "canReadRevisions": True or False, # Deprecated: use capabilities/canReadRevisions. 1816 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 1817 "canAcceptOwnership": True or False, # Whether the current user is the pending owner of the file. Not populated for shared drive files. 1818 "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. 1819 "canAddFolderFromAnotherDrive": True or False, # Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. 1820 "canAddMyDriveParent": True or False, # Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. 1821 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 1822 "canChangeRestrictedDownload": True or False, # Deprecated 1823 "canChangeSecurityUpdateEnabled": True or False, # Whether the current user can change the securityUpdateEnabled field on link share metadata. 1824 "canComment": True or False, # Whether the current user can comment on this file. 1825 "canCopy": True or False, # Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. 1826 "canDelete": True or False, # Whether the current user can delete this file. 1827 "canDeleteChildren": True or False, # Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 1828 "canDownload": True or False, # Whether the current user can download this file. 1829 "canEdit": True or False, # Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. 1830 "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. 1831 "canModifyContent": True or False, # Whether the current user can modify the content of this file. 1832 "canModifyContentRestriction": True or False, # Whether the current user can modify restrictions on content of this file. 1833 "canMoveChildrenOutOfDrive": True or False, # Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 1834 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 1835 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. 1836 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 1837 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1838 "canMoveItemOutOfDrive": True or False, # Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. 1839 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1840 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. 1841 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 1842 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 1843 "canReadDrive": True or False, # Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. 1844 "canReadRevisions": True or False, # Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. 1845 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 1846 "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. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. 1847 "canRemoveMyDriveParent": True or False, # Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. 1848 "canRename": True or False, # Whether the current user can rename this file. 1849 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 1850 "canTrash": True or False, # Whether the current user can move this file to trash. 1851 "canTrashChildren": True or False, # Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 1852 "canUntrash": True or False, # Whether the current user can restore this file from trash. 1853 }, 1854 "contentRestrictions": [ # Restrictions for accessing the content of the file. Only populated if such a restriction exists. 1855 { # A restriction for accessing the content of the file. 1856 "readOnly": True or False, # Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. 1857 "reason": "A String", # Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. 1858 "restrictingUser": { # Information about a Drive user. # The user who set the content restriction. Only populated if readOnly is true. 1859 "displayName": "A String", # A plain text displayable name for this user. 1860 "emailAddress": "A String", # The email address of the user. 1861 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 1862 "kind": "drive#user", # This is always drive#user. 1863 "permissionId": "A String", # The user's ID as visible in the permissions collection. 1864 "picture": { # The user's profile picture. 1865 "url": "A String", # A URL that points to a profile picture of this user. 1866 }, 1867 }, 1868 "restrictionDate": "A String", # The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. 1869 "type": "A String", # The type of the content restriction. Currently the only possible value is globalContentRestriction. 1870 }, 1871 ], 1872 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 1873 "copyable": True or False, # Deprecated: use capabilities/canCopy. 1874 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp). 1875 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. 1876 "description": "A String", # A short description of the file. 1877 "downloadUrl": "A String", # Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 1878 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 1879 "editable": True or False, # Deprecated: use capabilities/canEdit. 1880 "embedLink": "A String", # A link for embedding the file. 1881 "etag": "A String", # ETag of the file. 1882 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. 1883 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 1884 "a_key": "A String", # A mapping from export format to URL 1885 }, 1886 "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 Google Drive; it is not populated for Docs Editors or shortcut files. 1887 "fileSize": "A String", # The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. 1888 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder or a shortcut to 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. 1889 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 1890 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives. 1891 "hasThumbnail": True or False, # Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. 1892 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 1893 "iconLink": "A String", # A link to the file's icon. 1894 "id": "A String", # The ID of the file. 1895 "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. 1896 "aperture": 3.14, # The aperture used to create the photo (f-number). 1897 "cameraMake": "A String", # The make of the camera used to create the photo. 1898 "cameraModel": "A String", # The model of the camera used to create the photo. 1899 "colorSpace": "A String", # The color space of the photo. 1900 "date": "A String", # The date and time the photo was taken (EXIF format timestamp). 1901 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 1902 "exposureMode": "A String", # The exposure mode used to create the photo. 1903 "exposureTime": 3.14, # The length of the exposure, in seconds. 1904 "flashUsed": True or False, # Whether a flash was used to create the photo. 1905 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 1906 "height": 42, # The height of the image in pixels. 1907 "isoSpeed": 42, # The ISO speed used to create the photo. 1908 "lens": "A String", # The lens used to create the photo. 1909 "location": { # Geographic location information stored in the image. 1910 "altitude": 3.14, # The altitude stored in the image. 1911 "latitude": 3.14, # The latitude stored in the image. 1912 "longitude": 3.14, # The longitude stored in the image. 1913 }, 1914 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 1915 "meteringMode": "A String", # The metering mode used to create the photo. 1916 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation. 1917 "sensor": "A String", # The type of sensor used to create the photo. 1918 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 1919 "whiteBalance": "A String", # The white balance mode used to create the photo. 1920 "width": 42, # The width of the image in pixels. 1921 }, 1922 "indexableText": { # Indexable text attributes for the file (can only be written) 1923 "text": "A String", # The text to be indexed for this file. 1924 }, 1925 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 1926 "kind": "drive#file", # The type of file. This is always drive#file. 1927 "labels": { # A group of labels for the file. 1928 "hidden": True or False, # Deprecated. 1929 "modified": True or False, # Whether the file has been modified by this user. 1930 "restricted": True or False, # Deprecated - use copyRequiresWriterPermission instead. 1931 "starred": True or False, # Whether this file is starred by the user. 1932 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 1933 "viewed": True or False, # Whether this file has been viewed by this user. 1934 }, 1935 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file. 1936 "displayName": "A String", # A plain text displayable name for this user. 1937 "emailAddress": "A String", # The email address of the user. 1938 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 1939 "kind": "drive#user", # This is always drive#user. 1940 "permissionId": "A String", # The user's ID as visible in the permissions collection. 1941 "picture": { # The user's profile picture. 1942 "url": "A String", # A URL that points to a profile picture of this user. 1943 }, 1944 }, 1945 "lastModifyingUserName": "A String", # Name of the last user to modify this file. 1946 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp). 1947 "linkShareMetadata": { # Contains details about the link URLs that clients are using to refer to this item. 1948 "securityUpdateEligible": True or False, # Whether the file is eligible for security update. 1949 "securityUpdateEnabled": True or False, # Whether the security update is enabled for this file. 1950 }, 1951 "markedViewedByMeDate": "A String", # Deprecated. 1952 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 1953 "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. 1954 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. 1955 "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. 1956 "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. 1957 "a_key": "A String", 1958 }, 1959 "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 Google Drive. 1960 "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for items in shared drives. 1961 "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for items in shared drives. 1962 "A String", 1963 ], 1964 "owners": [ # The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. 1965 { # Information about a Drive user. 1966 "displayName": "A String", # A plain text displayable name for this user. 1967 "emailAddress": "A String", # The email address of the user. 1968 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 1969 "kind": "drive#user", # This is always drive#user. 1970 "permissionId": "A String", # The user's ID as visible in the permissions collection. 1971 "picture": { # The user's profile picture. 1972 "url": "A String", # A URL that points to a profile picture of this user. 1973 }, 1974 }, 1975 ], 1976 "parents": [ # Collection of parent folders which contain this file. 1977 # If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list. 1978 { # A reference to a file's parent. 1979 "id": "A String", # The ID of the parent. 1980 "isRoot": True or False, # Whether or not the parent is the root folder. 1981 "kind": "drive#parentReference", # This is always drive#parentReference. 1982 "parentLink": "A String", # A link to the parent. 1983 "selfLink": "A String", # A link back to this reference. 1984 }, 1985 ], 1986 "permissionIds": [ # List of permission IDs for users with access to this file. 1987 "A String", 1988 ], 1989 "permissions": [ # The list of permissions for users with access to this file. Not populated for items in shared drives. 1990 { # A permission for a file. 1991 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 1992 "A String", 1993 ], 1994 "authKey": "A String", # Deprecated. 1995 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 1996 "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. 1997 "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. 1998 "etag": "A String", # The ETag of the permission. 1999 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 2000 # - They cannot be set on shared drive items 2001 # - They can only be set on user and group permissions 2002 # - The date must be in the future 2003 # - The date cannot be more than a year in the future 2004 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 2005 "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. 2006 "kind": "drive#permission", # This is always drive#permission. 2007 "name": "A String", # The name for this permission. 2008 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 2009 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 2010 { 2011 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 2012 "A String", 2013 ], 2014 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 2015 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 2016 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 2017 # - file 2018 # - member 2019 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 2020 # - organizer 2021 # - fileOrganizer 2022 # - writer 2023 # - reader 2024 }, 2025 ], 2026 "photoLink": "A String", # A link to the profile photo, if available. 2027 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 2028 # - owner 2029 # - organizer 2030 # - fileOrganizer 2031 # - writer 2032 # - reader 2033 "selfLink": "A String", # A link back to this permission. 2034 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 2035 { 2036 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 2037 "A String", 2038 ], 2039 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 2040 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 2041 "role": "A String", # Deprecated - use permissionDetails/role instead. 2042 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 2043 }, 2044 ], 2045 "type": "A String", # The account type. Allowed values are: 2046 # - user 2047 # - group 2048 # - domain 2049 # - anyone 2050 "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. 2051 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 2052 "withLink": True or False, # Whether the link is required for this permission. 2053 }, 2054 ], 2055 "properties": [ # The list of properties. 2056 { # A key-value pair attached to a file that is either public or private to an application. 2057 # The following limits apply to file properties: 2058 # - Maximum of 100 properties total per file 2059 # - Maximum of 30 private properties per app 2060 # - Maximum of 30 public properties 2061 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. 2062 "etag": "A String", # ETag of the property. 2063 "key": "A String", # The key of this property. 2064 "kind": "drive#property", # This is always drive#property. 2065 "selfLink": "A String", # The link back to this property. 2066 "value": "A String", # The value of this property. 2067 "visibility": "A String", # The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. 2068 }, 2069 ], 2070 "quotaBytesUsed": "A String", # The number of quota bytes used by this file. 2071 "resourceKey": "A String", # A key needed to access the item via a shared link. 2072 "selfLink": "A String", # A link back to this file. 2073 "shareable": True or False, # Deprecated: use capabilities/canShare. 2074 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 2075 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp). 2076 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available. 2077 "displayName": "A String", # A plain text displayable name for this user. 2078 "emailAddress": "A String", # The email address of the user. 2079 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 2080 "kind": "drive#user", # This is always drive#user. 2081 "permissionId": "A String", # The user's ID as visible in the permissions collection. 2082 "picture": { # The user's profile picture. 2083 "url": "A String", # A URL that points to a profile picture of this user. 2084 }, 2085 }, 2086 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. 2087 "targetId": "A String", # The ID of the file that this shortcut points to. 2088 "targetMimeType": "A String", # The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. 2089 "targetResourceKey": "A String", # The ResourceKey for the target file. 2090 }, 2091 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. 2092 "A String", 2093 ], 2094 "teamDriveId": "A String", # Deprecated - use driveId instead. 2095 "thumbnail": { # A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. 2096 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. 2097 "mimeType": "A String", # The MIME type of the thumbnail. 2098 }, 2099 "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. 2100 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 2101 "title": "A String", # The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. 2102 "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. 2103 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. 2104 "displayName": "A String", # A plain text displayable name for this user. 2105 "emailAddress": "A String", # The email address of the user. 2106 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 2107 "kind": "drive#user", # This is always drive#user. 2108 "permissionId": "A String", # The user's ID as visible in the permissions collection. 2109 "picture": { # The user's profile picture. 2110 "url": "A String", # A URL that points to a profile picture of this user. 2111 }, 2112 }, 2113 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file. 2114 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 2115 "A String", 2116 ], 2117 "authKey": "A String", # Deprecated. 2118 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 2119 "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. 2120 "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. 2121 "etag": "A String", # The ETag of the permission. 2122 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 2123 # - They cannot be set on shared drive items 2124 # - They can only be set on user and group permissions 2125 # - The date must be in the future 2126 # - The date cannot be more than a year in the future 2127 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 2128 "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. 2129 "kind": "drive#permission", # This is always drive#permission. 2130 "name": "A String", # The name for this permission. 2131 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 2132 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 2133 { 2134 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 2135 "A String", 2136 ], 2137 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 2138 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 2139 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 2140 # - file 2141 # - member 2142 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 2143 # - organizer 2144 # - fileOrganizer 2145 # - writer 2146 # - reader 2147 }, 2148 ], 2149 "photoLink": "A String", # A link to the profile photo, if available. 2150 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 2151 # - owner 2152 # - organizer 2153 # - fileOrganizer 2154 # - writer 2155 # - reader 2156 "selfLink": "A String", # A link back to this permission. 2157 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 2158 { 2159 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 2160 "A String", 2161 ], 2162 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 2163 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 2164 "role": "A String", # Deprecated - use permissionDetails/role instead. 2165 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 2166 }, 2167 ], 2168 "type": "A String", # The account type. Allowed values are: 2169 # - user 2170 # - group 2171 # - domain 2172 # - anyone 2173 "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. 2174 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 2175 "withLink": True or False, # Whether the link is required for this permission. 2176 }, 2177 "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. 2178 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types. 2179 "durationMillis": "A String", # The duration of the video in milliseconds. 2180 "height": 42, # The height of the video in pixels. 2181 "width": 42, # The width of the video in pixels. 2182 }, 2183 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. 2184 "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. 2185 "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for items in shared drives. 2186}</pre> 2187</div> 2188 2189<div class="method"> 2190 <code class="details" id="list">list(corpora=None, corpus=None, driveId=None, includeItemsFromAllDrives=None, includePermissionsForView=None, includeTeamDriveItems=None, maxResults=None, orderBy=None, pageToken=None, projection=None, q=None, spaces=None, supportsAllDrives=None, supportsTeamDrives=None, teamDriveId=None)</code> 2191 <pre>Lists the user's files. 2192 2193Args: 2194 corpora: string, Groupings of files to which the query applies. Supported groupings are: 'user' (files created by, opened by, or shared directly with the user), 'drive' (files in the specified shared drive as indicated by the 'driveId'), 'domain' (files shared to the user's domain), and 'allDrives' (A combination of 'user' and 'drive' for all drives where the user is a member). When able, use 'user' or 'drive', instead of 'allDrives', for efficiency. 2195 corpus: string, The body of items (files/documents) to which the query applies. Deprecated: use 'corpora' instead. 2196 Allowed values 2197 DEFAULT - The items that the user has accessed. 2198 DOMAIN - Items shared to the user's domain. 2199 driveId: string, ID of the shared drive to search. 2200 includeItemsFromAllDrives: boolean, Whether both My Drive and shared drive items should be included in results. 2201 includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. 2202 includeTeamDriveItems: boolean, Deprecated use includeItemsFromAllDrives instead. 2203 maxResults: integer, The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached. 2204 orderBy: string, A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', 'title', and 'title_natural'. 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. 2205 pageToken: string, Page token for files. 2206 projection: string, This parameter is deprecated and has no function. 2207 Allowed values 2208 BASIC - Deprecated 2209 FULL - Deprecated 2210 q: string, Query string for searching files. 2211 spaces: string, A comma-separated list of spaces to query. Supported values are 'drive' and 'appDataFolder'. 2212 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 2213 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 2214 teamDriveId: string, Deprecated use driveId instead. 2215 2216Returns: 2217 An object of the form: 2218 2219 { # A list of files. 2220 "etag": "A String", # The ETag of the list. 2221 "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 drives with the "allDrives" 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 "drive". 2222 "items": [ # The list of files. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. 2223 { # The metadata for a file. 2224 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer. 2225 "appDataContents": True or False, # Whether this file is in the Application Data folder. 2226 "canComment": True or False, # Deprecated: use capabilities/canComment. 2227 "canReadRevisions": True or False, # Deprecated: use capabilities/canReadRevisions. 2228 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 2229 "canAcceptOwnership": True or False, # Whether the current user is the pending owner of the file. Not populated for shared drive files. 2230 "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. 2231 "canAddFolderFromAnotherDrive": True or False, # Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. 2232 "canAddMyDriveParent": True or False, # Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. 2233 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 2234 "canChangeRestrictedDownload": True or False, # Deprecated 2235 "canChangeSecurityUpdateEnabled": True or False, # Whether the current user can change the securityUpdateEnabled field on link share metadata. 2236 "canComment": True or False, # Whether the current user can comment on this file. 2237 "canCopy": True or False, # Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. 2238 "canDelete": True or False, # Whether the current user can delete this file. 2239 "canDeleteChildren": True or False, # Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 2240 "canDownload": True or False, # Whether the current user can download this file. 2241 "canEdit": True or False, # Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. 2242 "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. 2243 "canModifyContent": True or False, # Whether the current user can modify the content of this file. 2244 "canModifyContentRestriction": True or False, # Whether the current user can modify restrictions on content of this file. 2245 "canMoveChildrenOutOfDrive": True or False, # Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 2246 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 2247 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. 2248 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 2249 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 2250 "canMoveItemOutOfDrive": True or False, # Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. 2251 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 2252 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. 2253 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 2254 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 2255 "canReadDrive": True or False, # Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. 2256 "canReadRevisions": True or False, # Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. 2257 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 2258 "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. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. 2259 "canRemoveMyDriveParent": True or False, # Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. 2260 "canRename": True or False, # Whether the current user can rename this file. 2261 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 2262 "canTrash": True or False, # Whether the current user can move this file to trash. 2263 "canTrashChildren": True or False, # Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 2264 "canUntrash": True or False, # Whether the current user can restore this file from trash. 2265 }, 2266 "contentRestrictions": [ # Restrictions for accessing the content of the file. Only populated if such a restriction exists. 2267 { # A restriction for accessing the content of the file. 2268 "readOnly": True or False, # Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. 2269 "reason": "A String", # Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. 2270 "restrictingUser": { # Information about a Drive user. # The user who set the content restriction. Only populated if readOnly is true. 2271 "displayName": "A String", # A plain text displayable name for this user. 2272 "emailAddress": "A String", # The email address of the user. 2273 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 2274 "kind": "drive#user", # This is always drive#user. 2275 "permissionId": "A String", # The user's ID as visible in the permissions collection. 2276 "picture": { # The user's profile picture. 2277 "url": "A String", # A URL that points to a profile picture of this user. 2278 }, 2279 }, 2280 "restrictionDate": "A String", # The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. 2281 "type": "A String", # The type of the content restriction. Currently the only possible value is globalContentRestriction. 2282 }, 2283 ], 2284 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 2285 "copyable": True or False, # Deprecated: use capabilities/canCopy. 2286 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp). 2287 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. 2288 "description": "A String", # A short description of the file. 2289 "downloadUrl": "A String", # Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 2290 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 2291 "editable": True or False, # Deprecated: use capabilities/canEdit. 2292 "embedLink": "A String", # A link for embedding the file. 2293 "etag": "A String", # ETag of the file. 2294 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. 2295 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 2296 "a_key": "A String", # A mapping from export format to URL 2297 }, 2298 "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 Google Drive; it is not populated for Docs Editors or shortcut files. 2299 "fileSize": "A String", # The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. 2300 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder or a shortcut to 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. 2301 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 2302 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives. 2303 "hasThumbnail": True or False, # Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. 2304 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 2305 "iconLink": "A String", # A link to the file's icon. 2306 "id": "A String", # The ID of the file. 2307 "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. 2308 "aperture": 3.14, # The aperture used to create the photo (f-number). 2309 "cameraMake": "A String", # The make of the camera used to create the photo. 2310 "cameraModel": "A String", # The model of the camera used to create the photo. 2311 "colorSpace": "A String", # The color space of the photo. 2312 "date": "A String", # The date and time the photo was taken (EXIF format timestamp). 2313 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 2314 "exposureMode": "A String", # The exposure mode used to create the photo. 2315 "exposureTime": 3.14, # The length of the exposure, in seconds. 2316 "flashUsed": True or False, # Whether a flash was used to create the photo. 2317 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 2318 "height": 42, # The height of the image in pixels. 2319 "isoSpeed": 42, # The ISO speed used to create the photo. 2320 "lens": "A String", # The lens used to create the photo. 2321 "location": { # Geographic location information stored in the image. 2322 "altitude": 3.14, # The altitude stored in the image. 2323 "latitude": 3.14, # The latitude stored in the image. 2324 "longitude": 3.14, # The longitude stored in the image. 2325 }, 2326 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 2327 "meteringMode": "A String", # The metering mode used to create the photo. 2328 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation. 2329 "sensor": "A String", # The type of sensor used to create the photo. 2330 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 2331 "whiteBalance": "A String", # The white balance mode used to create the photo. 2332 "width": 42, # The width of the image in pixels. 2333 }, 2334 "indexableText": { # Indexable text attributes for the file (can only be written) 2335 "text": "A String", # The text to be indexed for this file. 2336 }, 2337 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 2338 "kind": "drive#file", # The type of file. This is always drive#file. 2339 "labels": { # A group of labels for the file. 2340 "hidden": True or False, # Deprecated. 2341 "modified": True or False, # Whether the file has been modified by this user. 2342 "restricted": True or False, # Deprecated - use copyRequiresWriterPermission instead. 2343 "starred": True or False, # Whether this file is starred by the user. 2344 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 2345 "viewed": True or False, # Whether this file has been viewed by this user. 2346 }, 2347 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file. 2348 "displayName": "A String", # A plain text displayable name for this user. 2349 "emailAddress": "A String", # The email address of the user. 2350 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 2351 "kind": "drive#user", # This is always drive#user. 2352 "permissionId": "A String", # The user's ID as visible in the permissions collection. 2353 "picture": { # The user's profile picture. 2354 "url": "A String", # A URL that points to a profile picture of this user. 2355 }, 2356 }, 2357 "lastModifyingUserName": "A String", # Name of the last user to modify this file. 2358 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp). 2359 "linkShareMetadata": { # Contains details about the link URLs that clients are using to refer to this item. 2360 "securityUpdateEligible": True or False, # Whether the file is eligible for security update. 2361 "securityUpdateEnabled": True or False, # Whether the security update is enabled for this file. 2362 }, 2363 "markedViewedByMeDate": "A String", # Deprecated. 2364 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 2365 "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. 2366 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. 2367 "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. 2368 "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. 2369 "a_key": "A String", 2370 }, 2371 "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 Google Drive. 2372 "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for items in shared drives. 2373 "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for items in shared drives. 2374 "A String", 2375 ], 2376 "owners": [ # The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. 2377 { # Information about a Drive user. 2378 "displayName": "A String", # A plain text displayable name for this user. 2379 "emailAddress": "A String", # The email address of the user. 2380 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 2381 "kind": "drive#user", # This is always drive#user. 2382 "permissionId": "A String", # The user's ID as visible in the permissions collection. 2383 "picture": { # The user's profile picture. 2384 "url": "A String", # A URL that points to a profile picture of this user. 2385 }, 2386 }, 2387 ], 2388 "parents": [ # Collection of parent folders which contain this file. 2389 # If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list. 2390 { # A reference to a file's parent. 2391 "id": "A String", # The ID of the parent. 2392 "isRoot": True or False, # Whether or not the parent is the root folder. 2393 "kind": "drive#parentReference", # This is always drive#parentReference. 2394 "parentLink": "A String", # A link to the parent. 2395 "selfLink": "A String", # A link back to this reference. 2396 }, 2397 ], 2398 "permissionIds": [ # List of permission IDs for users with access to this file. 2399 "A String", 2400 ], 2401 "permissions": [ # The list of permissions for users with access to this file. Not populated for items in shared drives. 2402 { # A permission for a file. 2403 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 2404 "A String", 2405 ], 2406 "authKey": "A String", # Deprecated. 2407 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 2408 "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. 2409 "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. 2410 "etag": "A String", # The ETag of the permission. 2411 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 2412 # - They cannot be set on shared drive items 2413 # - They can only be set on user and group permissions 2414 # - The date must be in the future 2415 # - The date cannot be more than a year in the future 2416 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 2417 "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. 2418 "kind": "drive#permission", # This is always drive#permission. 2419 "name": "A String", # The name for this permission. 2420 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 2421 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 2422 { 2423 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 2424 "A String", 2425 ], 2426 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 2427 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 2428 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 2429 # - file 2430 # - member 2431 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 2432 # - organizer 2433 # - fileOrganizer 2434 # - writer 2435 # - reader 2436 }, 2437 ], 2438 "photoLink": "A String", # A link to the profile photo, if available. 2439 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 2440 # - owner 2441 # - organizer 2442 # - fileOrganizer 2443 # - writer 2444 # - reader 2445 "selfLink": "A String", # A link back to this permission. 2446 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 2447 { 2448 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 2449 "A String", 2450 ], 2451 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 2452 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 2453 "role": "A String", # Deprecated - use permissionDetails/role instead. 2454 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 2455 }, 2456 ], 2457 "type": "A String", # The account type. Allowed values are: 2458 # - user 2459 # - group 2460 # - domain 2461 # - anyone 2462 "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. 2463 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 2464 "withLink": True or False, # Whether the link is required for this permission. 2465 }, 2466 ], 2467 "properties": [ # The list of properties. 2468 { # A key-value pair attached to a file that is either public or private to an application. 2469 # The following limits apply to file properties: 2470 # - Maximum of 100 properties total per file 2471 # - Maximum of 30 private properties per app 2472 # - Maximum of 30 public properties 2473 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. 2474 "etag": "A String", # ETag of the property. 2475 "key": "A String", # The key of this property. 2476 "kind": "drive#property", # This is always drive#property. 2477 "selfLink": "A String", # The link back to this property. 2478 "value": "A String", # The value of this property. 2479 "visibility": "A String", # The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. 2480 }, 2481 ], 2482 "quotaBytesUsed": "A String", # The number of quota bytes used by this file. 2483 "resourceKey": "A String", # A key needed to access the item via a shared link. 2484 "selfLink": "A String", # A link back to this file. 2485 "shareable": True or False, # Deprecated: use capabilities/canShare. 2486 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 2487 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp). 2488 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available. 2489 "displayName": "A String", # A plain text displayable name for this user. 2490 "emailAddress": "A String", # The email address of the user. 2491 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 2492 "kind": "drive#user", # This is always drive#user. 2493 "permissionId": "A String", # The user's ID as visible in the permissions collection. 2494 "picture": { # The user's profile picture. 2495 "url": "A String", # A URL that points to a profile picture of this user. 2496 }, 2497 }, 2498 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. 2499 "targetId": "A String", # The ID of the file that this shortcut points to. 2500 "targetMimeType": "A String", # The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. 2501 "targetResourceKey": "A String", # The ResourceKey for the target file. 2502 }, 2503 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. 2504 "A String", 2505 ], 2506 "teamDriveId": "A String", # Deprecated - use driveId instead. 2507 "thumbnail": { # A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. 2508 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. 2509 "mimeType": "A String", # The MIME type of the thumbnail. 2510 }, 2511 "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. 2512 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 2513 "title": "A String", # The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. 2514 "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. 2515 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. 2516 "displayName": "A String", # A plain text displayable name for this user. 2517 "emailAddress": "A String", # The email address of the user. 2518 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 2519 "kind": "drive#user", # This is always drive#user. 2520 "permissionId": "A String", # The user's ID as visible in the permissions collection. 2521 "picture": { # The user's profile picture. 2522 "url": "A String", # A URL that points to a profile picture of this user. 2523 }, 2524 }, 2525 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file. 2526 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 2527 "A String", 2528 ], 2529 "authKey": "A String", # Deprecated. 2530 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 2531 "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. 2532 "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. 2533 "etag": "A String", # The ETag of the permission. 2534 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 2535 # - They cannot be set on shared drive items 2536 # - They can only be set on user and group permissions 2537 # - The date must be in the future 2538 # - The date cannot be more than a year in the future 2539 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 2540 "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. 2541 "kind": "drive#permission", # This is always drive#permission. 2542 "name": "A String", # The name for this permission. 2543 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 2544 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 2545 { 2546 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 2547 "A String", 2548 ], 2549 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 2550 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 2551 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 2552 # - file 2553 # - member 2554 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 2555 # - organizer 2556 # - fileOrganizer 2557 # - writer 2558 # - reader 2559 }, 2560 ], 2561 "photoLink": "A String", # A link to the profile photo, if available. 2562 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 2563 # - owner 2564 # - organizer 2565 # - fileOrganizer 2566 # - writer 2567 # - reader 2568 "selfLink": "A String", # A link back to this permission. 2569 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 2570 { 2571 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 2572 "A String", 2573 ], 2574 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 2575 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 2576 "role": "A String", # Deprecated - use permissionDetails/role instead. 2577 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 2578 }, 2579 ], 2580 "type": "A String", # The account type. Allowed values are: 2581 # - user 2582 # - group 2583 # - domain 2584 # - anyone 2585 "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. 2586 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 2587 "withLink": True or False, # Whether the link is required for this permission. 2588 }, 2589 "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. 2590 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types. 2591 "durationMillis": "A String", # The duration of the video in milliseconds. 2592 "height": 42, # The height of the video in pixels. 2593 "width": 42, # The width of the video in pixels. 2594 }, 2595 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. 2596 "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. 2597 "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for items in shared drives. 2598 }, 2599 ], 2600 "kind": "drive#fileList", # This is always drive#fileList. 2601 "nextLink": "A String", # A link to the next page of files. 2602 "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. 2603 "selfLink": "A String", # A link back to this list. 2604}</pre> 2605</div> 2606 2607<div class="method"> 2608 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 2609 <pre>Retrieves the next page of results. 2610 2611Args: 2612 previous_request: The request for the previous page. (required) 2613 previous_response: The response from the request for the previous page. (required) 2614 2615Returns: 2616 A request object that you can call 'execute()' on to request the next 2617 page. Returns None if there are no more items in the collection. 2618 </pre> 2619</div> 2620 2621<div class="method"> 2622 <code class="details" id="patch">patch(fileId, addParents=None, body=None, convert=None, enforceSingleParent=None, includePermissionsForView=None, modifiedDateBehavior=None, newRevision=None, ocr=None, ocrLanguage=None, pinned=None, removeParents=None, setModifiedDate=None, supportsAllDrives=None, supportsTeamDrives=None, timedTextLanguage=None, timedTextTrackName=None, updateViewedDate=None, useContentAsIndexableText=None)</code> 2623 <pre>Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might change automatically, such as modifiedDate. This method supports patch semantics. 2624 2625Args: 2626 fileId: string, The ID of the file to update. (required) 2627 body: object, The request body. 2628 The object takes the form of: 2629 2630{ # The metadata for a file. 2631 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer. 2632 "appDataContents": True or False, # Whether this file is in the Application Data folder. 2633 "canComment": True or False, # Deprecated: use capabilities/canComment. 2634 "canReadRevisions": True or False, # Deprecated: use capabilities/canReadRevisions. 2635 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 2636 "canAcceptOwnership": True or False, # Whether the current user is the pending owner of the file. Not populated for shared drive files. 2637 "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. 2638 "canAddFolderFromAnotherDrive": True or False, # Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. 2639 "canAddMyDriveParent": True or False, # Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. 2640 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 2641 "canChangeRestrictedDownload": True or False, # Deprecated 2642 "canChangeSecurityUpdateEnabled": True or False, # Whether the current user can change the securityUpdateEnabled field on link share metadata. 2643 "canComment": True or False, # Whether the current user can comment on this file. 2644 "canCopy": True or False, # Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. 2645 "canDelete": True or False, # Whether the current user can delete this file. 2646 "canDeleteChildren": True or False, # Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 2647 "canDownload": True or False, # Whether the current user can download this file. 2648 "canEdit": True or False, # Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. 2649 "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. 2650 "canModifyContent": True or False, # Whether the current user can modify the content of this file. 2651 "canModifyContentRestriction": True or False, # Whether the current user can modify restrictions on content of this file. 2652 "canMoveChildrenOutOfDrive": True or False, # Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 2653 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 2654 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. 2655 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 2656 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 2657 "canMoveItemOutOfDrive": True or False, # Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. 2658 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 2659 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. 2660 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 2661 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 2662 "canReadDrive": True or False, # Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. 2663 "canReadRevisions": True or False, # Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. 2664 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 2665 "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. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. 2666 "canRemoveMyDriveParent": True or False, # Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. 2667 "canRename": True or False, # Whether the current user can rename this file. 2668 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 2669 "canTrash": True or False, # Whether the current user can move this file to trash. 2670 "canTrashChildren": True or False, # Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 2671 "canUntrash": True or False, # Whether the current user can restore this file from trash. 2672 }, 2673 "contentRestrictions": [ # Restrictions for accessing the content of the file. Only populated if such a restriction exists. 2674 { # A restriction for accessing the content of the file. 2675 "readOnly": True or False, # Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. 2676 "reason": "A String", # Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. 2677 "restrictingUser": { # Information about a Drive user. # The user who set the content restriction. Only populated if readOnly is true. 2678 "displayName": "A String", # A plain text displayable name for this user. 2679 "emailAddress": "A String", # The email address of the user. 2680 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 2681 "kind": "drive#user", # This is always drive#user. 2682 "permissionId": "A String", # The user's ID as visible in the permissions collection. 2683 "picture": { # The user's profile picture. 2684 "url": "A String", # A URL that points to a profile picture of this user. 2685 }, 2686 }, 2687 "restrictionDate": "A String", # The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. 2688 "type": "A String", # The type of the content restriction. Currently the only possible value is globalContentRestriction. 2689 }, 2690 ], 2691 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 2692 "copyable": True or False, # Deprecated: use capabilities/canCopy. 2693 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp). 2694 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. 2695 "description": "A String", # A short description of the file. 2696 "downloadUrl": "A String", # Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 2697 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 2698 "editable": True or False, # Deprecated: use capabilities/canEdit. 2699 "embedLink": "A String", # A link for embedding the file. 2700 "etag": "A String", # ETag of the file. 2701 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. 2702 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 2703 "a_key": "A String", # A mapping from export format to URL 2704 }, 2705 "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 Google Drive; it is not populated for Docs Editors or shortcut files. 2706 "fileSize": "A String", # The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. 2707 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder or a shortcut to 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. 2708 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 2709 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives. 2710 "hasThumbnail": True or False, # Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. 2711 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 2712 "iconLink": "A String", # A link to the file's icon. 2713 "id": "A String", # The ID of the file. 2714 "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. 2715 "aperture": 3.14, # The aperture used to create the photo (f-number). 2716 "cameraMake": "A String", # The make of the camera used to create the photo. 2717 "cameraModel": "A String", # The model of the camera used to create the photo. 2718 "colorSpace": "A String", # The color space of the photo. 2719 "date": "A String", # The date and time the photo was taken (EXIF format timestamp). 2720 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 2721 "exposureMode": "A String", # The exposure mode used to create the photo. 2722 "exposureTime": 3.14, # The length of the exposure, in seconds. 2723 "flashUsed": True or False, # Whether a flash was used to create the photo. 2724 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 2725 "height": 42, # The height of the image in pixels. 2726 "isoSpeed": 42, # The ISO speed used to create the photo. 2727 "lens": "A String", # The lens used to create the photo. 2728 "location": { # Geographic location information stored in the image. 2729 "altitude": 3.14, # The altitude stored in the image. 2730 "latitude": 3.14, # The latitude stored in the image. 2731 "longitude": 3.14, # The longitude stored in the image. 2732 }, 2733 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 2734 "meteringMode": "A String", # The metering mode used to create the photo. 2735 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation. 2736 "sensor": "A String", # The type of sensor used to create the photo. 2737 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 2738 "whiteBalance": "A String", # The white balance mode used to create the photo. 2739 "width": 42, # The width of the image in pixels. 2740 }, 2741 "indexableText": { # Indexable text attributes for the file (can only be written) 2742 "text": "A String", # The text to be indexed for this file. 2743 }, 2744 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 2745 "kind": "drive#file", # The type of file. This is always drive#file. 2746 "labels": { # A group of labels for the file. 2747 "hidden": True or False, # Deprecated. 2748 "modified": True or False, # Whether the file has been modified by this user. 2749 "restricted": True or False, # Deprecated - use copyRequiresWriterPermission instead. 2750 "starred": True or False, # Whether this file is starred by the user. 2751 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 2752 "viewed": True or False, # Whether this file has been viewed by this user. 2753 }, 2754 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file. 2755 "displayName": "A String", # A plain text displayable name for this user. 2756 "emailAddress": "A String", # The email address of the user. 2757 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 2758 "kind": "drive#user", # This is always drive#user. 2759 "permissionId": "A String", # The user's ID as visible in the permissions collection. 2760 "picture": { # The user's profile picture. 2761 "url": "A String", # A URL that points to a profile picture of this user. 2762 }, 2763 }, 2764 "lastModifyingUserName": "A String", # Name of the last user to modify this file. 2765 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp). 2766 "linkShareMetadata": { # Contains details about the link URLs that clients are using to refer to this item. 2767 "securityUpdateEligible": True or False, # Whether the file is eligible for security update. 2768 "securityUpdateEnabled": True or False, # Whether the security update is enabled for this file. 2769 }, 2770 "markedViewedByMeDate": "A String", # Deprecated. 2771 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 2772 "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. 2773 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. 2774 "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 "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. 2776 "a_key": "A String", 2777 }, 2778 "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 Google Drive. 2779 "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for items in shared drives. 2780 "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for items in shared drives. 2781 "A String", 2782 ], 2783 "owners": [ # The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. 2784 { # Information about a Drive user. 2785 "displayName": "A String", # A plain text displayable name for this user. 2786 "emailAddress": "A String", # The email address of the user. 2787 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 2788 "kind": "drive#user", # This is always drive#user. 2789 "permissionId": "A String", # The user's ID as visible in the permissions collection. 2790 "picture": { # The user's profile picture. 2791 "url": "A String", # A URL that points to a profile picture of this user. 2792 }, 2793 }, 2794 ], 2795 "parents": [ # Collection of parent folders which contain this file. 2796 # If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list. 2797 { # A reference to a file's parent. 2798 "id": "A String", # The ID of the parent. 2799 "isRoot": True or False, # Whether or not the parent is the root folder. 2800 "kind": "drive#parentReference", # This is always drive#parentReference. 2801 "parentLink": "A String", # A link to the parent. 2802 "selfLink": "A String", # A link back to this reference. 2803 }, 2804 ], 2805 "permissionIds": [ # List of permission IDs for users with access to this file. 2806 "A String", 2807 ], 2808 "permissions": [ # The list of permissions for users with access to this file. Not populated for items in shared drives. 2809 { # A permission for a file. 2810 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 2811 "A String", 2812 ], 2813 "authKey": "A String", # Deprecated. 2814 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 2815 "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. 2816 "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. 2817 "etag": "A String", # The ETag of the permission. 2818 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 2819 # - They cannot be set on shared drive items 2820 # - They can only be set on user and group permissions 2821 # - The date must be in the future 2822 # - The date cannot be more than a year in the future 2823 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 2824 "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. 2825 "kind": "drive#permission", # This is always drive#permission. 2826 "name": "A String", # The name for this permission. 2827 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 2828 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 2829 { 2830 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 2831 "A String", 2832 ], 2833 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 2834 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 2835 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 2836 # - file 2837 # - member 2838 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 2839 # - organizer 2840 # - fileOrganizer 2841 # - writer 2842 # - reader 2843 }, 2844 ], 2845 "photoLink": "A String", # A link to the profile photo, if available. 2846 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 2847 # - owner 2848 # - organizer 2849 # - fileOrganizer 2850 # - writer 2851 # - reader 2852 "selfLink": "A String", # A link back to this permission. 2853 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 2854 { 2855 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 2856 "A String", 2857 ], 2858 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 2859 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 2860 "role": "A String", # Deprecated - use permissionDetails/role instead. 2861 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 2862 }, 2863 ], 2864 "type": "A String", # The account type. Allowed values are: 2865 # - user 2866 # - group 2867 # - domain 2868 # - anyone 2869 "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. 2870 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 2871 "withLink": True or False, # Whether the link is required for this permission. 2872 }, 2873 ], 2874 "properties": [ # The list of properties. 2875 { # A key-value pair attached to a file that is either public or private to an application. 2876 # The following limits apply to file properties: 2877 # - Maximum of 100 properties total per file 2878 # - Maximum of 30 private properties per app 2879 # - Maximum of 30 public properties 2880 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. 2881 "etag": "A String", # ETag of the property. 2882 "key": "A String", # The key of this property. 2883 "kind": "drive#property", # This is always drive#property. 2884 "selfLink": "A String", # The link back to this property. 2885 "value": "A String", # The value of this property. 2886 "visibility": "A String", # The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. 2887 }, 2888 ], 2889 "quotaBytesUsed": "A String", # The number of quota bytes used by this file. 2890 "resourceKey": "A String", # A key needed to access the item via a shared link. 2891 "selfLink": "A String", # A link back to this file. 2892 "shareable": True or False, # Deprecated: use capabilities/canShare. 2893 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 2894 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp). 2895 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available. 2896 "displayName": "A String", # A plain text displayable name for this user. 2897 "emailAddress": "A String", # The email address of the user. 2898 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 2899 "kind": "drive#user", # This is always drive#user. 2900 "permissionId": "A String", # The user's ID as visible in the permissions collection. 2901 "picture": { # The user's profile picture. 2902 "url": "A String", # A URL that points to a profile picture of this user. 2903 }, 2904 }, 2905 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. 2906 "targetId": "A String", # The ID of the file that this shortcut points to. 2907 "targetMimeType": "A String", # The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. 2908 "targetResourceKey": "A String", # The ResourceKey for the target file. 2909 }, 2910 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. 2911 "A String", 2912 ], 2913 "teamDriveId": "A String", # Deprecated - use driveId instead. 2914 "thumbnail": { # A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. 2915 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. 2916 "mimeType": "A String", # The MIME type of the thumbnail. 2917 }, 2918 "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. 2919 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 2920 "title": "A String", # The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. 2921 "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. 2922 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. 2923 "displayName": "A String", # A plain text displayable name for this user. 2924 "emailAddress": "A String", # The email address of the user. 2925 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 2926 "kind": "drive#user", # This is always drive#user. 2927 "permissionId": "A String", # The user's ID as visible in the permissions collection. 2928 "picture": { # The user's profile picture. 2929 "url": "A String", # A URL that points to a profile picture of this user. 2930 }, 2931 }, 2932 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file. 2933 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 2934 "A String", 2935 ], 2936 "authKey": "A String", # Deprecated. 2937 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 2938 "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. 2939 "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. 2940 "etag": "A String", # The ETag of the permission. 2941 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 2942 # - They cannot be set on shared drive items 2943 # - They can only be set on user and group permissions 2944 # - The date must be in the future 2945 # - The date cannot be more than a year in the future 2946 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 2947 "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. 2948 "kind": "drive#permission", # This is always drive#permission. 2949 "name": "A String", # The name for this permission. 2950 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 2951 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 2952 { 2953 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 2954 "A String", 2955 ], 2956 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 2957 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 2958 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 2959 # - file 2960 # - member 2961 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 2962 # - organizer 2963 # - fileOrganizer 2964 # - writer 2965 # - reader 2966 }, 2967 ], 2968 "photoLink": "A String", # A link to the profile photo, if available. 2969 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 2970 # - owner 2971 # - organizer 2972 # - fileOrganizer 2973 # - writer 2974 # - reader 2975 "selfLink": "A String", # A link back to this permission. 2976 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 2977 { 2978 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 2979 "A String", 2980 ], 2981 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 2982 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 2983 "role": "A String", # Deprecated - use permissionDetails/role instead. 2984 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 2985 }, 2986 ], 2987 "type": "A String", # The account type. Allowed values are: 2988 # - user 2989 # - group 2990 # - domain 2991 # - anyone 2992 "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. 2993 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 2994 "withLink": True or False, # Whether the link is required for this permission. 2995 }, 2996 "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. 2997 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types. 2998 "durationMillis": "A String", # The duration of the video in milliseconds. 2999 "height": 42, # The height of the video in pixels. 3000 "width": 42, # The width of the video in pixels. 3001 }, 3002 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. 3003 "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. 3004 "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for items in shared drives. 3005} 3006 3007 addParents: string, Comma-separated list of parent IDs to add. 3008 convert: boolean, This parameter is deprecated and has no function. 3009 enforceSingleParent: boolean, Deprecated. Adding files to multiple folders is no longer supported. Use shortcuts instead. 3010 includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. 3011 modifiedDateBehavior: string, Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate. 3012 Allowed values 3013 fromBody - Set modifiedDate to the value provided in the body of the request. No change if no value was provided. 3014 fromBodyIfNeeded - Set modifiedDate to the value provided in the body of the request depending on other contents of the update. 3015 fromBodyOrNow - Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided. 3016 noChange - Maintain the previous value of modifiedDate. 3017 now - Set modifiedDate to the current time. 3018 nowIfNeeded - Set modifiedDate to the current time depending on contents of the update. 3019 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. Note that this field is ignored if there is no payload in the request. 3020 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. 3021 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes. 3022 pinned: boolean, Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. Note that this field is ignored if there is no payload in the request. 3023 removeParents: string, Comma-separated list of parent IDs to remove. 3024 setModifiedDate: boolean, Whether to set the modified date using the value supplied in the request body. Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow, and false is equivalent to modifiedDateBehavior=now. To prevent any changes to the modified date set modifiedDateBehavior=noChange. 3025 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 3026 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 3027 timedTextLanguage: string, The language of the timed text. 3028 timedTextTrackName: string, The timed text track name. 3029 updateViewedDate: boolean, Whether to update the view date after successfully updating the file. 3030 useContentAsIndexableText: boolean, Whether to use the content as indexable text. 3031 3032Returns: 3033 An object of the form: 3034 3035 { # The metadata for a file. 3036 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer. 3037 "appDataContents": True or False, # Whether this file is in the Application Data folder. 3038 "canComment": True or False, # Deprecated: use capabilities/canComment. 3039 "canReadRevisions": True or False, # Deprecated: use capabilities/canReadRevisions. 3040 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 3041 "canAcceptOwnership": True or False, # Whether the current user is the pending owner of the file. Not populated for shared drive files. 3042 "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. 3043 "canAddFolderFromAnotherDrive": True or False, # Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. 3044 "canAddMyDriveParent": True or False, # Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. 3045 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 3046 "canChangeRestrictedDownload": True or False, # Deprecated 3047 "canChangeSecurityUpdateEnabled": True or False, # Whether the current user can change the securityUpdateEnabled field on link share metadata. 3048 "canComment": True or False, # Whether the current user can comment on this file. 3049 "canCopy": True or False, # Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. 3050 "canDelete": True or False, # Whether the current user can delete this file. 3051 "canDeleteChildren": True or False, # Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 3052 "canDownload": True or False, # Whether the current user can download this file. 3053 "canEdit": True or False, # Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. 3054 "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. 3055 "canModifyContent": True or False, # Whether the current user can modify the content of this file. 3056 "canModifyContentRestriction": True or False, # Whether the current user can modify restrictions on content of this file. 3057 "canMoveChildrenOutOfDrive": True or False, # Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 3058 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 3059 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. 3060 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 3061 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 3062 "canMoveItemOutOfDrive": True or False, # Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. 3063 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 3064 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. 3065 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 3066 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 3067 "canReadDrive": True or False, # Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. 3068 "canReadRevisions": True or False, # Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. 3069 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 3070 "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. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. 3071 "canRemoveMyDriveParent": True or False, # Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. 3072 "canRename": True or False, # Whether the current user can rename this file. 3073 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 3074 "canTrash": True or False, # Whether the current user can move this file to trash. 3075 "canTrashChildren": True or False, # Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 3076 "canUntrash": True or False, # Whether the current user can restore this file from trash. 3077 }, 3078 "contentRestrictions": [ # Restrictions for accessing the content of the file. Only populated if such a restriction exists. 3079 { # A restriction for accessing the content of the file. 3080 "readOnly": True or False, # Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. 3081 "reason": "A String", # Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. 3082 "restrictingUser": { # Information about a Drive user. # The user who set the content restriction. Only populated if readOnly is true. 3083 "displayName": "A String", # A plain text displayable name for this user. 3084 "emailAddress": "A String", # The email address of the user. 3085 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 3086 "kind": "drive#user", # This is always drive#user. 3087 "permissionId": "A String", # The user's ID as visible in the permissions collection. 3088 "picture": { # The user's profile picture. 3089 "url": "A String", # A URL that points to a profile picture of this user. 3090 }, 3091 }, 3092 "restrictionDate": "A String", # The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. 3093 "type": "A String", # The type of the content restriction. Currently the only possible value is globalContentRestriction. 3094 }, 3095 ], 3096 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 3097 "copyable": True or False, # Deprecated: use capabilities/canCopy. 3098 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp). 3099 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. 3100 "description": "A String", # A short description of the file. 3101 "downloadUrl": "A String", # Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 3102 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 3103 "editable": True or False, # Deprecated: use capabilities/canEdit. 3104 "embedLink": "A String", # A link for embedding the file. 3105 "etag": "A String", # ETag of the file. 3106 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. 3107 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 3108 "a_key": "A String", # A mapping from export format to URL 3109 }, 3110 "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 Google Drive; it is not populated for Docs Editors or shortcut files. 3111 "fileSize": "A String", # The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. 3112 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder or a shortcut to 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. 3113 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 3114 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives. 3115 "hasThumbnail": True or False, # Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. 3116 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 3117 "iconLink": "A String", # A link to the file's icon. 3118 "id": "A String", # The ID of the file. 3119 "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. 3120 "aperture": 3.14, # The aperture used to create the photo (f-number). 3121 "cameraMake": "A String", # The make of the camera used to create the photo. 3122 "cameraModel": "A String", # The model of the camera used to create the photo. 3123 "colorSpace": "A String", # The color space of the photo. 3124 "date": "A String", # The date and time the photo was taken (EXIF format timestamp). 3125 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 3126 "exposureMode": "A String", # The exposure mode used to create the photo. 3127 "exposureTime": 3.14, # The length of the exposure, in seconds. 3128 "flashUsed": True or False, # Whether a flash was used to create the photo. 3129 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 3130 "height": 42, # The height of the image in pixels. 3131 "isoSpeed": 42, # The ISO speed used to create the photo. 3132 "lens": "A String", # The lens used to create the photo. 3133 "location": { # Geographic location information stored in the image. 3134 "altitude": 3.14, # The altitude stored in the image. 3135 "latitude": 3.14, # The latitude stored in the image. 3136 "longitude": 3.14, # The longitude stored in the image. 3137 }, 3138 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 3139 "meteringMode": "A String", # The metering mode used to create the photo. 3140 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation. 3141 "sensor": "A String", # The type of sensor used to create the photo. 3142 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 3143 "whiteBalance": "A String", # The white balance mode used to create the photo. 3144 "width": 42, # The width of the image in pixels. 3145 }, 3146 "indexableText": { # Indexable text attributes for the file (can only be written) 3147 "text": "A String", # The text to be indexed for this file. 3148 }, 3149 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 3150 "kind": "drive#file", # The type of file. This is always drive#file. 3151 "labels": { # A group of labels for the file. 3152 "hidden": True or False, # Deprecated. 3153 "modified": True or False, # Whether the file has been modified by this user. 3154 "restricted": True or False, # Deprecated - use copyRequiresWriterPermission instead. 3155 "starred": True or False, # Whether this file is starred by the user. 3156 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 3157 "viewed": True or False, # Whether this file has been viewed by this user. 3158 }, 3159 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file. 3160 "displayName": "A String", # A plain text displayable name for this user. 3161 "emailAddress": "A String", # The email address of the user. 3162 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 3163 "kind": "drive#user", # This is always drive#user. 3164 "permissionId": "A String", # The user's ID as visible in the permissions collection. 3165 "picture": { # The user's profile picture. 3166 "url": "A String", # A URL that points to a profile picture of this user. 3167 }, 3168 }, 3169 "lastModifyingUserName": "A String", # Name of the last user to modify this file. 3170 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp). 3171 "linkShareMetadata": { # Contains details about the link URLs that clients are using to refer to this item. 3172 "securityUpdateEligible": True or False, # Whether the file is eligible for security update. 3173 "securityUpdateEnabled": True or False, # Whether the security update is enabled for this file. 3174 }, 3175 "markedViewedByMeDate": "A String", # Deprecated. 3176 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 3177 "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. 3178 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. 3179 "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. 3180 "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. 3181 "a_key": "A String", 3182 }, 3183 "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 Google Drive. 3184 "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for items in shared drives. 3185 "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for items in shared drives. 3186 "A String", 3187 ], 3188 "owners": [ # The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. 3189 { # Information about a Drive user. 3190 "displayName": "A String", # A plain text displayable name for this user. 3191 "emailAddress": "A String", # The email address of the user. 3192 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 3193 "kind": "drive#user", # This is always drive#user. 3194 "permissionId": "A String", # The user's ID as visible in the permissions collection. 3195 "picture": { # The user's profile picture. 3196 "url": "A String", # A URL that points to a profile picture of this user. 3197 }, 3198 }, 3199 ], 3200 "parents": [ # Collection of parent folders which contain this file. 3201 # If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list. 3202 { # A reference to a file's parent. 3203 "id": "A String", # The ID of the parent. 3204 "isRoot": True or False, # Whether or not the parent is the root folder. 3205 "kind": "drive#parentReference", # This is always drive#parentReference. 3206 "parentLink": "A String", # A link to the parent. 3207 "selfLink": "A String", # A link back to this reference. 3208 }, 3209 ], 3210 "permissionIds": [ # List of permission IDs for users with access to this file. 3211 "A String", 3212 ], 3213 "permissions": [ # The list of permissions for users with access to this file. Not populated for items in shared drives. 3214 { # A permission for a file. 3215 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 3216 "A String", 3217 ], 3218 "authKey": "A String", # Deprecated. 3219 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 3220 "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. 3221 "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. 3222 "etag": "A String", # The ETag of the permission. 3223 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 3224 # - They cannot be set on shared drive items 3225 # - They can only be set on user and group permissions 3226 # - The date must be in the future 3227 # - The date cannot be more than a year in the future 3228 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 3229 "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. 3230 "kind": "drive#permission", # This is always drive#permission. 3231 "name": "A String", # The name for this permission. 3232 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 3233 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 3234 { 3235 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 3236 "A String", 3237 ], 3238 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 3239 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 3240 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 3241 # - file 3242 # - member 3243 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 3244 # - organizer 3245 # - fileOrganizer 3246 # - writer 3247 # - reader 3248 }, 3249 ], 3250 "photoLink": "A String", # A link to the profile photo, if available. 3251 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 3252 # - owner 3253 # - organizer 3254 # - fileOrganizer 3255 # - writer 3256 # - reader 3257 "selfLink": "A String", # A link back to this permission. 3258 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 3259 { 3260 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 3261 "A String", 3262 ], 3263 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 3264 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 3265 "role": "A String", # Deprecated - use permissionDetails/role instead. 3266 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 3267 }, 3268 ], 3269 "type": "A String", # The account type. Allowed values are: 3270 # - user 3271 # - group 3272 # - domain 3273 # - anyone 3274 "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. 3275 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 3276 "withLink": True or False, # Whether the link is required for this permission. 3277 }, 3278 ], 3279 "properties": [ # The list of properties. 3280 { # A key-value pair attached to a file that is either public or private to an application. 3281 # The following limits apply to file properties: 3282 # - Maximum of 100 properties total per file 3283 # - Maximum of 30 private properties per app 3284 # - Maximum of 30 public properties 3285 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. 3286 "etag": "A String", # ETag of the property. 3287 "key": "A String", # The key of this property. 3288 "kind": "drive#property", # This is always drive#property. 3289 "selfLink": "A String", # The link back to this property. 3290 "value": "A String", # The value of this property. 3291 "visibility": "A String", # The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. 3292 }, 3293 ], 3294 "quotaBytesUsed": "A String", # The number of quota bytes used by this file. 3295 "resourceKey": "A String", # A key needed to access the item via a shared link. 3296 "selfLink": "A String", # A link back to this file. 3297 "shareable": True or False, # Deprecated: use capabilities/canShare. 3298 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 3299 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp). 3300 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available. 3301 "displayName": "A String", # A plain text displayable name for this user. 3302 "emailAddress": "A String", # The email address of the user. 3303 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 3304 "kind": "drive#user", # This is always drive#user. 3305 "permissionId": "A String", # The user's ID as visible in the permissions collection. 3306 "picture": { # The user's profile picture. 3307 "url": "A String", # A URL that points to a profile picture of this user. 3308 }, 3309 }, 3310 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. 3311 "targetId": "A String", # The ID of the file that this shortcut points to. 3312 "targetMimeType": "A String", # The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. 3313 "targetResourceKey": "A String", # The ResourceKey for the target file. 3314 }, 3315 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. 3316 "A String", 3317 ], 3318 "teamDriveId": "A String", # Deprecated - use driveId instead. 3319 "thumbnail": { # A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. 3320 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. 3321 "mimeType": "A String", # The MIME type of the thumbnail. 3322 }, 3323 "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. 3324 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 3325 "title": "A String", # The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. 3326 "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. 3327 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. 3328 "displayName": "A String", # A plain text displayable name for this user. 3329 "emailAddress": "A String", # The email address of the user. 3330 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 3331 "kind": "drive#user", # This is always drive#user. 3332 "permissionId": "A String", # The user's ID as visible in the permissions collection. 3333 "picture": { # The user's profile picture. 3334 "url": "A String", # A URL that points to a profile picture of this user. 3335 }, 3336 }, 3337 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file. 3338 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 3339 "A String", 3340 ], 3341 "authKey": "A String", # Deprecated. 3342 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 3343 "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. 3344 "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. 3345 "etag": "A String", # The ETag of the permission. 3346 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 3347 # - They cannot be set on shared drive items 3348 # - They can only be set on user and group permissions 3349 # - The date must be in the future 3350 # - The date cannot be more than a year in the future 3351 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 3352 "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. 3353 "kind": "drive#permission", # This is always drive#permission. 3354 "name": "A String", # The name for this permission. 3355 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 3356 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 3357 { 3358 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 3359 "A String", 3360 ], 3361 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 3362 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 3363 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 3364 # - file 3365 # - member 3366 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 3367 # - organizer 3368 # - fileOrganizer 3369 # - writer 3370 # - reader 3371 }, 3372 ], 3373 "photoLink": "A String", # A link to the profile photo, if available. 3374 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 3375 # - owner 3376 # - organizer 3377 # - fileOrganizer 3378 # - writer 3379 # - reader 3380 "selfLink": "A String", # A link back to this permission. 3381 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 3382 { 3383 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 3384 "A String", 3385 ], 3386 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 3387 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 3388 "role": "A String", # Deprecated - use permissionDetails/role instead. 3389 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 3390 }, 3391 ], 3392 "type": "A String", # The account type. Allowed values are: 3393 # - user 3394 # - group 3395 # - domain 3396 # - anyone 3397 "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. 3398 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 3399 "withLink": True or False, # Whether the link is required for this permission. 3400 }, 3401 "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. 3402 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types. 3403 "durationMillis": "A String", # The duration of the video in milliseconds. 3404 "height": 42, # The height of the video in pixels. 3405 "width": 42, # The width of the video in pixels. 3406 }, 3407 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. 3408 "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. 3409 "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for items in shared drives. 3410}</pre> 3411</div> 3412 3413<div class="method"> 3414 <code class="details" id="touch">touch(fileId, includePermissionsForView=None, supportsAllDrives=None, supportsTeamDrives=None)</code> 3415 <pre>Set the file's updated time to the current server time. 3416 3417Args: 3418 fileId: string, The ID of the file to update. (required) 3419 includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. 3420 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 3421 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 3422 3423Returns: 3424 An object of the form: 3425 3426 { # The metadata for a file. 3427 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer. 3428 "appDataContents": True or False, # Whether this file is in the Application Data folder. 3429 "canComment": True or False, # Deprecated: use capabilities/canComment. 3430 "canReadRevisions": True or False, # Deprecated: use capabilities/canReadRevisions. 3431 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 3432 "canAcceptOwnership": True or False, # Whether the current user is the pending owner of the file. Not populated for shared drive files. 3433 "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. 3434 "canAddFolderFromAnotherDrive": True or False, # Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. 3435 "canAddMyDriveParent": True or False, # Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. 3436 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 3437 "canChangeRestrictedDownload": True or False, # Deprecated 3438 "canChangeSecurityUpdateEnabled": True or False, # Whether the current user can change the securityUpdateEnabled field on link share metadata. 3439 "canComment": True or False, # Whether the current user can comment on this file. 3440 "canCopy": True or False, # Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. 3441 "canDelete": True or False, # Whether the current user can delete this file. 3442 "canDeleteChildren": True or False, # Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 3443 "canDownload": True or False, # Whether the current user can download this file. 3444 "canEdit": True or False, # Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. 3445 "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. 3446 "canModifyContent": True or False, # Whether the current user can modify the content of this file. 3447 "canModifyContentRestriction": True or False, # Whether the current user can modify restrictions on content of this file. 3448 "canMoveChildrenOutOfDrive": True or False, # Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 3449 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 3450 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. 3451 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 3452 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 3453 "canMoveItemOutOfDrive": True or False, # Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. 3454 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 3455 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. 3456 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 3457 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 3458 "canReadDrive": True or False, # Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. 3459 "canReadRevisions": True or False, # Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. 3460 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 3461 "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. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. 3462 "canRemoveMyDriveParent": True or False, # Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. 3463 "canRename": True or False, # Whether the current user can rename this file. 3464 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 3465 "canTrash": True or False, # Whether the current user can move this file to trash. 3466 "canTrashChildren": True or False, # Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 3467 "canUntrash": True or False, # Whether the current user can restore this file from trash. 3468 }, 3469 "contentRestrictions": [ # Restrictions for accessing the content of the file. Only populated if such a restriction exists. 3470 { # A restriction for accessing the content of the file. 3471 "readOnly": True or False, # Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. 3472 "reason": "A String", # Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. 3473 "restrictingUser": { # Information about a Drive user. # The user who set the content restriction. Only populated if readOnly is true. 3474 "displayName": "A String", # A plain text displayable name for this user. 3475 "emailAddress": "A String", # The email address of the user. 3476 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 3477 "kind": "drive#user", # This is always drive#user. 3478 "permissionId": "A String", # The user's ID as visible in the permissions collection. 3479 "picture": { # The user's profile picture. 3480 "url": "A String", # A URL that points to a profile picture of this user. 3481 }, 3482 }, 3483 "restrictionDate": "A String", # The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. 3484 "type": "A String", # The type of the content restriction. Currently the only possible value is globalContentRestriction. 3485 }, 3486 ], 3487 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 3488 "copyable": True or False, # Deprecated: use capabilities/canCopy. 3489 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp). 3490 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. 3491 "description": "A String", # A short description of the file. 3492 "downloadUrl": "A String", # Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 3493 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 3494 "editable": True or False, # Deprecated: use capabilities/canEdit. 3495 "embedLink": "A String", # A link for embedding the file. 3496 "etag": "A String", # ETag of the file. 3497 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. 3498 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 3499 "a_key": "A String", # A mapping from export format to URL 3500 }, 3501 "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 Google Drive; it is not populated for Docs Editors or shortcut files. 3502 "fileSize": "A String", # The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. 3503 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder or a shortcut to 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. 3504 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 3505 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives. 3506 "hasThumbnail": True or False, # Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. 3507 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 3508 "iconLink": "A String", # A link to the file's icon. 3509 "id": "A String", # The ID of the file. 3510 "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. 3511 "aperture": 3.14, # The aperture used to create the photo (f-number). 3512 "cameraMake": "A String", # The make of the camera used to create the photo. 3513 "cameraModel": "A String", # The model of the camera used to create the photo. 3514 "colorSpace": "A String", # The color space of the photo. 3515 "date": "A String", # The date and time the photo was taken (EXIF format timestamp). 3516 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 3517 "exposureMode": "A String", # The exposure mode used to create the photo. 3518 "exposureTime": 3.14, # The length of the exposure, in seconds. 3519 "flashUsed": True or False, # Whether a flash was used to create the photo. 3520 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 3521 "height": 42, # The height of the image in pixels. 3522 "isoSpeed": 42, # The ISO speed used to create the photo. 3523 "lens": "A String", # The lens used to create the photo. 3524 "location": { # Geographic location information stored in the image. 3525 "altitude": 3.14, # The altitude stored in the image. 3526 "latitude": 3.14, # The latitude stored in the image. 3527 "longitude": 3.14, # The longitude stored in the image. 3528 }, 3529 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 3530 "meteringMode": "A String", # The metering mode used to create the photo. 3531 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation. 3532 "sensor": "A String", # The type of sensor used to create the photo. 3533 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 3534 "whiteBalance": "A String", # The white balance mode used to create the photo. 3535 "width": 42, # The width of the image in pixels. 3536 }, 3537 "indexableText": { # Indexable text attributes for the file (can only be written) 3538 "text": "A String", # The text to be indexed for this file. 3539 }, 3540 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 3541 "kind": "drive#file", # The type of file. This is always drive#file. 3542 "labels": { # A group of labels for the file. 3543 "hidden": True or False, # Deprecated. 3544 "modified": True or False, # Whether the file has been modified by this user. 3545 "restricted": True or False, # Deprecated - use copyRequiresWriterPermission instead. 3546 "starred": True or False, # Whether this file is starred by the user. 3547 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 3548 "viewed": True or False, # Whether this file has been viewed by this user. 3549 }, 3550 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file. 3551 "displayName": "A String", # A plain text displayable name for this user. 3552 "emailAddress": "A String", # The email address of the user. 3553 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 3554 "kind": "drive#user", # This is always drive#user. 3555 "permissionId": "A String", # The user's ID as visible in the permissions collection. 3556 "picture": { # The user's profile picture. 3557 "url": "A String", # A URL that points to a profile picture of this user. 3558 }, 3559 }, 3560 "lastModifyingUserName": "A String", # Name of the last user to modify this file. 3561 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp). 3562 "linkShareMetadata": { # Contains details about the link URLs that clients are using to refer to this item. 3563 "securityUpdateEligible": True or False, # Whether the file is eligible for security update. 3564 "securityUpdateEnabled": True or False, # Whether the security update is enabled for this file. 3565 }, 3566 "markedViewedByMeDate": "A String", # Deprecated. 3567 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 3568 "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. 3569 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. 3570 "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. 3571 "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. 3572 "a_key": "A String", 3573 }, 3574 "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 Google Drive. 3575 "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for items in shared drives. 3576 "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for items in shared drives. 3577 "A String", 3578 ], 3579 "owners": [ # The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. 3580 { # Information about a Drive user. 3581 "displayName": "A String", # A plain text displayable name for this user. 3582 "emailAddress": "A String", # The email address of the user. 3583 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 3584 "kind": "drive#user", # This is always drive#user. 3585 "permissionId": "A String", # The user's ID as visible in the permissions collection. 3586 "picture": { # The user's profile picture. 3587 "url": "A String", # A URL that points to a profile picture of this user. 3588 }, 3589 }, 3590 ], 3591 "parents": [ # Collection of parent folders which contain this file. 3592 # If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list. 3593 { # A reference to a file's parent. 3594 "id": "A String", # The ID of the parent. 3595 "isRoot": True or False, # Whether or not the parent is the root folder. 3596 "kind": "drive#parentReference", # This is always drive#parentReference. 3597 "parentLink": "A String", # A link to the parent. 3598 "selfLink": "A String", # A link back to this reference. 3599 }, 3600 ], 3601 "permissionIds": [ # List of permission IDs for users with access to this file. 3602 "A String", 3603 ], 3604 "permissions": [ # The list of permissions for users with access to this file. Not populated for items in shared drives. 3605 { # A permission for a file. 3606 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 3607 "A String", 3608 ], 3609 "authKey": "A String", # Deprecated. 3610 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 3611 "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. 3612 "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. 3613 "etag": "A String", # The ETag of the permission. 3614 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 3615 # - They cannot be set on shared drive items 3616 # - They can only be set on user and group permissions 3617 # - The date must be in the future 3618 # - The date cannot be more than a year in the future 3619 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 3620 "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. 3621 "kind": "drive#permission", # This is always drive#permission. 3622 "name": "A String", # The name for this permission. 3623 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 3624 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 3625 { 3626 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 3627 "A String", 3628 ], 3629 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 3630 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 3631 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 3632 # - file 3633 # - member 3634 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 3635 # - organizer 3636 # - fileOrganizer 3637 # - writer 3638 # - reader 3639 }, 3640 ], 3641 "photoLink": "A String", # A link to the profile photo, if available. 3642 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 3643 # - owner 3644 # - organizer 3645 # - fileOrganizer 3646 # - writer 3647 # - reader 3648 "selfLink": "A String", # A link back to this permission. 3649 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 3650 { 3651 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 3652 "A String", 3653 ], 3654 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 3655 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 3656 "role": "A String", # Deprecated - use permissionDetails/role instead. 3657 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 3658 }, 3659 ], 3660 "type": "A String", # The account type. Allowed values are: 3661 # - user 3662 # - group 3663 # - domain 3664 # - anyone 3665 "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. 3666 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 3667 "withLink": True or False, # Whether the link is required for this permission. 3668 }, 3669 ], 3670 "properties": [ # The list of properties. 3671 { # A key-value pair attached to a file that is either public or private to an application. 3672 # The following limits apply to file properties: 3673 # - Maximum of 100 properties total per file 3674 # - Maximum of 30 private properties per app 3675 # - Maximum of 30 public properties 3676 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. 3677 "etag": "A String", # ETag of the property. 3678 "key": "A String", # The key of this property. 3679 "kind": "drive#property", # This is always drive#property. 3680 "selfLink": "A String", # The link back to this property. 3681 "value": "A String", # The value of this property. 3682 "visibility": "A String", # The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. 3683 }, 3684 ], 3685 "quotaBytesUsed": "A String", # The number of quota bytes used by this file. 3686 "resourceKey": "A String", # A key needed to access the item via a shared link. 3687 "selfLink": "A String", # A link back to this file. 3688 "shareable": True or False, # Deprecated: use capabilities/canShare. 3689 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 3690 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp). 3691 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available. 3692 "displayName": "A String", # A plain text displayable name for this user. 3693 "emailAddress": "A String", # The email address of the user. 3694 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 3695 "kind": "drive#user", # This is always drive#user. 3696 "permissionId": "A String", # The user's ID as visible in the permissions collection. 3697 "picture": { # The user's profile picture. 3698 "url": "A String", # A URL that points to a profile picture of this user. 3699 }, 3700 }, 3701 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. 3702 "targetId": "A String", # The ID of the file that this shortcut points to. 3703 "targetMimeType": "A String", # The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. 3704 "targetResourceKey": "A String", # The ResourceKey for the target file. 3705 }, 3706 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. 3707 "A String", 3708 ], 3709 "teamDriveId": "A String", # Deprecated - use driveId instead. 3710 "thumbnail": { # A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. 3711 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. 3712 "mimeType": "A String", # The MIME type of the thumbnail. 3713 }, 3714 "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. 3715 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 3716 "title": "A String", # The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. 3717 "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. 3718 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. 3719 "displayName": "A String", # A plain text displayable name for this user. 3720 "emailAddress": "A String", # The email address of the user. 3721 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 3722 "kind": "drive#user", # This is always drive#user. 3723 "permissionId": "A String", # The user's ID as visible in the permissions collection. 3724 "picture": { # The user's profile picture. 3725 "url": "A String", # A URL that points to a profile picture of this user. 3726 }, 3727 }, 3728 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file. 3729 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 3730 "A String", 3731 ], 3732 "authKey": "A String", # Deprecated. 3733 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 3734 "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. 3735 "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. 3736 "etag": "A String", # The ETag of the permission. 3737 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 3738 # - They cannot be set on shared drive items 3739 # - They can only be set on user and group permissions 3740 # - The date must be in the future 3741 # - The date cannot be more than a year in the future 3742 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 3743 "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. 3744 "kind": "drive#permission", # This is always drive#permission. 3745 "name": "A String", # The name for this permission. 3746 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 3747 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 3748 { 3749 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 3750 "A String", 3751 ], 3752 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 3753 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 3754 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 3755 # - file 3756 # - member 3757 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 3758 # - organizer 3759 # - fileOrganizer 3760 # - writer 3761 # - reader 3762 }, 3763 ], 3764 "photoLink": "A String", # A link to the profile photo, if available. 3765 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 3766 # - owner 3767 # - organizer 3768 # - fileOrganizer 3769 # - writer 3770 # - reader 3771 "selfLink": "A String", # A link back to this permission. 3772 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 3773 { 3774 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 3775 "A String", 3776 ], 3777 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 3778 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 3779 "role": "A String", # Deprecated - use permissionDetails/role instead. 3780 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 3781 }, 3782 ], 3783 "type": "A String", # The account type. Allowed values are: 3784 # - user 3785 # - group 3786 # - domain 3787 # - anyone 3788 "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. 3789 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 3790 "withLink": True or False, # Whether the link is required for this permission. 3791 }, 3792 "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. 3793 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types. 3794 "durationMillis": "A String", # The duration of the video in milliseconds. 3795 "height": 42, # The height of the video in pixels. 3796 "width": 42, # The width of the video in pixels. 3797 }, 3798 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. 3799 "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. 3800 "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for items in shared drives. 3801}</pre> 3802</div> 3803 3804<div class="method"> 3805 <code class="details" id="trash">trash(fileId, includePermissionsForView=None, supportsAllDrives=None, supportsTeamDrives=None)</code> 3806 <pre>Moves a file to the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for shared drive files. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 3807 3808Args: 3809 fileId: string, The ID of the file to trash. (required) 3810 includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. 3811 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 3812 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 3813 3814Returns: 3815 An object of the form: 3816 3817 { # The metadata for a file. 3818 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer. 3819 "appDataContents": True or False, # Whether this file is in the Application Data folder. 3820 "canComment": True or False, # Deprecated: use capabilities/canComment. 3821 "canReadRevisions": True or False, # Deprecated: use capabilities/canReadRevisions. 3822 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 3823 "canAcceptOwnership": True or False, # Whether the current user is the pending owner of the file. Not populated for shared drive files. 3824 "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. 3825 "canAddFolderFromAnotherDrive": True or False, # Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. 3826 "canAddMyDriveParent": True or False, # Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. 3827 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 3828 "canChangeRestrictedDownload": True or False, # Deprecated 3829 "canChangeSecurityUpdateEnabled": True or False, # Whether the current user can change the securityUpdateEnabled field on link share metadata. 3830 "canComment": True or False, # Whether the current user can comment on this file. 3831 "canCopy": True or False, # Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. 3832 "canDelete": True or False, # Whether the current user can delete this file. 3833 "canDeleteChildren": True or False, # Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 3834 "canDownload": True or False, # Whether the current user can download this file. 3835 "canEdit": True or False, # Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. 3836 "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. 3837 "canModifyContent": True or False, # Whether the current user can modify the content of this file. 3838 "canModifyContentRestriction": True or False, # Whether the current user can modify restrictions on content of this file. 3839 "canMoveChildrenOutOfDrive": True or False, # Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 3840 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 3841 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. 3842 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 3843 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 3844 "canMoveItemOutOfDrive": True or False, # Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. 3845 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 3846 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. 3847 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 3848 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 3849 "canReadDrive": True or False, # Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. 3850 "canReadRevisions": True or False, # Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. 3851 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 3852 "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. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. 3853 "canRemoveMyDriveParent": True or False, # Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. 3854 "canRename": True or False, # Whether the current user can rename this file. 3855 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 3856 "canTrash": True or False, # Whether the current user can move this file to trash. 3857 "canTrashChildren": True or False, # Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 3858 "canUntrash": True or False, # Whether the current user can restore this file from trash. 3859 }, 3860 "contentRestrictions": [ # Restrictions for accessing the content of the file. Only populated if such a restriction exists. 3861 { # A restriction for accessing the content of the file. 3862 "readOnly": True or False, # Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. 3863 "reason": "A String", # Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. 3864 "restrictingUser": { # Information about a Drive user. # The user who set the content restriction. Only populated if readOnly is true. 3865 "displayName": "A String", # A plain text displayable name for this user. 3866 "emailAddress": "A String", # The email address of the user. 3867 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 3868 "kind": "drive#user", # This is always drive#user. 3869 "permissionId": "A String", # The user's ID as visible in the permissions collection. 3870 "picture": { # The user's profile picture. 3871 "url": "A String", # A URL that points to a profile picture of this user. 3872 }, 3873 }, 3874 "restrictionDate": "A String", # The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. 3875 "type": "A String", # The type of the content restriction. Currently the only possible value is globalContentRestriction. 3876 }, 3877 ], 3878 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 3879 "copyable": True or False, # Deprecated: use capabilities/canCopy. 3880 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp). 3881 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. 3882 "description": "A String", # A short description of the file. 3883 "downloadUrl": "A String", # Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 3884 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 3885 "editable": True or False, # Deprecated: use capabilities/canEdit. 3886 "embedLink": "A String", # A link for embedding the file. 3887 "etag": "A String", # ETag of the file. 3888 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. 3889 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 3890 "a_key": "A String", # A mapping from export format to URL 3891 }, 3892 "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 Google Drive; it is not populated for Docs Editors or shortcut files. 3893 "fileSize": "A String", # The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. 3894 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder or a shortcut to 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. 3895 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 3896 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives. 3897 "hasThumbnail": True or False, # Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. 3898 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 3899 "iconLink": "A String", # A link to the file's icon. 3900 "id": "A String", # The ID of the file. 3901 "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. 3902 "aperture": 3.14, # The aperture used to create the photo (f-number). 3903 "cameraMake": "A String", # The make of the camera used to create the photo. 3904 "cameraModel": "A String", # The model of the camera used to create the photo. 3905 "colorSpace": "A String", # The color space of the photo. 3906 "date": "A String", # The date and time the photo was taken (EXIF format timestamp). 3907 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 3908 "exposureMode": "A String", # The exposure mode used to create the photo. 3909 "exposureTime": 3.14, # The length of the exposure, in seconds. 3910 "flashUsed": True or False, # Whether a flash was used to create the photo. 3911 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 3912 "height": 42, # The height of the image in pixels. 3913 "isoSpeed": 42, # The ISO speed used to create the photo. 3914 "lens": "A String", # The lens used to create the photo. 3915 "location": { # Geographic location information stored in the image. 3916 "altitude": 3.14, # The altitude stored in the image. 3917 "latitude": 3.14, # The latitude stored in the image. 3918 "longitude": 3.14, # The longitude stored in the image. 3919 }, 3920 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 3921 "meteringMode": "A String", # The metering mode used to create the photo. 3922 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation. 3923 "sensor": "A String", # The type of sensor used to create the photo. 3924 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 3925 "whiteBalance": "A String", # The white balance mode used to create the photo. 3926 "width": 42, # The width of the image in pixels. 3927 }, 3928 "indexableText": { # Indexable text attributes for the file (can only be written) 3929 "text": "A String", # The text to be indexed for this file. 3930 }, 3931 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 3932 "kind": "drive#file", # The type of file. This is always drive#file. 3933 "labels": { # A group of labels for the file. 3934 "hidden": True or False, # Deprecated. 3935 "modified": True or False, # Whether the file has been modified by this user. 3936 "restricted": True or False, # Deprecated - use copyRequiresWriterPermission instead. 3937 "starred": True or False, # Whether this file is starred by the user. 3938 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 3939 "viewed": True or False, # Whether this file has been viewed by this user. 3940 }, 3941 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file. 3942 "displayName": "A String", # A plain text displayable name for this user. 3943 "emailAddress": "A String", # The email address of the user. 3944 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 3945 "kind": "drive#user", # This is always drive#user. 3946 "permissionId": "A String", # The user's ID as visible in the permissions collection. 3947 "picture": { # The user's profile picture. 3948 "url": "A String", # A URL that points to a profile picture of this user. 3949 }, 3950 }, 3951 "lastModifyingUserName": "A String", # Name of the last user to modify this file. 3952 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp). 3953 "linkShareMetadata": { # Contains details about the link URLs that clients are using to refer to this item. 3954 "securityUpdateEligible": True or False, # Whether the file is eligible for security update. 3955 "securityUpdateEnabled": True or False, # Whether the security update is enabled for this file. 3956 }, 3957 "markedViewedByMeDate": "A String", # Deprecated. 3958 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 3959 "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. 3960 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. 3961 "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. 3962 "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. 3963 "a_key": "A String", 3964 }, 3965 "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 Google Drive. 3966 "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for items in shared drives. 3967 "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for items in shared drives. 3968 "A String", 3969 ], 3970 "owners": [ # The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. 3971 { # Information about a Drive user. 3972 "displayName": "A String", # A plain text displayable name for this user. 3973 "emailAddress": "A String", # The email address of the user. 3974 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 3975 "kind": "drive#user", # This is always drive#user. 3976 "permissionId": "A String", # The user's ID as visible in the permissions collection. 3977 "picture": { # The user's profile picture. 3978 "url": "A String", # A URL that points to a profile picture of this user. 3979 }, 3980 }, 3981 ], 3982 "parents": [ # Collection of parent folders which contain this file. 3983 # If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list. 3984 { # A reference to a file's parent. 3985 "id": "A String", # The ID of the parent. 3986 "isRoot": True or False, # Whether or not the parent is the root folder. 3987 "kind": "drive#parentReference", # This is always drive#parentReference. 3988 "parentLink": "A String", # A link to the parent. 3989 "selfLink": "A String", # A link back to this reference. 3990 }, 3991 ], 3992 "permissionIds": [ # List of permission IDs for users with access to this file. 3993 "A String", 3994 ], 3995 "permissions": [ # The list of permissions for users with access to this file. Not populated for items in shared drives. 3996 { # A permission for a file. 3997 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 3998 "A String", 3999 ], 4000 "authKey": "A String", # Deprecated. 4001 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 4002 "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. 4003 "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. 4004 "etag": "A String", # The ETag of the permission. 4005 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 4006 # - They cannot be set on shared drive items 4007 # - They can only be set on user and group permissions 4008 # - The date must be in the future 4009 # - The date cannot be more than a year in the future 4010 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 4011 "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. 4012 "kind": "drive#permission", # This is always drive#permission. 4013 "name": "A String", # The name for this permission. 4014 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 4015 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 4016 { 4017 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 4018 "A String", 4019 ], 4020 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 4021 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 4022 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 4023 # - file 4024 # - member 4025 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 4026 # - organizer 4027 # - fileOrganizer 4028 # - writer 4029 # - reader 4030 }, 4031 ], 4032 "photoLink": "A String", # A link to the profile photo, if available. 4033 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 4034 # - owner 4035 # - organizer 4036 # - fileOrganizer 4037 # - writer 4038 # - reader 4039 "selfLink": "A String", # A link back to this permission. 4040 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 4041 { 4042 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 4043 "A String", 4044 ], 4045 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 4046 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 4047 "role": "A String", # Deprecated - use permissionDetails/role instead. 4048 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 4049 }, 4050 ], 4051 "type": "A String", # The account type. Allowed values are: 4052 # - user 4053 # - group 4054 # - domain 4055 # - anyone 4056 "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. 4057 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 4058 "withLink": True or False, # Whether the link is required for this permission. 4059 }, 4060 ], 4061 "properties": [ # The list of properties. 4062 { # A key-value pair attached to a file that is either public or private to an application. 4063 # The following limits apply to file properties: 4064 # - Maximum of 100 properties total per file 4065 # - Maximum of 30 private properties per app 4066 # - Maximum of 30 public properties 4067 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. 4068 "etag": "A String", # ETag of the property. 4069 "key": "A String", # The key of this property. 4070 "kind": "drive#property", # This is always drive#property. 4071 "selfLink": "A String", # The link back to this property. 4072 "value": "A String", # The value of this property. 4073 "visibility": "A String", # The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. 4074 }, 4075 ], 4076 "quotaBytesUsed": "A String", # The number of quota bytes used by this file. 4077 "resourceKey": "A String", # A key needed to access the item via a shared link. 4078 "selfLink": "A String", # A link back to this file. 4079 "shareable": True or False, # Deprecated: use capabilities/canShare. 4080 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 4081 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp). 4082 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available. 4083 "displayName": "A String", # A plain text displayable name for this user. 4084 "emailAddress": "A String", # The email address of the user. 4085 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 4086 "kind": "drive#user", # This is always drive#user. 4087 "permissionId": "A String", # The user's ID as visible in the permissions collection. 4088 "picture": { # The user's profile picture. 4089 "url": "A String", # A URL that points to a profile picture of this user. 4090 }, 4091 }, 4092 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. 4093 "targetId": "A String", # The ID of the file that this shortcut points to. 4094 "targetMimeType": "A String", # The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. 4095 "targetResourceKey": "A String", # The ResourceKey for the target file. 4096 }, 4097 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. 4098 "A String", 4099 ], 4100 "teamDriveId": "A String", # Deprecated - use driveId instead. 4101 "thumbnail": { # A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. 4102 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. 4103 "mimeType": "A String", # The MIME type of the thumbnail. 4104 }, 4105 "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. 4106 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 4107 "title": "A String", # The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. 4108 "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. 4109 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. 4110 "displayName": "A String", # A plain text displayable name for this user. 4111 "emailAddress": "A String", # The email address of the user. 4112 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 4113 "kind": "drive#user", # This is always drive#user. 4114 "permissionId": "A String", # The user's ID as visible in the permissions collection. 4115 "picture": { # The user's profile picture. 4116 "url": "A String", # A URL that points to a profile picture of this user. 4117 }, 4118 }, 4119 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file. 4120 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 4121 "A String", 4122 ], 4123 "authKey": "A String", # Deprecated. 4124 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 4125 "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. 4126 "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. 4127 "etag": "A String", # The ETag of the permission. 4128 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 4129 # - They cannot be set on shared drive items 4130 # - They can only be set on user and group permissions 4131 # - The date must be in the future 4132 # - The date cannot be more than a year in the future 4133 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 4134 "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. 4135 "kind": "drive#permission", # This is always drive#permission. 4136 "name": "A String", # The name for this permission. 4137 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 4138 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 4139 { 4140 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 4141 "A String", 4142 ], 4143 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 4144 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 4145 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 4146 # - file 4147 # - member 4148 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 4149 # - organizer 4150 # - fileOrganizer 4151 # - writer 4152 # - reader 4153 }, 4154 ], 4155 "photoLink": "A String", # A link to the profile photo, if available. 4156 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 4157 # - owner 4158 # - organizer 4159 # - fileOrganizer 4160 # - writer 4161 # - reader 4162 "selfLink": "A String", # A link back to this permission. 4163 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 4164 { 4165 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 4166 "A String", 4167 ], 4168 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 4169 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 4170 "role": "A String", # Deprecated - use permissionDetails/role instead. 4171 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 4172 }, 4173 ], 4174 "type": "A String", # The account type. Allowed values are: 4175 # - user 4176 # - group 4177 # - domain 4178 # - anyone 4179 "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. 4180 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 4181 "withLink": True or False, # Whether the link is required for this permission. 4182 }, 4183 "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. 4184 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types. 4185 "durationMillis": "A String", # The duration of the video in milliseconds. 4186 "height": 42, # The height of the video in pixels. 4187 "width": 42, # The width of the video in pixels. 4188 }, 4189 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. 4190 "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. 4191 "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for items in shared drives. 4192}</pre> 4193</div> 4194 4195<div class="method"> 4196 <code class="details" id="untrash">untrash(fileId, includePermissionsForView=None, supportsAllDrives=None, supportsTeamDrives=None)</code> 4197 <pre>Restores a file from the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for shared drive files. Only the owner may untrash a file. 4198 4199Args: 4200 fileId: string, The ID of the file to untrash. (required) 4201 includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. 4202 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 4203 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 4204 4205Returns: 4206 An object of the form: 4207 4208 { # The metadata for a file. 4209 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer. 4210 "appDataContents": True or False, # Whether this file is in the Application Data folder. 4211 "canComment": True or False, # Deprecated: use capabilities/canComment. 4212 "canReadRevisions": True or False, # Deprecated: use capabilities/canReadRevisions. 4213 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 4214 "canAcceptOwnership": True or False, # Whether the current user is the pending owner of the file. Not populated for shared drive files. 4215 "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. 4216 "canAddFolderFromAnotherDrive": True or False, # Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. 4217 "canAddMyDriveParent": True or False, # Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. 4218 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 4219 "canChangeRestrictedDownload": True or False, # Deprecated 4220 "canChangeSecurityUpdateEnabled": True or False, # Whether the current user can change the securityUpdateEnabled field on link share metadata. 4221 "canComment": True or False, # Whether the current user can comment on this file. 4222 "canCopy": True or False, # Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. 4223 "canDelete": True or False, # Whether the current user can delete this file. 4224 "canDeleteChildren": True or False, # Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 4225 "canDownload": True or False, # Whether the current user can download this file. 4226 "canEdit": True or False, # Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. 4227 "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. 4228 "canModifyContent": True or False, # Whether the current user can modify the content of this file. 4229 "canModifyContentRestriction": True or False, # Whether the current user can modify restrictions on content of this file. 4230 "canMoveChildrenOutOfDrive": True or False, # Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 4231 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 4232 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. 4233 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 4234 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 4235 "canMoveItemOutOfDrive": True or False, # Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. 4236 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 4237 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. 4238 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 4239 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 4240 "canReadDrive": True or False, # Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. 4241 "canReadRevisions": True or False, # Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. 4242 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 4243 "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. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. 4244 "canRemoveMyDriveParent": True or False, # Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. 4245 "canRename": True or False, # Whether the current user can rename this file. 4246 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 4247 "canTrash": True or False, # Whether the current user can move this file to trash. 4248 "canTrashChildren": True or False, # Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 4249 "canUntrash": True or False, # Whether the current user can restore this file from trash. 4250 }, 4251 "contentRestrictions": [ # Restrictions for accessing the content of the file. Only populated if such a restriction exists. 4252 { # A restriction for accessing the content of the file. 4253 "readOnly": True or False, # Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. 4254 "reason": "A String", # Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. 4255 "restrictingUser": { # Information about a Drive user. # The user who set the content restriction. Only populated if readOnly is true. 4256 "displayName": "A String", # A plain text displayable name for this user. 4257 "emailAddress": "A String", # The email address of the user. 4258 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 4259 "kind": "drive#user", # This is always drive#user. 4260 "permissionId": "A String", # The user's ID as visible in the permissions collection. 4261 "picture": { # The user's profile picture. 4262 "url": "A String", # A URL that points to a profile picture of this user. 4263 }, 4264 }, 4265 "restrictionDate": "A String", # The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. 4266 "type": "A String", # The type of the content restriction. Currently the only possible value is globalContentRestriction. 4267 }, 4268 ], 4269 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 4270 "copyable": True or False, # Deprecated: use capabilities/canCopy. 4271 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp). 4272 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. 4273 "description": "A String", # A short description of the file. 4274 "downloadUrl": "A String", # Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 4275 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 4276 "editable": True or False, # Deprecated: use capabilities/canEdit. 4277 "embedLink": "A String", # A link for embedding the file. 4278 "etag": "A String", # ETag of the file. 4279 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. 4280 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 4281 "a_key": "A String", # A mapping from export format to URL 4282 }, 4283 "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 Google Drive; it is not populated for Docs Editors or shortcut files. 4284 "fileSize": "A String", # The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. 4285 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder or a shortcut to 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. 4286 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 4287 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives. 4288 "hasThumbnail": True or False, # Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. 4289 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 4290 "iconLink": "A String", # A link to the file's icon. 4291 "id": "A String", # The ID of the file. 4292 "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. 4293 "aperture": 3.14, # The aperture used to create the photo (f-number). 4294 "cameraMake": "A String", # The make of the camera used to create the photo. 4295 "cameraModel": "A String", # The model of the camera used to create the photo. 4296 "colorSpace": "A String", # The color space of the photo. 4297 "date": "A String", # The date and time the photo was taken (EXIF format timestamp). 4298 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 4299 "exposureMode": "A String", # The exposure mode used to create the photo. 4300 "exposureTime": 3.14, # The length of the exposure, in seconds. 4301 "flashUsed": True or False, # Whether a flash was used to create the photo. 4302 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 4303 "height": 42, # The height of the image in pixels. 4304 "isoSpeed": 42, # The ISO speed used to create the photo. 4305 "lens": "A String", # The lens used to create the photo. 4306 "location": { # Geographic location information stored in the image. 4307 "altitude": 3.14, # The altitude stored in the image. 4308 "latitude": 3.14, # The latitude stored in the image. 4309 "longitude": 3.14, # The longitude stored in the image. 4310 }, 4311 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 4312 "meteringMode": "A String", # The metering mode used to create the photo. 4313 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation. 4314 "sensor": "A String", # The type of sensor used to create the photo. 4315 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 4316 "whiteBalance": "A String", # The white balance mode used to create the photo. 4317 "width": 42, # The width of the image in pixels. 4318 }, 4319 "indexableText": { # Indexable text attributes for the file (can only be written) 4320 "text": "A String", # The text to be indexed for this file. 4321 }, 4322 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 4323 "kind": "drive#file", # The type of file. This is always drive#file. 4324 "labels": { # A group of labels for the file. 4325 "hidden": True or False, # Deprecated. 4326 "modified": True or False, # Whether the file has been modified by this user. 4327 "restricted": True or False, # Deprecated - use copyRequiresWriterPermission instead. 4328 "starred": True or False, # Whether this file is starred by the user. 4329 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 4330 "viewed": True or False, # Whether this file has been viewed by this user. 4331 }, 4332 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file. 4333 "displayName": "A String", # A plain text displayable name for this user. 4334 "emailAddress": "A String", # The email address of the user. 4335 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 4336 "kind": "drive#user", # This is always drive#user. 4337 "permissionId": "A String", # The user's ID as visible in the permissions collection. 4338 "picture": { # The user's profile picture. 4339 "url": "A String", # A URL that points to a profile picture of this user. 4340 }, 4341 }, 4342 "lastModifyingUserName": "A String", # Name of the last user to modify this file. 4343 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp). 4344 "linkShareMetadata": { # Contains details about the link URLs that clients are using to refer to this item. 4345 "securityUpdateEligible": True or False, # Whether the file is eligible for security update. 4346 "securityUpdateEnabled": True or False, # Whether the security update is enabled for this file. 4347 }, 4348 "markedViewedByMeDate": "A String", # Deprecated. 4349 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 4350 "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. 4351 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. 4352 "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. 4353 "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. 4354 "a_key": "A String", 4355 }, 4356 "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 Google Drive. 4357 "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for items in shared drives. 4358 "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for items in shared drives. 4359 "A String", 4360 ], 4361 "owners": [ # The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. 4362 { # Information about a Drive user. 4363 "displayName": "A String", # A plain text displayable name for this user. 4364 "emailAddress": "A String", # The email address of the user. 4365 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 4366 "kind": "drive#user", # This is always drive#user. 4367 "permissionId": "A String", # The user's ID as visible in the permissions collection. 4368 "picture": { # The user's profile picture. 4369 "url": "A String", # A URL that points to a profile picture of this user. 4370 }, 4371 }, 4372 ], 4373 "parents": [ # Collection of parent folders which contain this file. 4374 # If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list. 4375 { # A reference to a file's parent. 4376 "id": "A String", # The ID of the parent. 4377 "isRoot": True or False, # Whether or not the parent is the root folder. 4378 "kind": "drive#parentReference", # This is always drive#parentReference. 4379 "parentLink": "A String", # A link to the parent. 4380 "selfLink": "A String", # A link back to this reference. 4381 }, 4382 ], 4383 "permissionIds": [ # List of permission IDs for users with access to this file. 4384 "A String", 4385 ], 4386 "permissions": [ # The list of permissions for users with access to this file. Not populated for items in shared drives. 4387 { # A permission for a file. 4388 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 4389 "A String", 4390 ], 4391 "authKey": "A String", # Deprecated. 4392 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 4393 "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. 4394 "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. 4395 "etag": "A String", # The ETag of the permission. 4396 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 4397 # - They cannot be set on shared drive items 4398 # - They can only be set on user and group permissions 4399 # - The date must be in the future 4400 # - The date cannot be more than a year in the future 4401 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 4402 "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. 4403 "kind": "drive#permission", # This is always drive#permission. 4404 "name": "A String", # The name for this permission. 4405 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 4406 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 4407 { 4408 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 4409 "A String", 4410 ], 4411 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 4412 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 4413 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 4414 # - file 4415 # - member 4416 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 4417 # - organizer 4418 # - fileOrganizer 4419 # - writer 4420 # - reader 4421 }, 4422 ], 4423 "photoLink": "A String", # A link to the profile photo, if available. 4424 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 4425 # - owner 4426 # - organizer 4427 # - fileOrganizer 4428 # - writer 4429 # - reader 4430 "selfLink": "A String", # A link back to this permission. 4431 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 4432 { 4433 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 4434 "A String", 4435 ], 4436 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 4437 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 4438 "role": "A String", # Deprecated - use permissionDetails/role instead. 4439 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 4440 }, 4441 ], 4442 "type": "A String", # The account type. Allowed values are: 4443 # - user 4444 # - group 4445 # - domain 4446 # - anyone 4447 "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. 4448 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 4449 "withLink": True or False, # Whether the link is required for this permission. 4450 }, 4451 ], 4452 "properties": [ # The list of properties. 4453 { # A key-value pair attached to a file that is either public or private to an application. 4454 # The following limits apply to file properties: 4455 # - Maximum of 100 properties total per file 4456 # - Maximum of 30 private properties per app 4457 # - Maximum of 30 public properties 4458 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. 4459 "etag": "A String", # ETag of the property. 4460 "key": "A String", # The key of this property. 4461 "kind": "drive#property", # This is always drive#property. 4462 "selfLink": "A String", # The link back to this property. 4463 "value": "A String", # The value of this property. 4464 "visibility": "A String", # The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. 4465 }, 4466 ], 4467 "quotaBytesUsed": "A String", # The number of quota bytes used by this file. 4468 "resourceKey": "A String", # A key needed to access the item via a shared link. 4469 "selfLink": "A String", # A link back to this file. 4470 "shareable": True or False, # Deprecated: use capabilities/canShare. 4471 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 4472 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp). 4473 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available. 4474 "displayName": "A String", # A plain text displayable name for this user. 4475 "emailAddress": "A String", # The email address of the user. 4476 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 4477 "kind": "drive#user", # This is always drive#user. 4478 "permissionId": "A String", # The user's ID as visible in the permissions collection. 4479 "picture": { # The user's profile picture. 4480 "url": "A String", # A URL that points to a profile picture of this user. 4481 }, 4482 }, 4483 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. 4484 "targetId": "A String", # The ID of the file that this shortcut points to. 4485 "targetMimeType": "A String", # The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. 4486 "targetResourceKey": "A String", # The ResourceKey for the target file. 4487 }, 4488 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. 4489 "A String", 4490 ], 4491 "teamDriveId": "A String", # Deprecated - use driveId instead. 4492 "thumbnail": { # A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. 4493 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. 4494 "mimeType": "A String", # The MIME type of the thumbnail. 4495 }, 4496 "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. 4497 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 4498 "title": "A String", # The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. 4499 "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. 4500 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. 4501 "displayName": "A String", # A plain text displayable name for this user. 4502 "emailAddress": "A String", # The email address of the user. 4503 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 4504 "kind": "drive#user", # This is always drive#user. 4505 "permissionId": "A String", # The user's ID as visible in the permissions collection. 4506 "picture": { # The user's profile picture. 4507 "url": "A String", # A URL that points to a profile picture of this user. 4508 }, 4509 }, 4510 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file. 4511 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 4512 "A String", 4513 ], 4514 "authKey": "A String", # Deprecated. 4515 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 4516 "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. 4517 "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. 4518 "etag": "A String", # The ETag of the permission. 4519 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 4520 # - They cannot be set on shared drive items 4521 # - They can only be set on user and group permissions 4522 # - The date must be in the future 4523 # - The date cannot be more than a year in the future 4524 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 4525 "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. 4526 "kind": "drive#permission", # This is always drive#permission. 4527 "name": "A String", # The name for this permission. 4528 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 4529 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 4530 { 4531 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 4532 "A String", 4533 ], 4534 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 4535 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 4536 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 4537 # - file 4538 # - member 4539 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 4540 # - organizer 4541 # - fileOrganizer 4542 # - writer 4543 # - reader 4544 }, 4545 ], 4546 "photoLink": "A String", # A link to the profile photo, if available. 4547 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 4548 # - owner 4549 # - organizer 4550 # - fileOrganizer 4551 # - writer 4552 # - reader 4553 "selfLink": "A String", # A link back to this permission. 4554 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 4555 { 4556 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 4557 "A String", 4558 ], 4559 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 4560 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 4561 "role": "A String", # Deprecated - use permissionDetails/role instead. 4562 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 4563 }, 4564 ], 4565 "type": "A String", # The account type. Allowed values are: 4566 # - user 4567 # - group 4568 # - domain 4569 # - anyone 4570 "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. 4571 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 4572 "withLink": True or False, # Whether the link is required for this permission. 4573 }, 4574 "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. 4575 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types. 4576 "durationMillis": "A String", # The duration of the video in milliseconds. 4577 "height": 42, # The height of the video in pixels. 4578 "width": 42, # The width of the video in pixels. 4579 }, 4580 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. 4581 "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. 4582 "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for items in shared drives. 4583}</pre> 4584</div> 4585 4586<div class="method"> 4587 <code class="details" id="update">update(fileId, addParents=None, body=None, convert=None, enforceSingleParent=None, includePermissionsForView=None, media_body=None, media_mime_type=None, modifiedDateBehavior=None, newRevision=None, ocr=None, ocrLanguage=None, pinned=None, removeParents=None, setModifiedDate=None, supportsAllDrives=None, supportsTeamDrives=None, timedTextLanguage=None, timedTextTrackName=None, updateViewedDate=None, useContentAsIndexableText=None)</code> 4588 <pre>Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed automatically, such as modifiedDate. This method supports patch semantics. 4589 4590Args: 4591 fileId: string, The ID of the file to update. (required) 4592 body: object, The request body. 4593 The object takes the form of: 4594 4595{ # The metadata for a file. 4596 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer. 4597 "appDataContents": True or False, # Whether this file is in the Application Data folder. 4598 "canComment": True or False, # Deprecated: use capabilities/canComment. 4599 "canReadRevisions": True or False, # Deprecated: use capabilities/canReadRevisions. 4600 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 4601 "canAcceptOwnership": True or False, # Whether the current user is the pending owner of the file. Not populated for shared drive files. 4602 "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. 4603 "canAddFolderFromAnotherDrive": True or False, # Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. 4604 "canAddMyDriveParent": True or False, # Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. 4605 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 4606 "canChangeRestrictedDownload": True or False, # Deprecated 4607 "canChangeSecurityUpdateEnabled": True or False, # Whether the current user can change the securityUpdateEnabled field on link share metadata. 4608 "canComment": True or False, # Whether the current user can comment on this file. 4609 "canCopy": True or False, # Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. 4610 "canDelete": True or False, # Whether the current user can delete this file. 4611 "canDeleteChildren": True or False, # Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 4612 "canDownload": True or False, # Whether the current user can download this file. 4613 "canEdit": True or False, # Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. 4614 "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. 4615 "canModifyContent": True or False, # Whether the current user can modify the content of this file. 4616 "canModifyContentRestriction": True or False, # Whether the current user can modify restrictions on content of this file. 4617 "canMoveChildrenOutOfDrive": True or False, # Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 4618 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 4619 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. 4620 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 4621 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 4622 "canMoveItemOutOfDrive": True or False, # Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. 4623 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 4624 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. 4625 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 4626 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 4627 "canReadDrive": True or False, # Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. 4628 "canReadRevisions": True or False, # Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. 4629 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 4630 "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. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. 4631 "canRemoveMyDriveParent": True or False, # Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. 4632 "canRename": True or False, # Whether the current user can rename this file. 4633 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 4634 "canTrash": True or False, # Whether the current user can move this file to trash. 4635 "canTrashChildren": True or False, # Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 4636 "canUntrash": True or False, # Whether the current user can restore this file from trash. 4637 }, 4638 "contentRestrictions": [ # Restrictions for accessing the content of the file. Only populated if such a restriction exists. 4639 { # A restriction for accessing the content of the file. 4640 "readOnly": True or False, # Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. 4641 "reason": "A String", # Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. 4642 "restrictingUser": { # Information about a Drive user. # The user who set the content restriction. Only populated if readOnly is true. 4643 "displayName": "A String", # A plain text displayable name for this user. 4644 "emailAddress": "A String", # The email address of the user. 4645 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 4646 "kind": "drive#user", # This is always drive#user. 4647 "permissionId": "A String", # The user's ID as visible in the permissions collection. 4648 "picture": { # The user's profile picture. 4649 "url": "A String", # A URL that points to a profile picture of this user. 4650 }, 4651 }, 4652 "restrictionDate": "A String", # The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. 4653 "type": "A String", # The type of the content restriction. Currently the only possible value is globalContentRestriction. 4654 }, 4655 ], 4656 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 4657 "copyable": True or False, # Deprecated: use capabilities/canCopy. 4658 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp). 4659 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. 4660 "description": "A String", # A short description of the file. 4661 "downloadUrl": "A String", # Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 4662 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 4663 "editable": True or False, # Deprecated: use capabilities/canEdit. 4664 "embedLink": "A String", # A link for embedding the file. 4665 "etag": "A String", # ETag of the file. 4666 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. 4667 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 4668 "a_key": "A String", # A mapping from export format to URL 4669 }, 4670 "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 Google Drive; it is not populated for Docs Editors or shortcut files. 4671 "fileSize": "A String", # The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. 4672 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder or a shortcut to 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. 4673 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 4674 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives. 4675 "hasThumbnail": True or False, # Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. 4676 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 4677 "iconLink": "A String", # A link to the file's icon. 4678 "id": "A String", # The ID of the file. 4679 "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. 4680 "aperture": 3.14, # The aperture used to create the photo (f-number). 4681 "cameraMake": "A String", # The make of the camera used to create the photo. 4682 "cameraModel": "A String", # The model of the camera used to create the photo. 4683 "colorSpace": "A String", # The color space of the photo. 4684 "date": "A String", # The date and time the photo was taken (EXIF format timestamp). 4685 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 4686 "exposureMode": "A String", # The exposure mode used to create the photo. 4687 "exposureTime": 3.14, # The length of the exposure, in seconds. 4688 "flashUsed": True or False, # Whether a flash was used to create the photo. 4689 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 4690 "height": 42, # The height of the image in pixels. 4691 "isoSpeed": 42, # The ISO speed used to create the photo. 4692 "lens": "A String", # The lens used to create the photo. 4693 "location": { # Geographic location information stored in the image. 4694 "altitude": 3.14, # The altitude stored in the image. 4695 "latitude": 3.14, # The latitude stored in the image. 4696 "longitude": 3.14, # The longitude stored in the image. 4697 }, 4698 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 4699 "meteringMode": "A String", # The metering mode used to create the photo. 4700 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation. 4701 "sensor": "A String", # The type of sensor used to create the photo. 4702 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 4703 "whiteBalance": "A String", # The white balance mode used to create the photo. 4704 "width": 42, # The width of the image in pixels. 4705 }, 4706 "indexableText": { # Indexable text attributes for the file (can only be written) 4707 "text": "A String", # The text to be indexed for this file. 4708 }, 4709 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 4710 "kind": "drive#file", # The type of file. This is always drive#file. 4711 "labels": { # A group of labels for the file. 4712 "hidden": True or False, # Deprecated. 4713 "modified": True or False, # Whether the file has been modified by this user. 4714 "restricted": True or False, # Deprecated - use copyRequiresWriterPermission instead. 4715 "starred": True or False, # Whether this file is starred by the user. 4716 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 4717 "viewed": True or False, # Whether this file has been viewed by this user. 4718 }, 4719 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file. 4720 "displayName": "A String", # A plain text displayable name for this user. 4721 "emailAddress": "A String", # The email address of the user. 4722 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 4723 "kind": "drive#user", # This is always drive#user. 4724 "permissionId": "A String", # The user's ID as visible in the permissions collection. 4725 "picture": { # The user's profile picture. 4726 "url": "A String", # A URL that points to a profile picture of this user. 4727 }, 4728 }, 4729 "lastModifyingUserName": "A String", # Name of the last user to modify this file. 4730 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp). 4731 "linkShareMetadata": { # Contains details about the link URLs that clients are using to refer to this item. 4732 "securityUpdateEligible": True or False, # Whether the file is eligible for security update. 4733 "securityUpdateEnabled": True or False, # Whether the security update is enabled for this file. 4734 }, 4735 "markedViewedByMeDate": "A String", # Deprecated. 4736 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 4737 "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. 4738 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. 4739 "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. 4740 "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. 4741 "a_key": "A String", 4742 }, 4743 "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 Google Drive. 4744 "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for items in shared drives. 4745 "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for items in shared drives. 4746 "A String", 4747 ], 4748 "owners": [ # The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. 4749 { # Information about a Drive user. 4750 "displayName": "A String", # A plain text displayable name for this user. 4751 "emailAddress": "A String", # The email address of the user. 4752 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 4753 "kind": "drive#user", # This is always drive#user. 4754 "permissionId": "A String", # The user's ID as visible in the permissions collection. 4755 "picture": { # The user's profile picture. 4756 "url": "A String", # A URL that points to a profile picture of this user. 4757 }, 4758 }, 4759 ], 4760 "parents": [ # Collection of parent folders which contain this file. 4761 # If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list. 4762 { # A reference to a file's parent. 4763 "id": "A String", # The ID of the parent. 4764 "isRoot": True or False, # Whether or not the parent is the root folder. 4765 "kind": "drive#parentReference", # This is always drive#parentReference. 4766 "parentLink": "A String", # A link to the parent. 4767 "selfLink": "A String", # A link back to this reference. 4768 }, 4769 ], 4770 "permissionIds": [ # List of permission IDs for users with access to this file. 4771 "A String", 4772 ], 4773 "permissions": [ # The list of permissions for users with access to this file. Not populated for items in shared drives. 4774 { # A permission for a file. 4775 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 4776 "A String", 4777 ], 4778 "authKey": "A String", # Deprecated. 4779 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 4780 "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. 4781 "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. 4782 "etag": "A String", # The ETag of the permission. 4783 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 4784 # - They cannot be set on shared drive items 4785 # - They can only be set on user and group permissions 4786 # - The date must be in the future 4787 # - The date cannot be more than a year in the future 4788 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 4789 "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. 4790 "kind": "drive#permission", # This is always drive#permission. 4791 "name": "A String", # The name for this permission. 4792 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 4793 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 4794 { 4795 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 4796 "A String", 4797 ], 4798 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 4799 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 4800 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 4801 # - file 4802 # - member 4803 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 4804 # - organizer 4805 # - fileOrganizer 4806 # - writer 4807 # - reader 4808 }, 4809 ], 4810 "photoLink": "A String", # A link to the profile photo, if available. 4811 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 4812 # - owner 4813 # - organizer 4814 # - fileOrganizer 4815 # - writer 4816 # - reader 4817 "selfLink": "A String", # A link back to this permission. 4818 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 4819 { 4820 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 4821 "A String", 4822 ], 4823 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 4824 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 4825 "role": "A String", # Deprecated - use permissionDetails/role instead. 4826 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 4827 }, 4828 ], 4829 "type": "A String", # The account type. Allowed values are: 4830 # - user 4831 # - group 4832 # - domain 4833 # - anyone 4834 "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. 4835 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 4836 "withLink": True or False, # Whether the link is required for this permission. 4837 }, 4838 ], 4839 "properties": [ # The list of properties. 4840 { # A key-value pair attached to a file that is either public or private to an application. 4841 # The following limits apply to file properties: 4842 # - Maximum of 100 properties total per file 4843 # - Maximum of 30 private properties per app 4844 # - Maximum of 30 public properties 4845 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. 4846 "etag": "A String", # ETag of the property. 4847 "key": "A String", # The key of this property. 4848 "kind": "drive#property", # This is always drive#property. 4849 "selfLink": "A String", # The link back to this property. 4850 "value": "A String", # The value of this property. 4851 "visibility": "A String", # The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. 4852 }, 4853 ], 4854 "quotaBytesUsed": "A String", # The number of quota bytes used by this file. 4855 "resourceKey": "A String", # A key needed to access the item via a shared link. 4856 "selfLink": "A String", # A link back to this file. 4857 "shareable": True or False, # Deprecated: use capabilities/canShare. 4858 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 4859 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp). 4860 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available. 4861 "displayName": "A String", # A plain text displayable name for this user. 4862 "emailAddress": "A String", # The email address of the user. 4863 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 4864 "kind": "drive#user", # This is always drive#user. 4865 "permissionId": "A String", # The user's ID as visible in the permissions collection. 4866 "picture": { # The user's profile picture. 4867 "url": "A String", # A URL that points to a profile picture of this user. 4868 }, 4869 }, 4870 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. 4871 "targetId": "A String", # The ID of the file that this shortcut points to. 4872 "targetMimeType": "A String", # The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. 4873 "targetResourceKey": "A String", # The ResourceKey for the target file. 4874 }, 4875 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. 4876 "A String", 4877 ], 4878 "teamDriveId": "A String", # Deprecated - use driveId instead. 4879 "thumbnail": { # A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. 4880 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. 4881 "mimeType": "A String", # The MIME type of the thumbnail. 4882 }, 4883 "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. 4884 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 4885 "title": "A String", # The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. 4886 "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. 4887 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. 4888 "displayName": "A String", # A plain text displayable name for this user. 4889 "emailAddress": "A String", # The email address of the user. 4890 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 4891 "kind": "drive#user", # This is always drive#user. 4892 "permissionId": "A String", # The user's ID as visible in the permissions collection. 4893 "picture": { # The user's profile picture. 4894 "url": "A String", # A URL that points to a profile picture of this user. 4895 }, 4896 }, 4897 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file. 4898 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 4899 "A String", 4900 ], 4901 "authKey": "A String", # Deprecated. 4902 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 4903 "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. 4904 "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. 4905 "etag": "A String", # The ETag of the permission. 4906 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 4907 # - They cannot be set on shared drive items 4908 # - They can only be set on user and group permissions 4909 # - The date must be in the future 4910 # - The date cannot be more than a year in the future 4911 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 4912 "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. 4913 "kind": "drive#permission", # This is always drive#permission. 4914 "name": "A String", # The name for this permission. 4915 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 4916 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 4917 { 4918 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 4919 "A String", 4920 ], 4921 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 4922 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 4923 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 4924 # - file 4925 # - member 4926 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 4927 # - organizer 4928 # - fileOrganizer 4929 # - writer 4930 # - reader 4931 }, 4932 ], 4933 "photoLink": "A String", # A link to the profile photo, if available. 4934 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 4935 # - owner 4936 # - organizer 4937 # - fileOrganizer 4938 # - writer 4939 # - reader 4940 "selfLink": "A String", # A link back to this permission. 4941 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 4942 { 4943 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 4944 "A String", 4945 ], 4946 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 4947 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 4948 "role": "A String", # Deprecated - use permissionDetails/role instead. 4949 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 4950 }, 4951 ], 4952 "type": "A String", # The account type. Allowed values are: 4953 # - user 4954 # - group 4955 # - domain 4956 # - anyone 4957 "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. 4958 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 4959 "withLink": True or False, # Whether the link is required for this permission. 4960 }, 4961 "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. 4962 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types. 4963 "durationMillis": "A String", # The duration of the video in milliseconds. 4964 "height": 42, # The height of the video in pixels. 4965 "width": 42, # The width of the video in pixels. 4966 }, 4967 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. 4968 "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. 4969 "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for items in shared drives. 4970} 4971 4972 addParents: string, Comma-separated list of parent IDs to add. 4973 convert: boolean, This parameter is deprecated and has no function. 4974 enforceSingleParent: boolean, Deprecated. Adding files to multiple folders is no longer supported. Use shortcuts instead. 4975 includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. 4976 media_body: string, The filename of the media request body, or an instance of a MediaUpload object. 4977 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object. 4978 modifiedDateBehavior: string, Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate. 4979 Allowed values 4980 fromBody - Set modifiedDate to the value provided in the body of the request. No change if no value was provided. 4981 fromBodyIfNeeded - Set modifiedDate to the value provided in the body of the request depending on other contents of the update. 4982 fromBodyOrNow - Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided. 4983 noChange - Maintain the previous value of modifiedDate. 4984 now - Set modifiedDate to the current time. 4985 nowIfNeeded - Set modifiedDate to the current time depending on contents of the update. 4986 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. Note that this field is ignored if there is no payload in the request. 4987 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. 4988 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes. 4989 pinned: boolean, Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. Note that this field is ignored if there is no payload in the request. 4990 removeParents: string, Comma-separated list of parent IDs to remove. 4991 setModifiedDate: boolean, Whether to set the modified date using the value supplied in the request body. Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow, and false is equivalent to modifiedDateBehavior=now. To prevent any changes to the modified date set modifiedDateBehavior=noChange. 4992 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 4993 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 4994 timedTextLanguage: string, The language of the timed text. 4995 timedTextTrackName: string, The timed text track name. 4996 updateViewedDate: boolean, Whether to update the view date after successfully updating the file. 4997 useContentAsIndexableText: boolean, Whether to use the content as indexable text. 4998 4999Returns: 5000 An object of the form: 5001 5002 { # The metadata for a file. 5003 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer. 5004 "appDataContents": True or False, # Whether this file is in the Application Data folder. 5005 "canComment": True or False, # Deprecated: use capabilities/canComment. 5006 "canReadRevisions": True or False, # Deprecated: use capabilities/canReadRevisions. 5007 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 5008 "canAcceptOwnership": True or False, # Whether the current user is the pending owner of the file. Not populated for shared drive files. 5009 "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. 5010 "canAddFolderFromAnotherDrive": True or False, # Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives. 5011 "canAddMyDriveParent": True or False, # Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files. 5012 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 5013 "canChangeRestrictedDownload": True or False, # Deprecated 5014 "canChangeSecurityUpdateEnabled": True or False, # Whether the current user can change the securityUpdateEnabled field on link share metadata. 5015 "canComment": True or False, # Whether the current user can comment on this file. 5016 "canCopy": True or False, # Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. 5017 "canDelete": True or False, # Whether the current user can delete this file. 5018 "canDeleteChildren": True or False, # Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 5019 "canDownload": True or False, # Whether the current user can download this file. 5020 "canEdit": True or False, # Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see canChangeCopyRequiresWriterPermission or canModifyContent. 5021 "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. 5022 "canModifyContent": True or False, # Whether the current user can modify the content of this file. 5023 "canModifyContentRestriction": True or False, # Whether the current user can modify restrictions on content of this file. 5024 "canMoveChildrenOutOfDrive": True or False, # Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 5025 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 5026 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder. 5027 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 5028 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 5029 "canMoveItemOutOfDrive": True or False, # Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. 5030 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 5031 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed. 5032 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 5033 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 5034 "canReadDrive": True or False, # Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives. 5035 "canReadRevisions": True or False, # Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. 5036 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 5037 "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. For a folder in a shared drive, use canDeleteChildren or canTrashChildren instead. 5038 "canRemoveMyDriveParent": True or False, # Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files. 5039 "canRename": True or False, # Whether the current user can rename this file. 5040 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 5041 "canTrash": True or False, # Whether the current user can move this file to trash. 5042 "canTrashChildren": True or False, # Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives. 5043 "canUntrash": True or False, # Whether the current user can restore this file from trash. 5044 }, 5045 "contentRestrictions": [ # Restrictions for accessing the content of the file. Only populated if such a restriction exists. 5046 { # A restriction for accessing the content of the file. 5047 "readOnly": True or False, # Whether the content of the file is read-only. If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified. 5048 "reason": "A String", # Reason for why the content of the file is restricted. This is only mutable on requests that also set readOnly=true. 5049 "restrictingUser": { # Information about a Drive user. # The user who set the content restriction. Only populated if readOnly is true. 5050 "displayName": "A String", # A plain text displayable name for this user. 5051 "emailAddress": "A String", # The email address of the user. 5052 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 5053 "kind": "drive#user", # This is always drive#user. 5054 "permissionId": "A String", # The user's ID as visible in the permissions collection. 5055 "picture": { # The user's profile picture. 5056 "url": "A String", # A URL that points to a profile picture of this user. 5057 }, 5058 }, 5059 "restrictionDate": "A String", # The time at which the content restriction was set (formatted RFC 3339 timestamp). Only populated if readOnly is true. 5060 "type": "A String", # The type of the content restriction. Currently the only possible value is globalContentRestriction. 5061 }, 5062 ], 5063 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 5064 "copyable": True or False, # Deprecated: use capabilities/canCopy. 5065 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp). 5066 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. 5067 "description": "A String", # A short description of the file. 5068 "downloadUrl": "A String", # Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 5069 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 5070 "editable": True or False, # Deprecated: use capabilities/canEdit. 5071 "embedLink": "A String", # A link for embedding the file. 5072 "etag": "A String", # ETag of the file. 5073 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. 5074 "exportLinks": { # Links for exporting Docs Editors files to specific formats. 5075 "a_key": "A String", # A mapping from export format to URL 5076 }, 5077 "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 Google Drive; it is not populated for Docs Editors or shortcut files. 5078 "fileSize": "A String", # The size of the file in bytes. This field is populated for files with content stored in Google Drive and for files in Docs Editors; it is not populated for shortcut files. 5079 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder or a shortcut to 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. 5080 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 5081 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives. 5082 "hasThumbnail": True or False, # Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. 5083 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 5084 "iconLink": "A String", # A link to the file's icon. 5085 "id": "A String", # The ID of the file. 5086 "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. 5087 "aperture": 3.14, # The aperture used to create the photo (f-number). 5088 "cameraMake": "A String", # The make of the camera used to create the photo. 5089 "cameraModel": "A String", # The model of the camera used to create the photo. 5090 "colorSpace": "A String", # The color space of the photo. 5091 "date": "A String", # The date and time the photo was taken (EXIF format timestamp). 5092 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 5093 "exposureMode": "A String", # The exposure mode used to create the photo. 5094 "exposureTime": 3.14, # The length of the exposure, in seconds. 5095 "flashUsed": True or False, # Whether a flash was used to create the photo. 5096 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 5097 "height": 42, # The height of the image in pixels. 5098 "isoSpeed": 42, # The ISO speed used to create the photo. 5099 "lens": "A String", # The lens used to create the photo. 5100 "location": { # Geographic location information stored in the image. 5101 "altitude": 3.14, # The altitude stored in the image. 5102 "latitude": 3.14, # The latitude stored in the image. 5103 "longitude": 3.14, # The longitude stored in the image. 5104 }, 5105 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 5106 "meteringMode": "A String", # The metering mode used to create the photo. 5107 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation. 5108 "sensor": "A String", # The type of sensor used to create the photo. 5109 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 5110 "whiteBalance": "A String", # The white balance mode used to create the photo. 5111 "width": 42, # The width of the image in pixels. 5112 }, 5113 "indexableText": { # Indexable text attributes for the file (can only be written) 5114 "text": "A String", # The text to be indexed for this file. 5115 }, 5116 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 5117 "kind": "drive#file", # The type of file. This is always drive#file. 5118 "labels": { # A group of labels for the file. 5119 "hidden": True or False, # Deprecated. 5120 "modified": True or False, # Whether the file has been modified by this user. 5121 "restricted": True or False, # Deprecated - use copyRequiresWriterPermission instead. 5122 "starred": True or False, # Whether this file is starred by the user. 5123 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file. 5124 "viewed": True or False, # Whether this file has been viewed by this user. 5125 }, 5126 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file. 5127 "displayName": "A String", # A plain text displayable name for this user. 5128 "emailAddress": "A String", # The email address of the user. 5129 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 5130 "kind": "drive#user", # This is always drive#user. 5131 "permissionId": "A String", # The user's ID as visible in the permissions collection. 5132 "picture": { # The user's profile picture. 5133 "url": "A String", # A URL that points to a profile picture of this user. 5134 }, 5135 }, 5136 "lastModifyingUserName": "A String", # Name of the last user to modify this file. 5137 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp). 5138 "linkShareMetadata": { # Contains details about the link URLs that clients are using to refer to this item. 5139 "securityUpdateEligible": True or False, # Whether the file is eligible for security update. 5140 "securityUpdateEnabled": True or False, # Whether the security update is enabled for this file. 5141 }, 5142 "markedViewedByMeDate": "A String", # Deprecated. 5143 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files. 5144 "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. 5145 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. 5146 "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. 5147 "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. 5148 "a_key": "A String", 5149 }, 5150 "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 Google Drive. 5151 "ownedByMe": True or False, # Whether the file is owned by the current user. Not populated for items in shared drives. 5152 "ownerNames": [ # Name(s) of the owner(s) of this file. Not populated for items in shared drives. 5153 "A String", 5154 ], 5155 "owners": [ # The owner of this file. Only certain legacy files may have more than one owner. This field isn't populated for items in shared drives. 5156 { # Information about a Drive user. 5157 "displayName": "A String", # A plain text displayable name for this user. 5158 "emailAddress": "A String", # The email address of the user. 5159 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 5160 "kind": "drive#user", # This is always drive#user. 5161 "permissionId": "A String", # The user's ID as visible in the permissions collection. 5162 "picture": { # The user's profile picture. 5163 "url": "A String", # A URL that points to a profile picture of this user. 5164 }, 5165 }, 5166 ], 5167 "parents": [ # Collection of parent folders which contain this file. 5168 # If not specified as part of an insert request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests can also use the addParents and removeParents parameters to modify the parents list. 5169 { # A reference to a file's parent. 5170 "id": "A String", # The ID of the parent. 5171 "isRoot": True or False, # Whether or not the parent is the root folder. 5172 "kind": "drive#parentReference", # This is always drive#parentReference. 5173 "parentLink": "A String", # A link to the parent. 5174 "selfLink": "A String", # A link back to this reference. 5175 }, 5176 ], 5177 "permissionIds": [ # List of permission IDs for users with access to this file. 5178 "A String", 5179 ], 5180 "permissions": [ # The list of permissions for users with access to this file. Not populated for items in shared drives. 5181 { # A permission for a file. 5182 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 5183 "A String", 5184 ], 5185 "authKey": "A String", # Deprecated. 5186 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 5187 "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. 5188 "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. 5189 "etag": "A String", # The ETag of the permission. 5190 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 5191 # - They cannot be set on shared drive items 5192 # - They can only be set on user and group permissions 5193 # - The date must be in the future 5194 # - The date cannot be more than a year in the future 5195 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 5196 "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. 5197 "kind": "drive#permission", # This is always drive#permission. 5198 "name": "A String", # The name for this permission. 5199 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 5200 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 5201 { 5202 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 5203 "A String", 5204 ], 5205 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 5206 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 5207 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 5208 # - file 5209 # - member 5210 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 5211 # - organizer 5212 # - fileOrganizer 5213 # - writer 5214 # - reader 5215 }, 5216 ], 5217 "photoLink": "A String", # A link to the profile photo, if available. 5218 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 5219 # - owner 5220 # - organizer 5221 # - fileOrganizer 5222 # - writer 5223 # - reader 5224 "selfLink": "A String", # A link back to this permission. 5225 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 5226 { 5227 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 5228 "A String", 5229 ], 5230 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 5231 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 5232 "role": "A String", # Deprecated - use permissionDetails/role instead. 5233 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 5234 }, 5235 ], 5236 "type": "A String", # The account type. Allowed values are: 5237 # - user 5238 # - group 5239 # - domain 5240 # - anyone 5241 "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. 5242 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 5243 "withLink": True or False, # Whether the link is required for this permission. 5244 }, 5245 ], 5246 "properties": [ # The list of properties. 5247 { # A key-value pair attached to a file that is either public or private to an application. 5248 # The following limits apply to file properties: 5249 # - Maximum of 100 properties total per file 5250 # - Maximum of 30 private properties per app 5251 # - Maximum of 30 public properties 5252 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. 5253 "etag": "A String", # ETag of the property. 5254 "key": "A String", # The key of this property. 5255 "kind": "drive#property", # This is always drive#property. 5256 "selfLink": "A String", # The link back to this property. 5257 "value": "A String", # The value of this property. 5258 "visibility": "A String", # The visibility of this property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only be retrieved using an authenticated request. An authenticated request uses an access token obtained with a OAuth 2 client ID. You cannot use an API key to retrieve private properties. 5259 }, 5260 ], 5261 "quotaBytesUsed": "A String", # The number of quota bytes used by this file. 5262 "resourceKey": "A String", # A key needed to access the item via a shared link. 5263 "selfLink": "A String", # A link back to this file. 5264 "shareable": True or False, # Deprecated: use capabilities/canShare. 5265 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 5266 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp). 5267 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available. 5268 "displayName": "A String", # A plain text displayable name for this user. 5269 "emailAddress": "A String", # The email address of the user. 5270 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 5271 "kind": "drive#user", # This is always drive#user. 5272 "permissionId": "A String", # The user's ID as visible in the permissions collection. 5273 "picture": { # The user's profile picture. 5274 "url": "A String", # A URL that points to a profile picture of this user. 5275 }, 5276 }, 5277 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut. 5278 "targetId": "A String", # The ID of the file that this shortcut points to. 5279 "targetMimeType": "A String", # The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created. 5280 "targetResourceKey": "A String", # The ResourceKey for the target file. 5281 }, 5282 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. 5283 "A String", 5284 ], 5285 "teamDriveId": "A String", # Deprecated - use driveId instead. 5286 "thumbnail": { # A thumbnail for the file. This will only be used if a standard thumbnail cannot be generated. 5287 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. 5288 "mimeType": "A String", # The MIME type of the thumbnail. 5289 }, 5290 "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. If the file isn't shared publicly, the URL returned in Files.thumbnailLink must be fetched using a credentialed request. 5291 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 5292 "title": "A String", # The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant. 5293 "trashedDate": "A String", # The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives. 5294 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for items in shared drives. 5295 "displayName": "A String", # A plain text displayable name for this user. 5296 "emailAddress": "A String", # The email address of the user. 5297 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made. 5298 "kind": "drive#user", # This is always drive#user. 5299 "permissionId": "A String", # The user's ID as visible in the permissions collection. 5300 "picture": { # The user's profile picture. 5301 "url": "A String", # A URL that points to a profile picture of this user. 5302 }, 5303 }, 5304 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file. 5305 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 5306 "A String", 5307 ], 5308 "authKey": "A String", # Deprecated. 5309 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 5310 "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. 5311 "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. 5312 "etag": "A String", # The ETag of the permission. 5313 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 5314 # - They cannot be set on shared drive items 5315 # - They can only be set on user and group permissions 5316 # - The date must be in the future 5317 # - The date cannot be more than a year in the future 5318 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 5319 "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. 5320 "kind": "drive#permission", # This is always drive#permission. 5321 "name": "A String", # The name for this permission. 5322 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 5323 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items. 5324 { 5325 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 5326 "A String", 5327 ], 5328 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 5329 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 5330 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 5331 # - file 5332 # - member 5333 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 5334 # - organizer 5335 # - fileOrganizer 5336 # - writer 5337 # - reader 5338 }, 5339 ], 5340 "photoLink": "A String", # A link to the profile photo, if available. 5341 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 5342 # - owner 5343 # - organizer 5344 # - fileOrganizer 5345 # - writer 5346 # - reader 5347 "selfLink": "A String", # A link back to this permission. 5348 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 5349 { 5350 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 5351 "A String", 5352 ], 5353 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 5354 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 5355 "role": "A String", # Deprecated - use permissionDetails/role instead. 5356 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 5357 }, 5358 ], 5359 "type": "A String", # The account type. Allowed values are: 5360 # - user 5361 # - group 5362 # - domain 5363 # - anyone 5364 "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. 5365 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 5366 "withLink": True or False, # Whether the link is required for this permission. 5367 }, 5368 "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. 5369 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types. 5370 "durationMillis": "A String", # The duration of the video in milliseconds. 5371 "height": 42, # The height of the video in pixels. 5372 "width": 42, # The width of the video in pixels. 5373 }, 5374 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. 5375 "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. 5376 "writersCanShare": True or False, # Whether writers can share the document with other users. Not populated for items in shared drives. 5377}</pre> 5378</div> 5379 5380<div class="method"> 5381 <code class="details" id="watch">watch(fileId, acknowledgeAbuse=None, body=None, includePermissionsForView=None, projection=None, revisionId=None, supportsAllDrives=None, supportsTeamDrives=None, updateViewedDate=None)</code> 5382 <pre>Subscribe to changes on a file 5383 5384Args: 5385 fileId: string, The ID for the file in question. (required) 5386 body: object, The request body. 5387 The object takes the form of: 5388 5389{ # An notification channel used to watch for resource changes. 5390 "address": "A String", # The address where notifications are delivered for this channel. 5391 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. 5392 "id": "A String", # A UUID or similar unique string that identifies this channel. 5393 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource, which is "api#channel". 5394 "params": { # Additional parameters controlling delivery channel behavior. Optional. 5395 "a_key": "A String", # Declares a new parameter by name. 5396 }, 5397 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional. 5398 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. 5399 "resourceUri": "A String", # A version-specific identifier for the watched resource. 5400 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. 5401 "type": "A String", # The type of delivery mechanism used for this channel. Valid values are "web_hook" (or "webhook"). Both values refer to a channel where Http requests are used to deliver messages. 5402} 5403 5404 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. 5405 includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. 5406 projection: string, This parameter is deprecated and has no function. 5407 Allowed values 5408 BASIC - Deprecated 5409 FULL - Deprecated 5410 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. 5411 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 5412 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 5413 updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body. 5414 5415Returns: 5416 An object of the form: 5417 5418 { # An notification channel used to watch for resource changes. 5419 "address": "A String", # The address where notifications are delivered for this channel. 5420 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. 5421 "id": "A String", # A UUID or similar unique string that identifies this channel. 5422 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource, which is "api#channel". 5423 "params": { # Additional parameters controlling delivery channel behavior. Optional. 5424 "a_key": "A String", # Declares a new parameter by name. 5425 }, 5426 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional. 5427 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. 5428 "resourceUri": "A String", # A version-specific identifier for the watched resource. 5429 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. 5430 "type": "A String", # The type of delivery mechanism used for this channel. Valid values are "web_hook" (or "webhook"). Both values refer to a channel where Http requests are used to deliver messages. 5431}</pre> 5432</div> 5433 5434<div class="method"> 5435 <code class="details" id="watch_media">watch_media(fileId, acknowledgeAbuse=None, body=None, includePermissionsForView=None, projection=None, revisionId=None, supportsAllDrives=None, supportsTeamDrives=None, updateViewedDate=None)</code> 5436 <pre>Subscribe to changes on a file 5437 5438Args: 5439 fileId: string, The ID for the file in question. (required) 5440 body: object, The request body. 5441 The object takes the form of: 5442 5443{ # An notification channel used to watch for resource changes. 5444 "address": "A String", # The address where notifications are delivered for this channel. 5445 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. 5446 "id": "A String", # A UUID or similar unique string that identifies this channel. 5447 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource, which is "api#channel". 5448 "params": { # Additional parameters controlling delivery channel behavior. Optional. 5449 "a_key": "A String", # Declares a new parameter by name. 5450 }, 5451 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional. 5452 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. 5453 "resourceUri": "A String", # A version-specific identifier for the watched resource. 5454 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. 5455 "type": "A String", # The type of delivery mechanism used for this channel. Valid values are "web_hook" (or "webhook"). Both values refer to a channel where Http requests are used to deliver messages. 5456} 5457 5458 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. 5459 includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. 5460 projection: string, This parameter is deprecated and has no function. 5461 Allowed values 5462 BASIC - Deprecated 5463 FULL - Deprecated 5464 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. 5465 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 5466 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 5467 updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body. 5468 5469Returns: 5470 The media object as a string. 5471 5472 </pre> 5473</div> 5474 5475</body></html>