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