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_v3.html">Drive API</a> . <a href="drive_v3.files.html">files</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#copy">copy(fileId, body, keepRevisionForever=None, supportsTeamDrives=None, ocrLanguage=None, ignoreDefaultVisibility=None, supportsAllDrives=None)</a></code></p> 79<p class="firstline">Creates a copy of a file and applies any requested updates with patch semantics.</p> 80<p class="toc_element"> 81 <code><a href="#create">create(body=None, media_body=None, keepRevisionForever=None, useContentAsIndexableText=None, supportsTeamDrives=None, ocrLanguage=None, ignoreDefaultVisibility=None, supportsAllDrives=None, media_mime_type=None)</a></code></p> 82<p class="firstline">Creates a new file.</p> 83<p class="toc_element"> 84 <code><a href="#delete">delete(fileId, supportsTeamDrives=None, supportsAllDrives=None)</a></code></p> 85<p class="firstline">Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted.</p> 86<p class="toc_element"> 87 <code><a href="#emptyTrash">emptyTrash()</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 Doc to the requested MIME type and returns the exported content. Please 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 Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.</p> 95<p class="toc_element"> 96 <code><a href="#generateIds">generateIds(count=None, space=None)</a></code></p> 97<p class="firstline">Generates a set of file IDs which can be provided in create requests.</p> 98<p class="toc_element"> 99 <code><a href="#get">get(fileId, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=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, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=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="#list">list(orderBy=None, pageSize=None, supportsTeamDrives=None, spaces=None, q=None, pageToken=None, corpus=None, teamDriveId=None, includeItemsFromAllDrives=None, includeTeamDriveItems=None, corpora=None, supportsAllDrives=None, driveId=None)</a></code></p> 106<p class="firstline">Lists or searches files.</p> 107<p class="toc_element"> 108 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 109<p class="firstline">Retrieves the next page of results.</p> 110<p class="toc_element"> 111 <code><a href="#update">update(fileId, body=None, keepRevisionForever=None, removeParents=None, supportsTeamDrives=None, media_body=None, ocrLanguage=None, addParents=None, useContentAsIndexableText=None, supportsAllDrives=None, media_mime_type=None)</a></code></p> 112<p class="firstline">Updates a file's metadata and/or content with patch semantics.</p> 113<p class="toc_element"> 114 <code><a href="#watch">watch(fileId, body, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</a></code></p> 115<p class="firstline">Subscribes to changes to a file</p> 116<p class="toc_element"> 117 <code><a href="#watch_media">watch_media(fileId, body, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</a></code></p> 118<p class="firstline">Subscribes to changes to a file</p> 119<h3>Method Details</h3> 120<div class="method"> 121 <code class="details" id="copy">copy(fileId, body, keepRevisionForever=None, supportsTeamDrives=None, ocrLanguage=None, ignoreDefaultVisibility=None, supportsAllDrives=None)</code> 122 <pre>Creates a copy of a file and applies any requested updates with patch semantics. 123 124Args: 125 fileId: string, The ID of the file. (required) 126 body: object, The request body. (required) 127 The object takes the form of: 128 129{ # The metadata for a file. 130 "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. 131 "mimeType": "A String", # The MIME type of the file. 132 # Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. 133 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource. 134 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time). 135 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. 136 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 137 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. 138 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 139 "teamDriveId": "A String", # Deprecated - use driveId instead. 140 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. 141 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives. 142 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time). 143 "id": "A String", # The ID of the file. 144 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable. 145 "me": True or False, # Whether this user is the requesting user. 146 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 147 "displayName": "A String", # A plain text displayable name for this user. 148 "permissionId": "A String", # The user's ID as visible in Permission resources. 149 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 150 "photoLink": "A String", # A link to the user's profile photo, if available. 151 }, 152 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive. 153 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload. 154 "width": 42, # The width of the video in pixels. 155 "durationMillis": "A String", # The duration of the video in milliseconds. 156 "height": 42, # The height of the video in pixels. 157 }, 158 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file. 159 "me": True or False, # Whether this user is the requesting user. 160 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 161 "displayName": "A String", # A plain text displayable name for this user. 162 "permissionId": "A String", # The user's ID as visible in Permission resources. 163 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 164 "photoLink": "A String", # A link to the user's profile photo, if available. 165 }, 166 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource. 167 # If an unsupported color is specified, the closest color in the palette will be used instead. 168 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app. 169 # Entries with null values are cleared in update and copy requests. 170 "a_key": "A String", 171 }, 172 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 173 "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. 174 "canUntrash": True or False, # Whether the current user can restore this file from trash. 175 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 176 "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. 177 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 178 "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. 179 "canRename": True or False, # Whether the current user can rename this file. 180 "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. 181 "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. 182 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 183 "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. 184 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 185 "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. 186 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives. 187 "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. 188 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 189 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 190 "canComment": True or False, # Whether the current user can comment on this file. 191 "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. 192 "canChangeViewersCanCopyContent": True or False, # Deprecated 193 "canTrash": True or False, # Whether the current user can move this file to trash. 194 "canDelete": True or False, # Whether the current user can delete this file. 195 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 196 "canDownload": True or False, # Whether the current user can download this file. 197 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 198 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 199 "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. 200 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 201 "canEdit": True or False, # Whether the current user can edit this file. 202 }, 203 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives. 204 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser. 205 "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 user. 206 "parents": [ # The IDs of the parent folders which contain the file. 207 # If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to modify the parents list. 208 "A String", 209 ], 210 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time). 211 "exportLinks": { # Links for exporting Google Docs to specific formats. 212 "a_key": "A String", # A mapping from export format to URL 213 }, 214 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 215 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 216 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. 217 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension. 218 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Google Drive. 219 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead. 220 "description": "A String", # A short description of the file. 221 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time). 222 # Note that setting modifiedTime will also update modifiedByMeTime for the user. 223 "viewedByMe": True or False, # Whether the file has been viewed by this user. 224 "modifiedByMe": True or False, # Whether the file has been modified by this user. 225 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives. 226 { # Information about a Drive user. 227 "me": True or False, # Whether this user is the requesting user. 228 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 229 "displayName": "A String", # A plain text displayable name for this user. 230 "permissionId": "A String", # The user's ID as visible in Permission resources. 231 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 232 "photoLink": "A String", # A link to the user's profile photo, if available. 233 }, 234 ], 235 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time). 236 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled. 237 "starred": True or False, # Whether the user has starred the file. 238 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps. 239 # Entries with null values are cleared in update and copy requests. 240 "a_key": "A String", 241 }, 242 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive. 243 "iconLink": "A String", # A static, unauthenticated link to the file's icon. 244 "imageMediaMetadata": { # Additional metadata about image media, if available. 245 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 246 "exposureTime": 3.14, # The length of the exposure, in seconds. 247 "cameraMake": "A String", # The make of the camera used to create the photo. 248 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 249 "width": 42, # The width of the image in pixels. 250 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 251 "exposureMode": "A String", # The exposure mode used to create the photo. 252 "colorSpace": "A String", # The color space of the photo. 253 "location": { # Geographic location information stored in the image. 254 "latitude": 3.14, # The latitude stored in the image. 255 "altitude": 3.14, # The altitude stored in the image. 256 "longitude": 3.14, # The longitude stored in the image. 257 }, 258 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 259 "height": 42, # The height of the image in pixels. 260 "lens": "A String", # The lens used to create the photo. 261 "isoSpeed": 42, # The ISO speed used to create the photo. 262 "meteringMode": "A String", # The metering mode used to create the photo. 263 "flashUsed": True or False, # Whether a flash was used to create the photo. 264 "time": "A String", # The date and time the photo was taken (EXIF DateTime). 265 "aperture": 3.14, # The aperture used to create the photo (f-number). 266 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation. 267 "sensor": "A String", # The type of sensor used to create the photo. 268 "whiteBalance": "A String", # The white balance mode used to create the photo. 269 "cameraModel": "A String", # The model of the camera used to create the photo. 270 }, 271 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file". 272 "name": "A String", # The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant. 273 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive. 274 "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. 275 "me": True or False, # Whether this user is the requesting user. 276 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 277 "displayName": "A String", # A plain text displayable name for this user. 278 "permissionId": "A String", # The user's ID as visible in Permission resources. 279 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 280 "photoLink": "A String", # A link to the user's profile photo, if available. 281 }, 282 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 283 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. 284 "A String", 285 ], 286 "permissionIds": [ # List of permission IDs for users with access to this file. 287 "A String", 288 ], 289 "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, and other users cannot see files in the owner's trash. 290 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses. 291 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements. 292 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail. 293 "mimeType": "A String", # The MIME type of the thumbnail. 294 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5). 295 }, 296 }, 297 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive. 298 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for shared drive files. 299 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for items in shared drives. 300 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. 301 "domain": "A String", # The domain to which this permission refers. 302 "displayName": "A String", # A displayable name for users, groups or domains. 303 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 304 { 305 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 306 "role": "A String", # Deprecated - use permissionDetails/role instead. 307 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 308 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 309 }, 310 ], 311 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. 312 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 313 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". 314 "emailAddress": "A String", # The email address of the user or group to which this permission refers. 315 "photoLink": "A String", # A link to the user's profile photo, if available. 316 "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. 317 { 318 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 319 # - organizer 320 # - fileOrganizer 321 # - writer 322 # - commenter 323 # - reader 324 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive. 325 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 326 # - file 327 # - member 328 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 329 }, 330 ], 331 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: 332 # - They can only be set on user and group permissions 333 # - The time must be in the future 334 # - The time cannot be more than a year in the future 335 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed: 336 # - owner 337 # - organizer 338 # - fileOrganizer 339 # - writer 340 # - commenter 341 # - reader 342 "type": "A String", # The type of the grantee. Valid values are: 343 # - user 344 # - group 345 # - domain 346 # - anyone 347 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. 348 }, 349 ], 350 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive. 351} 352 353 keepRevisionForever: boolean, Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. 354 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 355 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code). 356 ignoreDefaultVisibility: boolean, Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. 357 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. 358 359Returns: 360 An object of the form: 361 362 { # The metadata for a file. 363 "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. 364 "mimeType": "A String", # The MIME type of the file. 365 # Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. 366 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource. 367 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time). 368 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. 369 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 370 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. 371 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 372 "teamDriveId": "A String", # Deprecated - use driveId instead. 373 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. 374 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives. 375 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time). 376 "id": "A String", # The ID of the file. 377 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable. 378 "me": True or False, # Whether this user is the requesting user. 379 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 380 "displayName": "A String", # A plain text displayable name for this user. 381 "permissionId": "A String", # The user's ID as visible in Permission resources. 382 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 383 "photoLink": "A String", # A link to the user's profile photo, if available. 384 }, 385 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive. 386 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload. 387 "width": 42, # The width of the video in pixels. 388 "durationMillis": "A String", # The duration of the video in milliseconds. 389 "height": 42, # The height of the video in pixels. 390 }, 391 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file. 392 "me": True or False, # Whether this user is the requesting user. 393 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 394 "displayName": "A String", # A plain text displayable name for this user. 395 "permissionId": "A String", # The user's ID as visible in Permission resources. 396 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 397 "photoLink": "A String", # A link to the user's profile photo, if available. 398 }, 399 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource. 400 # If an unsupported color is specified, the closest color in the palette will be used instead. 401 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app. 402 # Entries with null values are cleared in update and copy requests. 403 "a_key": "A String", 404 }, 405 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 406 "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. 407 "canUntrash": True or False, # Whether the current user can restore this file from trash. 408 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 409 "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. 410 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 411 "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. 412 "canRename": True or False, # Whether the current user can rename this file. 413 "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. 414 "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. 415 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 416 "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. 417 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 418 "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. 419 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives. 420 "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. 421 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 422 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 423 "canComment": True or False, # Whether the current user can comment on this file. 424 "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. 425 "canChangeViewersCanCopyContent": True or False, # Deprecated 426 "canTrash": True or False, # Whether the current user can move this file to trash. 427 "canDelete": True or False, # Whether the current user can delete this file. 428 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 429 "canDownload": True or False, # Whether the current user can download this file. 430 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 431 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 432 "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. 433 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 434 "canEdit": True or False, # Whether the current user can edit this file. 435 }, 436 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives. 437 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser. 438 "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 user. 439 "parents": [ # The IDs of the parent folders which contain the file. 440 # If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to modify the parents list. 441 "A String", 442 ], 443 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time). 444 "exportLinks": { # Links for exporting Google Docs to specific formats. 445 "a_key": "A String", # A mapping from export format to URL 446 }, 447 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 448 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 449 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. 450 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension. 451 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Google Drive. 452 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead. 453 "description": "A String", # A short description of the file. 454 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time). 455 # Note that setting modifiedTime will also update modifiedByMeTime for the user. 456 "viewedByMe": True or False, # Whether the file has been viewed by this user. 457 "modifiedByMe": True or False, # Whether the file has been modified by this user. 458 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives. 459 { # Information about a Drive user. 460 "me": True or False, # Whether this user is the requesting user. 461 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 462 "displayName": "A String", # A plain text displayable name for this user. 463 "permissionId": "A String", # The user's ID as visible in Permission resources. 464 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 465 "photoLink": "A String", # A link to the user's profile photo, if available. 466 }, 467 ], 468 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time). 469 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled. 470 "starred": True or False, # Whether the user has starred the file. 471 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps. 472 # Entries with null values are cleared in update and copy requests. 473 "a_key": "A String", 474 }, 475 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive. 476 "iconLink": "A String", # A static, unauthenticated link to the file's icon. 477 "imageMediaMetadata": { # Additional metadata about image media, if available. 478 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 479 "exposureTime": 3.14, # The length of the exposure, in seconds. 480 "cameraMake": "A String", # The make of the camera used to create the photo. 481 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 482 "width": 42, # The width of the image in pixels. 483 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 484 "exposureMode": "A String", # The exposure mode used to create the photo. 485 "colorSpace": "A String", # The color space of the photo. 486 "location": { # Geographic location information stored in the image. 487 "latitude": 3.14, # The latitude stored in the image. 488 "altitude": 3.14, # The altitude stored in the image. 489 "longitude": 3.14, # The longitude stored in the image. 490 }, 491 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 492 "height": 42, # The height of the image in pixels. 493 "lens": "A String", # The lens used to create the photo. 494 "isoSpeed": 42, # The ISO speed used to create the photo. 495 "meteringMode": "A String", # The metering mode used to create the photo. 496 "flashUsed": True or False, # Whether a flash was used to create the photo. 497 "time": "A String", # The date and time the photo was taken (EXIF DateTime). 498 "aperture": 3.14, # The aperture used to create the photo (f-number). 499 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation. 500 "sensor": "A String", # The type of sensor used to create the photo. 501 "whiteBalance": "A String", # The white balance mode used to create the photo. 502 "cameraModel": "A String", # The model of the camera used to create the photo. 503 }, 504 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file". 505 "name": "A String", # The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant. 506 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive. 507 "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. 508 "me": True or False, # Whether this user is the requesting user. 509 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 510 "displayName": "A String", # A plain text displayable name for this user. 511 "permissionId": "A String", # The user's ID as visible in Permission resources. 512 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 513 "photoLink": "A String", # A link to the user's profile photo, if available. 514 }, 515 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 516 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. 517 "A String", 518 ], 519 "permissionIds": [ # List of permission IDs for users with access to this file. 520 "A String", 521 ], 522 "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, and other users cannot see files in the owner's trash. 523 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses. 524 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements. 525 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail. 526 "mimeType": "A String", # The MIME type of the thumbnail. 527 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5). 528 }, 529 }, 530 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive. 531 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for shared drive files. 532 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for items in shared drives. 533 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. 534 "domain": "A String", # The domain to which this permission refers. 535 "displayName": "A String", # A displayable name for users, groups or domains. 536 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 537 { 538 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 539 "role": "A String", # Deprecated - use permissionDetails/role instead. 540 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 541 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 542 }, 543 ], 544 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. 545 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 546 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". 547 "emailAddress": "A String", # The email address of the user or group to which this permission refers. 548 "photoLink": "A String", # A link to the user's profile photo, if available. 549 "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. 550 { 551 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 552 # - organizer 553 # - fileOrganizer 554 # - writer 555 # - commenter 556 # - reader 557 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive. 558 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 559 # - file 560 # - member 561 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 562 }, 563 ], 564 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: 565 # - They can only be set on user and group permissions 566 # - The time must be in the future 567 # - The time cannot be more than a year in the future 568 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed: 569 # - owner 570 # - organizer 571 # - fileOrganizer 572 # - writer 573 # - commenter 574 # - reader 575 "type": "A String", # The type of the grantee. Valid values are: 576 # - user 577 # - group 578 # - domain 579 # - anyone 580 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. 581 }, 582 ], 583 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive. 584 }</pre> 585</div> 586 587<div class="method"> 588 <code class="details" id="create">create(body=None, media_body=None, keepRevisionForever=None, useContentAsIndexableText=None, supportsTeamDrives=None, ocrLanguage=None, ignoreDefaultVisibility=None, supportsAllDrives=None, media_mime_type=None)</code> 589 <pre>Creates a new file. 590 591Args: 592 body: object, The request body. 593 The object takes the form of: 594 595{ # The metadata for a file. 596 "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. 597 "mimeType": "A String", # The MIME type of the file. 598 # Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. 599 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource. 600 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time). 601 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. 602 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 603 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. 604 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 605 "teamDriveId": "A String", # Deprecated - use driveId instead. 606 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. 607 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives. 608 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time). 609 "id": "A String", # The ID of the file. 610 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable. 611 "me": True or False, # Whether this user is the requesting user. 612 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 613 "displayName": "A String", # A plain text displayable name for this user. 614 "permissionId": "A String", # The user's ID as visible in Permission resources. 615 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 616 "photoLink": "A String", # A link to the user's profile photo, if available. 617 }, 618 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive. 619 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload. 620 "width": 42, # The width of the video in pixels. 621 "durationMillis": "A String", # The duration of the video in milliseconds. 622 "height": 42, # The height of the video in pixels. 623 }, 624 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file. 625 "me": True or False, # Whether this user is the requesting user. 626 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 627 "displayName": "A String", # A plain text displayable name for this user. 628 "permissionId": "A String", # The user's ID as visible in Permission resources. 629 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 630 "photoLink": "A String", # A link to the user's profile photo, if available. 631 }, 632 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource. 633 # If an unsupported color is specified, the closest color in the palette will be used instead. 634 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app. 635 # Entries with null values are cleared in update and copy requests. 636 "a_key": "A String", 637 }, 638 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 639 "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. 640 "canUntrash": True or False, # Whether the current user can restore this file from trash. 641 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 642 "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. 643 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 644 "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. 645 "canRename": True or False, # Whether the current user can rename this file. 646 "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. 647 "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. 648 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 649 "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. 650 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 651 "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. 652 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives. 653 "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. 654 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 655 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 656 "canComment": True or False, # Whether the current user can comment on this file. 657 "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. 658 "canChangeViewersCanCopyContent": True or False, # Deprecated 659 "canTrash": True or False, # Whether the current user can move this file to trash. 660 "canDelete": True or False, # Whether the current user can delete this file. 661 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 662 "canDownload": True or False, # Whether the current user can download this file. 663 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 664 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 665 "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. 666 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 667 "canEdit": True or False, # Whether the current user can edit this file. 668 }, 669 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives. 670 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser. 671 "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 user. 672 "parents": [ # The IDs of the parent folders which contain the file. 673 # If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to modify the parents list. 674 "A String", 675 ], 676 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time). 677 "exportLinks": { # Links for exporting Google Docs to specific formats. 678 "a_key": "A String", # A mapping from export format to URL 679 }, 680 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 681 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 682 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. 683 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension. 684 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Google Drive. 685 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead. 686 "description": "A String", # A short description of the file. 687 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time). 688 # Note that setting modifiedTime will also update modifiedByMeTime for the user. 689 "viewedByMe": True or False, # Whether the file has been viewed by this user. 690 "modifiedByMe": True or False, # Whether the file has been modified by this user. 691 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives. 692 { # Information about a Drive user. 693 "me": True or False, # Whether this user is the requesting user. 694 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 695 "displayName": "A String", # A plain text displayable name for this user. 696 "permissionId": "A String", # The user's ID as visible in Permission resources. 697 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 698 "photoLink": "A String", # A link to the user's profile photo, if available. 699 }, 700 ], 701 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time). 702 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled. 703 "starred": True or False, # Whether the user has starred the file. 704 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps. 705 # Entries with null values are cleared in update and copy requests. 706 "a_key": "A String", 707 }, 708 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive. 709 "iconLink": "A String", # A static, unauthenticated link to the file's icon. 710 "imageMediaMetadata": { # Additional metadata about image media, if available. 711 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 712 "exposureTime": 3.14, # The length of the exposure, in seconds. 713 "cameraMake": "A String", # The make of the camera used to create the photo. 714 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 715 "width": 42, # The width of the image in pixels. 716 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 717 "exposureMode": "A String", # The exposure mode used to create the photo. 718 "colorSpace": "A String", # The color space of the photo. 719 "location": { # Geographic location information stored in the image. 720 "latitude": 3.14, # The latitude stored in the image. 721 "altitude": 3.14, # The altitude stored in the image. 722 "longitude": 3.14, # The longitude stored in the image. 723 }, 724 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 725 "height": 42, # The height of the image in pixels. 726 "lens": "A String", # The lens used to create the photo. 727 "isoSpeed": 42, # The ISO speed used to create the photo. 728 "meteringMode": "A String", # The metering mode used to create the photo. 729 "flashUsed": True or False, # Whether a flash was used to create the photo. 730 "time": "A String", # The date and time the photo was taken (EXIF DateTime). 731 "aperture": 3.14, # The aperture used to create the photo (f-number). 732 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation. 733 "sensor": "A String", # The type of sensor used to create the photo. 734 "whiteBalance": "A String", # The white balance mode used to create the photo. 735 "cameraModel": "A String", # The model of the camera used to create the photo. 736 }, 737 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file". 738 "name": "A String", # The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant. 739 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive. 740 "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. 741 "me": True or False, # Whether this user is the requesting user. 742 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 743 "displayName": "A String", # A plain text displayable name for this user. 744 "permissionId": "A String", # The user's ID as visible in Permission resources. 745 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 746 "photoLink": "A String", # A link to the user's profile photo, if available. 747 }, 748 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 749 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. 750 "A String", 751 ], 752 "permissionIds": [ # List of permission IDs for users with access to this file. 753 "A String", 754 ], 755 "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, and other users cannot see files in the owner's trash. 756 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses. 757 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements. 758 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail. 759 "mimeType": "A String", # The MIME type of the thumbnail. 760 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5). 761 }, 762 }, 763 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive. 764 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for shared drive files. 765 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for items in shared drives. 766 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. 767 "domain": "A String", # The domain to which this permission refers. 768 "displayName": "A String", # A displayable name for users, groups or domains. 769 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 770 { 771 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 772 "role": "A String", # Deprecated - use permissionDetails/role instead. 773 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 774 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 775 }, 776 ], 777 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. 778 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 779 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". 780 "emailAddress": "A String", # The email address of the user or group to which this permission refers. 781 "photoLink": "A String", # A link to the user's profile photo, if available. 782 "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. 783 { 784 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 785 # - organizer 786 # - fileOrganizer 787 # - writer 788 # - commenter 789 # - reader 790 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive. 791 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 792 # - file 793 # - member 794 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 795 }, 796 ], 797 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: 798 # - They can only be set on user and group permissions 799 # - The time must be in the future 800 # - The time cannot be more than a year in the future 801 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed: 802 # - owner 803 # - organizer 804 # - fileOrganizer 805 # - writer 806 # - commenter 807 # - reader 808 "type": "A String", # The type of the grantee. Valid values are: 809 # - user 810 # - group 811 # - domain 812 # - anyone 813 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. 814 }, 815 ], 816 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive. 817} 818 819 media_body: string, The filename of the media request body, or an instance of a MediaUpload object. 820 keepRevisionForever: boolean, Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. 821 useContentAsIndexableText: boolean, Whether to use the uploaded content as indexable text. 822 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 823 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code). 824 ignoreDefaultVisibility: boolean, Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. 825 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. 826 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object. 827 828Returns: 829 An object of the form: 830 831 { # The metadata for a file. 832 "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. 833 "mimeType": "A String", # The MIME type of the file. 834 # Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. 835 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource. 836 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time). 837 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. 838 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 839 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. 840 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 841 "teamDriveId": "A String", # Deprecated - use driveId instead. 842 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. 843 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives. 844 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time). 845 "id": "A String", # The ID of the file. 846 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable. 847 "me": True or False, # Whether this user is the requesting user. 848 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 849 "displayName": "A String", # A plain text displayable name for this user. 850 "permissionId": "A String", # The user's ID as visible in Permission resources. 851 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 852 "photoLink": "A String", # A link to the user's profile photo, if available. 853 }, 854 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive. 855 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload. 856 "width": 42, # The width of the video in pixels. 857 "durationMillis": "A String", # The duration of the video in milliseconds. 858 "height": 42, # The height of the video in pixels. 859 }, 860 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file. 861 "me": True or False, # Whether this user is the requesting user. 862 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 863 "displayName": "A String", # A plain text displayable name for this user. 864 "permissionId": "A String", # The user's ID as visible in Permission resources. 865 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 866 "photoLink": "A String", # A link to the user's profile photo, if available. 867 }, 868 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource. 869 # If an unsupported color is specified, the closest color in the palette will be used instead. 870 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app. 871 # Entries with null values are cleared in update and copy requests. 872 "a_key": "A String", 873 }, 874 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 875 "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. 876 "canUntrash": True or False, # Whether the current user can restore this file from trash. 877 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 878 "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. 879 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 880 "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. 881 "canRename": True or False, # Whether the current user can rename this file. 882 "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. 883 "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. 884 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 885 "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. 886 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 887 "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. 888 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives. 889 "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. 890 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 891 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 892 "canComment": True or False, # Whether the current user can comment on this file. 893 "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. 894 "canChangeViewersCanCopyContent": True or False, # Deprecated 895 "canTrash": True or False, # Whether the current user can move this file to trash. 896 "canDelete": True or False, # Whether the current user can delete this file. 897 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 898 "canDownload": True or False, # Whether the current user can download this file. 899 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 900 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 901 "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. 902 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 903 "canEdit": True or False, # Whether the current user can edit this file. 904 }, 905 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives. 906 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser. 907 "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 user. 908 "parents": [ # The IDs of the parent folders which contain the file. 909 # If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to modify the parents list. 910 "A String", 911 ], 912 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time). 913 "exportLinks": { # Links for exporting Google Docs to specific formats. 914 "a_key": "A String", # A mapping from export format to URL 915 }, 916 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 917 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 918 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. 919 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension. 920 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Google Drive. 921 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead. 922 "description": "A String", # A short description of the file. 923 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time). 924 # Note that setting modifiedTime will also update modifiedByMeTime for the user. 925 "viewedByMe": True or False, # Whether the file has been viewed by this user. 926 "modifiedByMe": True or False, # Whether the file has been modified by this user. 927 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives. 928 { # Information about a Drive user. 929 "me": True or False, # Whether this user is the requesting user. 930 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 931 "displayName": "A String", # A plain text displayable name for this user. 932 "permissionId": "A String", # The user's ID as visible in Permission resources. 933 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 934 "photoLink": "A String", # A link to the user's profile photo, if available. 935 }, 936 ], 937 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time). 938 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled. 939 "starred": True or False, # Whether the user has starred the file. 940 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps. 941 # Entries with null values are cleared in update and copy requests. 942 "a_key": "A String", 943 }, 944 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive. 945 "iconLink": "A String", # A static, unauthenticated link to the file's icon. 946 "imageMediaMetadata": { # Additional metadata about image media, if available. 947 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 948 "exposureTime": 3.14, # The length of the exposure, in seconds. 949 "cameraMake": "A String", # The make of the camera used to create the photo. 950 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 951 "width": 42, # The width of the image in pixels. 952 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 953 "exposureMode": "A String", # The exposure mode used to create the photo. 954 "colorSpace": "A String", # The color space of the photo. 955 "location": { # Geographic location information stored in the image. 956 "latitude": 3.14, # The latitude stored in the image. 957 "altitude": 3.14, # The altitude stored in the image. 958 "longitude": 3.14, # The longitude stored in the image. 959 }, 960 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 961 "height": 42, # The height of the image in pixels. 962 "lens": "A String", # The lens used to create the photo. 963 "isoSpeed": 42, # The ISO speed used to create the photo. 964 "meteringMode": "A String", # The metering mode used to create the photo. 965 "flashUsed": True or False, # Whether a flash was used to create the photo. 966 "time": "A String", # The date and time the photo was taken (EXIF DateTime). 967 "aperture": 3.14, # The aperture used to create the photo (f-number). 968 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation. 969 "sensor": "A String", # The type of sensor used to create the photo. 970 "whiteBalance": "A String", # The white balance mode used to create the photo. 971 "cameraModel": "A String", # The model of the camera used to create the photo. 972 }, 973 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file". 974 "name": "A String", # The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant. 975 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive. 976 "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. 977 "me": True or False, # Whether this user is the requesting user. 978 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 979 "displayName": "A String", # A plain text displayable name for this user. 980 "permissionId": "A String", # The user's ID as visible in Permission resources. 981 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 982 "photoLink": "A String", # A link to the user's profile photo, if available. 983 }, 984 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 985 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. 986 "A String", 987 ], 988 "permissionIds": [ # List of permission IDs for users with access to this file. 989 "A String", 990 ], 991 "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, and other users cannot see files in the owner's trash. 992 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses. 993 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements. 994 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail. 995 "mimeType": "A String", # The MIME type of the thumbnail. 996 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5). 997 }, 998 }, 999 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive. 1000 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for shared drive files. 1001 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for items in shared drives. 1002 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. 1003 "domain": "A String", # The domain to which this permission refers. 1004 "displayName": "A String", # A displayable name for users, groups or domains. 1005 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 1006 { 1007 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 1008 "role": "A String", # Deprecated - use permissionDetails/role instead. 1009 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 1010 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 1011 }, 1012 ], 1013 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. 1014 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 1015 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". 1016 "emailAddress": "A String", # The email address of the user or group to which this permission refers. 1017 "photoLink": "A String", # A link to the user's profile photo, if available. 1018 "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. 1019 { 1020 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 1021 # - organizer 1022 # - fileOrganizer 1023 # - writer 1024 # - commenter 1025 # - reader 1026 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive. 1027 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 1028 # - file 1029 # - member 1030 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 1031 }, 1032 ], 1033 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: 1034 # - They can only be set on user and group permissions 1035 # - The time must be in the future 1036 # - The time cannot be more than a year in the future 1037 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed: 1038 # - owner 1039 # - organizer 1040 # - fileOrganizer 1041 # - writer 1042 # - commenter 1043 # - reader 1044 "type": "A String", # The type of the grantee. Valid values are: 1045 # - user 1046 # - group 1047 # - domain 1048 # - anyone 1049 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. 1050 }, 1051 ], 1052 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive. 1053 }</pre> 1054</div> 1055 1056<div class="method"> 1057 <code class="details" id="delete">delete(fileId, supportsTeamDrives=None, supportsAllDrives=None)</code> 1058 <pre>Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted. 1059 1060Args: 1061 fileId: string, The ID of the file. (required) 1062 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 1063 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. 1064</pre> 1065</div> 1066 1067<div class="method"> 1068 <code class="details" id="emptyTrash">emptyTrash()</code> 1069 <pre>Permanently deletes all of the user's trashed files. 1070 1071Args: 1072</pre> 1073</div> 1074 1075<div class="method"> 1076 <code class="details" id="export">export(fileId, mimeType)</code> 1077 <pre>Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. 1078 1079Args: 1080 fileId: string, The ID of the file. (required) 1081 mimeType: string, The MIME type of the format requested for this export. (required) 1082</pre> 1083</div> 1084 1085<div class="method"> 1086 <code class="details" id="export_media">export_media(fileId, mimeType)</code> 1087 <pre>Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB. 1088 1089Args: 1090 fileId: string, The ID of the file. (required) 1091 mimeType: string, The MIME type of the format requested for this export. (required) 1092</pre> 1093</div> 1094 1095<div class="method"> 1096 <code class="details" id="generateIds">generateIds(count=None, space=None)</code> 1097 <pre>Generates a set of file IDs which can be provided in create requests. 1098 1099Args: 1100 count: integer, The number of IDs to return. 1101 space: string, The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. 1102 1103Returns: 1104 An object of the form: 1105 1106 { # A list of generated file IDs which can be provided in create requests. 1107 "kind": "drive#generatedIds", # Identifies what kind of resource this is. Value: the fixed string "drive#generatedIds". 1108 "ids": [ # The IDs generated for the requesting user in the specified space. 1109 "A String", 1110 ], 1111 "space": "A String", # The type of file that can be created with these IDs. 1112 }</pre> 1113</div> 1114 1115<div class="method"> 1116 <code class="details" id="get">get(fileId, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</code> 1117 <pre>Gets a file's metadata or content by ID. 1118 1119Args: 1120 fileId: string, The ID of the file. (required) 1121 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 1122 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. 1123 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. 1124 1125Returns: 1126 An object of the form: 1127 1128 { # The metadata for a file. 1129 "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. 1130 "mimeType": "A String", # The MIME type of the file. 1131 # Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. 1132 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource. 1133 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time). 1134 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. 1135 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 1136 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. 1137 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 1138 "teamDriveId": "A String", # Deprecated - use driveId instead. 1139 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. 1140 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives. 1141 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time). 1142 "id": "A String", # The ID of the file. 1143 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable. 1144 "me": True or False, # Whether this user is the requesting user. 1145 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1146 "displayName": "A String", # A plain text displayable name for this user. 1147 "permissionId": "A String", # The user's ID as visible in Permission resources. 1148 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1149 "photoLink": "A String", # A link to the user's profile photo, if available. 1150 }, 1151 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive. 1152 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload. 1153 "width": 42, # The width of the video in pixels. 1154 "durationMillis": "A String", # The duration of the video in milliseconds. 1155 "height": 42, # The height of the video in pixels. 1156 }, 1157 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file. 1158 "me": True or False, # Whether this user is the requesting user. 1159 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1160 "displayName": "A String", # A plain text displayable name for this user. 1161 "permissionId": "A String", # The user's ID as visible in Permission resources. 1162 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1163 "photoLink": "A String", # A link to the user's profile photo, if available. 1164 }, 1165 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource. 1166 # If an unsupported color is specified, the closest color in the palette will be used instead. 1167 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app. 1168 # Entries with null values are cleared in update and copy requests. 1169 "a_key": "A String", 1170 }, 1171 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 1172 "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. 1173 "canUntrash": True or False, # Whether the current user can restore this file from trash. 1174 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 1175 "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. 1176 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 1177 "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. 1178 "canRename": True or False, # Whether the current user can rename this file. 1179 "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. 1180 "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. 1181 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 1182 "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. 1183 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 1184 "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. 1185 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives. 1186 "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. 1187 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1188 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1189 "canComment": True or False, # Whether the current user can comment on this file. 1190 "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. 1191 "canChangeViewersCanCopyContent": True or False, # Deprecated 1192 "canTrash": True or False, # Whether the current user can move this file to trash. 1193 "canDelete": True or False, # Whether the current user can delete this file. 1194 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 1195 "canDownload": True or False, # Whether the current user can download this file. 1196 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 1197 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 1198 "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. 1199 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 1200 "canEdit": True or False, # Whether the current user can edit this file. 1201 }, 1202 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives. 1203 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser. 1204 "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 user. 1205 "parents": [ # The IDs of the parent folders which contain the file. 1206 # If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to modify the parents list. 1207 "A String", 1208 ], 1209 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time). 1210 "exportLinks": { # Links for exporting Google Docs to specific formats. 1211 "a_key": "A String", # A mapping from export format to URL 1212 }, 1213 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 1214 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 1215 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. 1216 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension. 1217 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Google Drive. 1218 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead. 1219 "description": "A String", # A short description of the file. 1220 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time). 1221 # Note that setting modifiedTime will also update modifiedByMeTime for the user. 1222 "viewedByMe": True or False, # Whether the file has been viewed by this user. 1223 "modifiedByMe": True or False, # Whether the file has been modified by this user. 1224 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives. 1225 { # Information about a Drive user. 1226 "me": True or False, # Whether this user is the requesting user. 1227 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1228 "displayName": "A String", # A plain text displayable name for this user. 1229 "permissionId": "A String", # The user's ID as visible in Permission resources. 1230 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1231 "photoLink": "A String", # A link to the user's profile photo, if available. 1232 }, 1233 ], 1234 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time). 1235 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled. 1236 "starred": True or False, # Whether the user has starred the file. 1237 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps. 1238 # Entries with null values are cleared in update and copy requests. 1239 "a_key": "A String", 1240 }, 1241 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive. 1242 "iconLink": "A String", # A static, unauthenticated link to the file's icon. 1243 "imageMediaMetadata": { # Additional metadata about image media, if available. 1244 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 1245 "exposureTime": 3.14, # The length of the exposure, in seconds. 1246 "cameraMake": "A String", # The make of the camera used to create the photo. 1247 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 1248 "width": 42, # The width of the image in pixels. 1249 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 1250 "exposureMode": "A String", # The exposure mode used to create the photo. 1251 "colorSpace": "A String", # The color space of the photo. 1252 "location": { # Geographic location information stored in the image. 1253 "latitude": 3.14, # The latitude stored in the image. 1254 "altitude": 3.14, # The altitude stored in the image. 1255 "longitude": 3.14, # The longitude stored in the image. 1256 }, 1257 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 1258 "height": 42, # The height of the image in pixels. 1259 "lens": "A String", # The lens used to create the photo. 1260 "isoSpeed": 42, # The ISO speed used to create the photo. 1261 "meteringMode": "A String", # The metering mode used to create the photo. 1262 "flashUsed": True or False, # Whether a flash was used to create the photo. 1263 "time": "A String", # The date and time the photo was taken (EXIF DateTime). 1264 "aperture": 3.14, # The aperture used to create the photo (f-number). 1265 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation. 1266 "sensor": "A String", # The type of sensor used to create the photo. 1267 "whiteBalance": "A String", # The white balance mode used to create the photo. 1268 "cameraModel": "A String", # The model of the camera used to create the photo. 1269 }, 1270 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file". 1271 "name": "A String", # The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant. 1272 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive. 1273 "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. 1274 "me": True or False, # Whether this user is the requesting user. 1275 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1276 "displayName": "A String", # A plain text displayable name for this user. 1277 "permissionId": "A String", # The user's ID as visible in Permission resources. 1278 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1279 "photoLink": "A String", # A link to the user's profile photo, if available. 1280 }, 1281 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 1282 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. 1283 "A String", 1284 ], 1285 "permissionIds": [ # List of permission IDs for users with access to this file. 1286 "A String", 1287 ], 1288 "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, and other users cannot see files in the owner's trash. 1289 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses. 1290 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements. 1291 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail. 1292 "mimeType": "A String", # The MIME type of the thumbnail. 1293 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5). 1294 }, 1295 }, 1296 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive. 1297 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for shared drive files. 1298 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for items in shared drives. 1299 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. 1300 "domain": "A String", # The domain to which this permission refers. 1301 "displayName": "A String", # A displayable name for users, groups or domains. 1302 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 1303 { 1304 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 1305 "role": "A String", # Deprecated - use permissionDetails/role instead. 1306 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 1307 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 1308 }, 1309 ], 1310 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. 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 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". 1313 "emailAddress": "A String", # The email address of the user or group to which this permission refers. 1314 "photoLink": "A String", # A link to the user's profile photo, if available. 1315 "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. 1316 { 1317 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 1318 # - organizer 1319 # - fileOrganizer 1320 # - writer 1321 # - commenter 1322 # - reader 1323 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive. 1324 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 1325 # - file 1326 # - member 1327 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 1328 }, 1329 ], 1330 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: 1331 # - They can only be set on user and group permissions 1332 # - The time must be in the future 1333 # - The time cannot be more than a year in the future 1334 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed: 1335 # - owner 1336 # - organizer 1337 # - fileOrganizer 1338 # - writer 1339 # - commenter 1340 # - reader 1341 "type": "A String", # The type of the grantee. Valid values are: 1342 # - user 1343 # - group 1344 # - domain 1345 # - anyone 1346 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. 1347 }, 1348 ], 1349 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive. 1350 }</pre> 1351</div> 1352 1353<div class="method"> 1354 <code class="details" id="get_media">get_media(fileId, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</code> 1355 <pre>Gets a file's metadata or content by ID. 1356 1357Args: 1358 fileId: string, The ID of the file. (required) 1359 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 1360 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. 1361 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. 1362 1363Returns: 1364 The media object as a string. 1365 1366 </pre> 1367</div> 1368 1369<div class="method"> 1370 <code class="details" id="list">list(orderBy=None, pageSize=None, supportsTeamDrives=None, spaces=None, q=None, pageToken=None, corpus=None, teamDriveId=None, includeItemsFromAllDrives=None, includeTeamDriveItems=None, corpora=None, supportsAllDrives=None, driveId=None)</code> 1371 <pre>Lists or searches files. 1372 1373Args: 1374 orderBy: string, A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. 1375 pageSize: 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. 1376 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 1377 spaces: string, A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. 1378 q: string, A query for filtering the file results. See the "Search for Files" guide for supported syntax. 1379 pageToken: string, The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. 1380 corpus: string, The source of files to list. Deprecated: use 'corpora' instead. 1381 Allowed values 1382 domain - Files shared to the user's domain. 1383 user - Files owned by or shared to the user. 1384 teamDriveId: string, Deprecated use driveId instead. 1385 includeItemsFromAllDrives: boolean, Deprecated - Whether both My Drive and shared drive items should be included in results. This parameter will only be effective until June 1, 2020. Afterwards shared drive items will be included in the results. 1386 includeTeamDriveItems: boolean, Deprecated use includeItemsFromAllDrives instead. 1387 corpora: string, Bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'drive' and 'allDrives'. Prefer 'user' or 'drive' to 'allDrives' for efficiency. 1388 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. 1389 driveId: string, ID of the shared drive to search. 1390 1391Returns: 1392 An object of the form: 1393 1394 { # A list of files. 1395 "files": [ # The list of files. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. 1396 { # The metadata for a file. 1397 "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. 1398 "mimeType": "A String", # The MIME type of the file. 1399 # Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. 1400 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource. 1401 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time). 1402 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. 1403 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 1404 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. 1405 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 1406 "teamDriveId": "A String", # Deprecated - use driveId instead. 1407 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. 1408 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives. 1409 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time). 1410 "id": "A String", # The ID of the file. 1411 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable. 1412 "me": True or False, # Whether this user is the requesting user. 1413 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1414 "displayName": "A String", # A plain text displayable name for this user. 1415 "permissionId": "A String", # The user's ID as visible in Permission resources. 1416 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1417 "photoLink": "A String", # A link to the user's profile photo, if available. 1418 }, 1419 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive. 1420 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload. 1421 "width": 42, # The width of the video in pixels. 1422 "durationMillis": "A String", # The duration of the video in milliseconds. 1423 "height": 42, # The height of the video in pixels. 1424 }, 1425 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file. 1426 "me": True or False, # Whether this user is the requesting user. 1427 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1428 "displayName": "A String", # A plain text displayable name for this user. 1429 "permissionId": "A String", # The user's ID as visible in Permission resources. 1430 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1431 "photoLink": "A String", # A link to the user's profile photo, if available. 1432 }, 1433 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource. 1434 # If an unsupported color is specified, the closest color in the palette will be used instead. 1435 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app. 1436 # Entries with null values are cleared in update and copy requests. 1437 "a_key": "A String", 1438 }, 1439 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 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 "canUntrash": True or False, # Whether the current user can restore this file from trash. 1442 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 1443 "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. 1444 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 1445 "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. 1446 "canRename": True or False, # Whether the current user can rename this file. 1447 "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. 1448 "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. 1449 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 1450 "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. 1451 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 1452 "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. 1453 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives. 1454 "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. 1455 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1456 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1457 "canComment": True or False, # Whether the current user can comment on this file. 1458 "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. 1459 "canChangeViewersCanCopyContent": True or False, # Deprecated 1460 "canTrash": True or False, # Whether the current user can move this file to trash. 1461 "canDelete": True or False, # Whether the current user can delete this file. 1462 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 1463 "canDownload": True or False, # Whether the current user can download this file. 1464 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 1465 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 1466 "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. 1467 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 1468 "canEdit": True or False, # Whether the current user can edit this file. 1469 }, 1470 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives. 1471 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser. 1472 "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 user. 1473 "parents": [ # The IDs of the parent folders which contain the file. 1474 # If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to modify the parents list. 1475 "A String", 1476 ], 1477 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time). 1478 "exportLinks": { # Links for exporting Google Docs to specific formats. 1479 "a_key": "A String", # A mapping from export format to URL 1480 }, 1481 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 1482 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 1483 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. 1484 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension. 1485 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Google Drive. 1486 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead. 1487 "description": "A String", # A short description of the file. 1488 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time). 1489 # Note that setting modifiedTime will also update modifiedByMeTime for the user. 1490 "viewedByMe": True or False, # Whether the file has been viewed by this user. 1491 "modifiedByMe": True or False, # Whether the file has been modified by this user. 1492 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives. 1493 { # Information about a Drive user. 1494 "me": True or False, # Whether this user is the requesting user. 1495 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1496 "displayName": "A String", # A plain text displayable name for this user. 1497 "permissionId": "A String", # The user's ID as visible in Permission resources. 1498 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1499 "photoLink": "A String", # A link to the user's profile photo, if available. 1500 }, 1501 ], 1502 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time). 1503 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled. 1504 "starred": True or False, # Whether the user has starred the file. 1505 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps. 1506 # Entries with null values are cleared in update and copy requests. 1507 "a_key": "A String", 1508 }, 1509 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive. 1510 "iconLink": "A String", # A static, unauthenticated link to the file's icon. 1511 "imageMediaMetadata": { # Additional metadata about image media, if available. 1512 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 1513 "exposureTime": 3.14, # The length of the exposure, in seconds. 1514 "cameraMake": "A String", # The make of the camera used to create the photo. 1515 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 1516 "width": 42, # The width of the image in pixels. 1517 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 1518 "exposureMode": "A String", # The exposure mode used to create the photo. 1519 "colorSpace": "A String", # The color space of the photo. 1520 "location": { # Geographic location information stored in the image. 1521 "latitude": 3.14, # The latitude stored in the image. 1522 "altitude": 3.14, # The altitude stored in the image. 1523 "longitude": 3.14, # The longitude stored in the image. 1524 }, 1525 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 1526 "height": 42, # The height of the image in pixels. 1527 "lens": "A String", # The lens used to create the photo. 1528 "isoSpeed": 42, # The ISO speed used to create the photo. 1529 "meteringMode": "A String", # The metering mode used to create the photo. 1530 "flashUsed": True or False, # Whether a flash was used to create the photo. 1531 "time": "A String", # The date and time the photo was taken (EXIF DateTime). 1532 "aperture": 3.14, # The aperture used to create the photo (f-number). 1533 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation. 1534 "sensor": "A String", # The type of sensor used to create the photo. 1535 "whiteBalance": "A String", # The white balance mode used to create the photo. 1536 "cameraModel": "A String", # The model of the camera used to create the photo. 1537 }, 1538 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file". 1539 "name": "A String", # The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant. 1540 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive. 1541 "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. 1542 "me": True or False, # Whether this user is the requesting user. 1543 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1544 "displayName": "A String", # A plain text displayable name for this user. 1545 "permissionId": "A String", # The user's ID as visible in Permission resources. 1546 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1547 "photoLink": "A String", # A link to the user's profile photo, if available. 1548 }, 1549 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 1550 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. 1551 "A String", 1552 ], 1553 "permissionIds": [ # List of permission IDs for users with access to this file. 1554 "A String", 1555 ], 1556 "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, and other users cannot see files in the owner's trash. 1557 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses. 1558 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements. 1559 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail. 1560 "mimeType": "A String", # The MIME type of the thumbnail. 1561 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5). 1562 }, 1563 }, 1564 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive. 1565 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for shared drive files. 1566 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for items in shared drives. 1567 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. 1568 "domain": "A String", # The domain to which this permission refers. 1569 "displayName": "A String", # A displayable name for users, groups or domains. 1570 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 1571 { 1572 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 1573 "role": "A String", # Deprecated - use permissionDetails/role instead. 1574 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 1575 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 1576 }, 1577 ], 1578 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. 1579 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 1580 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". 1581 "emailAddress": "A String", # The email address of the user or group to which this permission refers. 1582 "photoLink": "A String", # A link to the user's profile photo, if available. 1583 "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. 1584 { 1585 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 1586 # - organizer 1587 # - fileOrganizer 1588 # - writer 1589 # - commenter 1590 # - reader 1591 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive. 1592 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 1593 # - file 1594 # - member 1595 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 1596 }, 1597 ], 1598 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: 1599 # - They can only be set on user and group permissions 1600 # - The time must be in the future 1601 # - The time cannot be more than a year in the future 1602 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed: 1603 # - owner 1604 # - organizer 1605 # - fileOrganizer 1606 # - writer 1607 # - commenter 1608 # - reader 1609 "type": "A String", # The type of the grantee. Valid values are: 1610 # - user 1611 # - group 1612 # - domain 1613 # - anyone 1614 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. 1615 }, 1616 ], 1617 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive. 1618 }, 1619 ], 1620 "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 "user" or "drive". 1621 "kind": "drive#fileList", # Identifies what kind of resource this is. Value: the fixed string "drive#fileList". 1622 "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. 1623 }</pre> 1624</div> 1625 1626<div class="method"> 1627 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 1628 <pre>Retrieves the next page of results. 1629 1630Args: 1631 previous_request: The request for the previous page. (required) 1632 previous_response: The response from the request for the previous page. (required) 1633 1634Returns: 1635 A request object that you can call 'execute()' on to request the next 1636 page. Returns None if there are no more items in the collection. 1637 </pre> 1638</div> 1639 1640<div class="method"> 1641 <code class="details" id="update">update(fileId, body=None, keepRevisionForever=None, removeParents=None, supportsTeamDrives=None, media_body=None, ocrLanguage=None, addParents=None, useContentAsIndexableText=None, supportsAllDrives=None, media_mime_type=None)</code> 1642 <pre>Updates a file's metadata and/or content with patch semantics. 1643 1644Args: 1645 fileId: string, The ID of the file. (required) 1646 body: object, The request body. 1647 The object takes the form of: 1648 1649{ # The metadata for a file. 1650 "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. 1651 "mimeType": "A String", # The MIME type of the file. 1652 # Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. 1653 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource. 1654 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time). 1655 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. 1656 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 1657 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. 1658 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 1659 "teamDriveId": "A String", # Deprecated - use driveId instead. 1660 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. 1661 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives. 1662 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time). 1663 "id": "A String", # The ID of the file. 1664 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable. 1665 "me": True or False, # Whether this user is the requesting user. 1666 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1667 "displayName": "A String", # A plain text displayable name for this user. 1668 "permissionId": "A String", # The user's ID as visible in Permission resources. 1669 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1670 "photoLink": "A String", # A link to the user's profile photo, if available. 1671 }, 1672 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive. 1673 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload. 1674 "width": 42, # The width of the video in pixels. 1675 "durationMillis": "A String", # The duration of the video in milliseconds. 1676 "height": 42, # The height of the video in pixels. 1677 }, 1678 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file. 1679 "me": True or False, # Whether this user is the requesting user. 1680 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1681 "displayName": "A String", # A plain text displayable name for this user. 1682 "permissionId": "A String", # The user's ID as visible in Permission resources. 1683 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1684 "photoLink": "A String", # A link to the user's profile photo, if available. 1685 }, 1686 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource. 1687 # If an unsupported color is specified, the closest color in the palette will be used instead. 1688 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app. 1689 # Entries with null values are cleared in update and copy requests. 1690 "a_key": "A String", 1691 }, 1692 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 1693 "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. 1694 "canUntrash": True or False, # Whether the current user can restore this file from trash. 1695 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 1696 "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. 1697 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 1698 "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. 1699 "canRename": True or False, # Whether the current user can rename this file. 1700 "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. 1701 "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. 1702 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 1703 "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. 1704 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 1705 "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. 1706 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives. 1707 "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. 1708 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1709 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1710 "canComment": True or False, # Whether the current user can comment on this file. 1711 "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. 1712 "canChangeViewersCanCopyContent": True or False, # Deprecated 1713 "canTrash": True or False, # Whether the current user can move this file to trash. 1714 "canDelete": True or False, # Whether the current user can delete this file. 1715 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 1716 "canDownload": True or False, # Whether the current user can download this file. 1717 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 1718 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 1719 "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. 1720 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 1721 "canEdit": True or False, # Whether the current user can edit this file. 1722 }, 1723 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives. 1724 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser. 1725 "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 user. 1726 "parents": [ # The IDs of the parent folders which contain the file. 1727 # If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to modify the parents list. 1728 "A String", 1729 ], 1730 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time). 1731 "exportLinks": { # Links for exporting Google Docs to specific formats. 1732 "a_key": "A String", # A mapping from export format to URL 1733 }, 1734 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 1735 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 1736 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. 1737 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension. 1738 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Google Drive. 1739 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead. 1740 "description": "A String", # A short description of the file. 1741 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time). 1742 # Note that setting modifiedTime will also update modifiedByMeTime for the user. 1743 "viewedByMe": True or False, # Whether the file has been viewed by this user. 1744 "modifiedByMe": True or False, # Whether the file has been modified by this user. 1745 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives. 1746 { # Information about a Drive user. 1747 "me": True or False, # Whether this user is the requesting user. 1748 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1749 "displayName": "A String", # A plain text displayable name for this user. 1750 "permissionId": "A String", # The user's ID as visible in Permission resources. 1751 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1752 "photoLink": "A String", # A link to the user's profile photo, if available. 1753 }, 1754 ], 1755 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time). 1756 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled. 1757 "starred": True or False, # Whether the user has starred the file. 1758 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps. 1759 # Entries with null values are cleared in update and copy requests. 1760 "a_key": "A String", 1761 }, 1762 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive. 1763 "iconLink": "A String", # A static, unauthenticated link to the file's icon. 1764 "imageMediaMetadata": { # Additional metadata about image media, if available. 1765 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 1766 "exposureTime": 3.14, # The length of the exposure, in seconds. 1767 "cameraMake": "A String", # The make of the camera used to create the photo. 1768 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 1769 "width": 42, # The width of the image in pixels. 1770 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 1771 "exposureMode": "A String", # The exposure mode used to create the photo. 1772 "colorSpace": "A String", # The color space of the photo. 1773 "location": { # Geographic location information stored in the image. 1774 "latitude": 3.14, # The latitude stored in the image. 1775 "altitude": 3.14, # The altitude stored in the image. 1776 "longitude": 3.14, # The longitude stored in the image. 1777 }, 1778 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 1779 "height": 42, # The height of the image in pixels. 1780 "lens": "A String", # The lens used to create the photo. 1781 "isoSpeed": 42, # The ISO speed used to create the photo. 1782 "meteringMode": "A String", # The metering mode used to create the photo. 1783 "flashUsed": True or False, # Whether a flash was used to create the photo. 1784 "time": "A String", # The date and time the photo was taken (EXIF DateTime). 1785 "aperture": 3.14, # The aperture used to create the photo (f-number). 1786 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation. 1787 "sensor": "A String", # The type of sensor used to create the photo. 1788 "whiteBalance": "A String", # The white balance mode used to create the photo. 1789 "cameraModel": "A String", # The model of the camera used to create the photo. 1790 }, 1791 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file". 1792 "name": "A String", # The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant. 1793 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive. 1794 "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. 1795 "me": True or False, # Whether this user is the requesting user. 1796 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1797 "displayName": "A String", # A plain text displayable name for this user. 1798 "permissionId": "A String", # The user's ID as visible in Permission resources. 1799 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1800 "photoLink": "A String", # A link to the user's profile photo, if available. 1801 }, 1802 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 1803 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. 1804 "A String", 1805 ], 1806 "permissionIds": [ # List of permission IDs for users with access to this file. 1807 "A String", 1808 ], 1809 "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, and other users cannot see files in the owner's trash. 1810 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses. 1811 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements. 1812 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail. 1813 "mimeType": "A String", # The MIME type of the thumbnail. 1814 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5). 1815 }, 1816 }, 1817 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive. 1818 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for shared drive files. 1819 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for items in shared drives. 1820 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. 1821 "domain": "A String", # The domain to which this permission refers. 1822 "displayName": "A String", # A displayable name for users, groups or domains. 1823 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 1824 { 1825 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 1826 "role": "A String", # Deprecated - use permissionDetails/role instead. 1827 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 1828 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 1829 }, 1830 ], 1831 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. 1832 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 1833 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". 1834 "emailAddress": "A String", # The email address of the user or group to which this permission refers. 1835 "photoLink": "A String", # A link to the user's profile photo, if available. 1836 "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. 1837 { 1838 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 1839 # - organizer 1840 # - fileOrganizer 1841 # - writer 1842 # - commenter 1843 # - reader 1844 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive. 1845 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 1846 # - file 1847 # - member 1848 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 1849 }, 1850 ], 1851 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: 1852 # - They can only be set on user and group permissions 1853 # - The time must be in the future 1854 # - The time cannot be more than a year in the future 1855 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed: 1856 # - owner 1857 # - organizer 1858 # - fileOrganizer 1859 # - writer 1860 # - commenter 1861 # - reader 1862 "type": "A String", # The type of the grantee. Valid values are: 1863 # - user 1864 # - group 1865 # - domain 1866 # - anyone 1867 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. 1868 }, 1869 ], 1870 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive. 1871} 1872 1873 keepRevisionForever: boolean, Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. 1874 removeParents: string, A comma-separated list of parent IDs to remove. 1875 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 1876 media_body: string, The filename of the media request body, or an instance of a MediaUpload object. 1877 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code). 1878 addParents: string, A comma-separated list of parent IDs to add. 1879 useContentAsIndexableText: boolean, Whether to use the uploaded content as indexable text. 1880 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. 1881 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object. 1882 1883Returns: 1884 An object of the form: 1885 1886 { # The metadata for a file. 1887 "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. 1888 "mimeType": "A String", # The MIME type of the file. 1889 # Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. 1890 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource. 1891 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time). 1892 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. 1893 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation. 1894 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. 1895 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app. 1896 "teamDriveId": "A String", # Deprecated - use driveId instead. 1897 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives. 1898 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives. 1899 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time). 1900 "id": "A String", # The ID of the file. 1901 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable. 1902 "me": True or False, # Whether this user is the requesting user. 1903 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1904 "displayName": "A String", # A plain text displayable name for this user. 1905 "permissionId": "A String", # The user's ID as visible in Permission resources. 1906 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1907 "photoLink": "A String", # A link to the user's profile photo, if available. 1908 }, 1909 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive. 1910 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload. 1911 "width": 42, # The width of the video in pixels. 1912 "durationMillis": "A String", # The duration of the video in milliseconds. 1913 "height": 42, # The height of the video in pixels. 1914 }, 1915 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file. 1916 "me": True or False, # Whether this user is the requesting user. 1917 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1918 "displayName": "A String", # A plain text displayable name for this user. 1919 "permissionId": "A String", # The user's ID as visible in Permission resources. 1920 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1921 "photoLink": "A String", # A link to the user's profile photo, if available. 1922 }, 1923 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource. 1924 # If an unsupported color is specified, the closest color in the palette will be used instead. 1925 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app. 1926 # Entries with null values are cleared in update and copy requests. 1927 "a_key": "A String", 1928 }, 1929 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. 1930 "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. 1931 "canUntrash": True or False, # Whether the current user can restore this file from trash. 1932 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead. 1933 "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. 1934 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead. 1935 "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. 1936 "canRename": True or False, # Whether the current user can rename this file. 1937 "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. 1938 "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. 1939 "canShare": True or False, # Whether the current user can modify the sharing settings for this file. 1940 "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. 1941 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives. 1942 "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. 1943 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives. 1944 "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. 1945 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1946 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead. 1947 "canComment": True or False, # Whether the current user can comment on this file. 1948 "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. 1949 "canChangeViewersCanCopyContent": True or False, # Deprecated 1950 "canTrash": True or False, # Whether the current user can move this file to trash. 1951 "canDelete": True or False, # Whether the current user can delete this file. 1952 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead. 1953 "canDownload": True or False, # Whether the current user can download this file. 1954 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file. 1955 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead. 1956 "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. 1957 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead. 1958 "canEdit": True or False, # Whether the current user can edit this file. 1959 }, 1960 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives. 1961 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser. 1962 "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 user. 1963 "parents": [ # The IDs of the parent folders which contain the file. 1964 # If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to modify the parents list. 1965 "A String", 1966 ], 1967 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time). 1968 "exportLinks": { # Links for exporting Google Docs to specific formats. 1969 "a_key": "A String", # A mapping from export format to URL 1970 }, 1971 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives. 1972 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters. 1973 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Google Drive. 1974 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension. 1975 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Google Drive. 1976 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead. 1977 "description": "A String", # A short description of the file. 1978 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time). 1979 # Note that setting modifiedTime will also update modifiedByMeTime for the user. 1980 "viewedByMe": True or False, # Whether the file has been viewed by this user. 1981 "modifiedByMe": True or False, # Whether the file has been modified by this user. 1982 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives. 1983 { # Information about a Drive user. 1984 "me": True or False, # Whether this user is the requesting user. 1985 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 1986 "displayName": "A String", # A plain text displayable name for this user. 1987 "permissionId": "A String", # The user's ID as visible in Permission resources. 1988 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 1989 "photoLink": "A String", # A link to the user's profile photo, if available. 1990 }, 1991 ], 1992 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time). 1993 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled. 1994 "starred": True or False, # Whether the user has starred the file. 1995 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps. 1996 # Entries with null values are cleared in update and copy requests. 1997 "a_key": "A String", 1998 }, 1999 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive. 2000 "iconLink": "A String", # A static, unauthenticated link to the file's icon. 2001 "imageMediaMetadata": { # Additional metadata about image media, if available. 2002 "exposureBias": 3.14, # The exposure bias of the photo (APEX value). 2003 "exposureTime": 3.14, # The length of the exposure, in seconds. 2004 "cameraMake": "A String", # The make of the camera used to create the photo. 2005 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value). 2006 "width": 42, # The width of the image in pixels. 2007 "focalLength": 3.14, # The focal length used to create the photo, in millimeters. 2008 "exposureMode": "A String", # The exposure mode used to create the photo. 2009 "colorSpace": "A String", # The color space of the photo. 2010 "location": { # Geographic location information stored in the image. 2011 "latitude": 3.14, # The latitude stored in the image. 2012 "altitude": 3.14, # The altitude stored in the image. 2013 "longitude": 3.14, # The longitude stored in the image. 2014 }, 2015 "subjectDistance": 42, # The distance to the subject of the photo, in meters. 2016 "height": 42, # The height of the image in pixels. 2017 "lens": "A String", # The lens used to create the photo. 2018 "isoSpeed": 42, # The ISO speed used to create the photo. 2019 "meteringMode": "A String", # The metering mode used to create the photo. 2020 "flashUsed": True or False, # Whether a flash was used to create the photo. 2021 "time": "A String", # The date and time the photo was taken (EXIF DateTime). 2022 "aperture": 3.14, # The aperture used to create the photo (f-number). 2023 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation. 2024 "sensor": "A String", # The type of sensor used to create the photo. 2025 "whiteBalance": "A String", # The white balance mode used to create the photo. 2026 "cameraModel": "A String", # The model of the camera used to create the photo. 2027 }, 2028 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file". 2029 "name": "A String", # The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant. 2030 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Google Drive. 2031 "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. 2032 "me": True or False, # Whether this user is the requesting user. 2033 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user". 2034 "displayName": "A String", # A plain text displayable name for this user. 2035 "permissionId": "A String", # The user's ID as visible in Permission resources. 2036 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester. 2037 "photoLink": "A String", # A link to the user's profile photo, if available. 2038 }, 2039 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives. 2040 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. 2041 "A String", 2042 ], 2043 "permissionIds": [ # List of permission IDs for users with access to this file. 2044 "A String", 2045 ], 2046 "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, and other users cannot see files in the owner's trash. 2047 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses. 2048 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements. 2049 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail. 2050 "mimeType": "A String", # The MIME type of the thumbnail. 2051 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5). 2052 }, 2053 }, 2054 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive. 2055 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for shared drive files. 2056 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for items in shared drives. 2057 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. 2058 "domain": "A String", # The domain to which this permission refers. 2059 "displayName": "A String", # A displayable name for users, groups or domains. 2060 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 2061 { 2062 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 2063 "role": "A String", # Deprecated - use permissionDetails/role instead. 2064 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 2065 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 2066 }, 2067 ], 2068 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. 2069 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 2070 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". 2071 "emailAddress": "A String", # The email address of the user or group to which this permission refers. 2072 "photoLink": "A String", # A link to the user's profile photo, if available. 2073 "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. 2074 { 2075 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 2076 # - organizer 2077 # - fileOrganizer 2078 # - writer 2079 # - commenter 2080 # - reader 2081 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive. 2082 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 2083 # - file 2084 # - member 2085 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 2086 }, 2087 ], 2088 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: 2089 # - They can only be set on user and group permissions 2090 # - The time must be in the future 2091 # - The time cannot be more than a year in the future 2092 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed: 2093 # - owner 2094 # - organizer 2095 # - fileOrganizer 2096 # - writer 2097 # - commenter 2098 # - reader 2099 "type": "A String", # The type of the grantee. Valid values are: 2100 # - user 2101 # - group 2102 # - domain 2103 # - anyone 2104 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. 2105 }, 2106 ], 2107 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive. 2108 }</pre> 2109</div> 2110 2111<div class="method"> 2112 <code class="details" id="watch">watch(fileId, body, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</code> 2113 <pre>Subscribes to changes to a file 2114 2115Args: 2116 fileId: string, The ID of the file. (required) 2117 body: object, The request body. (required) 2118 The object takes the form of: 2119 2120{ # An notification channel used to watch for resource changes. 2121 "resourceUri": "A String", # A version-specific identifier for the watched resource. 2122 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". 2123 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. 2124 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional. 2125 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. 2126 "params": { # Additional parameters controlling delivery channel behavior. Optional. 2127 "a_key": "A String", # Declares a new parameter by name. 2128 }, 2129 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. 2130 "address": "A String", # The address where notifications are delivered for this channel. 2131 "type": "A String", # The type of delivery mechanism used for this channel. 2132 "id": "A String", # A UUID or similar unique string that identifies this channel. 2133 } 2134 2135 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 2136 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. 2137 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. 2138 2139Returns: 2140 An object of the form: 2141 2142 { # An notification channel used to watch for resource changes. 2143 "resourceUri": "A String", # A version-specific identifier for the watched resource. 2144 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". 2145 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. 2146 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional. 2147 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. 2148 "params": { # Additional parameters controlling delivery channel behavior. Optional. 2149 "a_key": "A String", # Declares a new parameter by name. 2150 }, 2151 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. 2152 "address": "A String", # The address where notifications are delivered for this channel. 2153 "type": "A String", # The type of delivery mechanism used for this channel. 2154 "id": "A String", # A UUID or similar unique string that identifies this channel. 2155 }</pre> 2156</div> 2157 2158<div class="method"> 2159 <code class="details" id="watch_media">watch_media(fileId, body, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</code> 2160 <pre>Subscribes to changes to a file 2161 2162Args: 2163 fileId: string, The ID of the file. (required) 2164 body: object, The request body. (required) 2165 The object takes the form of: 2166 2167{ # An notification channel used to watch for resource changes. 2168 "resourceUri": "A String", # A version-specific identifier for the watched resource. 2169 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". 2170 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. 2171 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional. 2172 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. 2173 "params": { # Additional parameters controlling delivery channel behavior. Optional. 2174 "a_key": "A String", # Declares a new parameter by name. 2175 }, 2176 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. 2177 "address": "A String", # The address where notifications are delivered for this channel. 2178 "type": "A String", # The type of delivery mechanism used for this channel. 2179 "id": "A String", # A UUID or similar unique string that identifies this channel. 2180 } 2181 2182 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 2183 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. 2184 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. 2185 2186Returns: 2187 The media object as a string. 2188 2189 </pre> 2190</div> 2191 2192</body></html>