blob: bd3cf264433da05f296103f4a0edf3241f2067d2 [file] [log] [blame]
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001<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">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#copy">copy(fileId, body=None, enforceSingleParent=None, keepRevisionForever=None, ignoreDefaultVisibility=None, ocrLanguage=None, supportsTeamDrives=None, supportsAllDrives=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080079<p class="firstline">Creates a copy of a file and applies any requested updates with patch semantics.</p>
80<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#create">create(body=None, enforceSingleParent=None, keepRevisionForever=None, media_body=None, useContentAsIndexableText=None, supportsTeamDrives=None, ocrLanguage=None, ignoreDefaultVisibility=None, supportsAllDrives=None, media_mime_type=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080082<p class="firstline">Creates a new file.</p>
83<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070084 <code><a href="#delete">delete(fileId, supportsTeamDrives=None, supportsAllDrives=None)</a></code></p>
85<p class="firstline">Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted.</p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080086<p class="toc_element">
87 <code><a href="#emptyTrash">emptyTrash()</a></code></p>
88<p class="firstline">Permanently deletes all of the user's trashed files.</p>
89<p class="toc_element">
90 <code><a href="#export">export(fileId, mimeType)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070091<p class="firstline">Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.</p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080092<p class="toc_element">
93 <code><a href="#export_media">export_media(fileId, mimeType)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094<p class="firstline">Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.</p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080095<p class="toc_element">
96 <code><a href="#generateIds">generateIds(count=None, space=None)</a></code></p>
Dan O'Mearadd494642020-05-01 07:42:23 -070097<p class="firstline">Generates a set of file IDs which can be provided in create or copy requests.</p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080098<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070099 <code><a href="#get">get(fileId, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800100<p class="firstline">Gets a file's metadata or content by ID.</p>
101<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700102 <code><a href="#get_media">get_media(fileId, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800103<p class="firstline">Gets a file's metadata or content by ID.</p>
104<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700105 <code><a href="#list">list(orderBy=None, pageSize=None, supportsTeamDrives=None, spaces=None, q=None, pageToken=None, corpus=None, teamDriveId=None, includeItemsFromAllDrives=None, includeTeamDriveItems=None, corpora=None, supportsAllDrives=None, driveId=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800106<p class="firstline">Lists or searches files.</p>
107<p class="toc_element">
108 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
109<p class="firstline">Retrieves the next page of results.</p>
110<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700111 <code><a href="#update">update(fileId, body=None, keepRevisionForever=None, removeParents=None, supportsTeamDrives=None, media_body=None, ocrLanguage=None, addParents=None, enforceSingleParent=None, useContentAsIndexableText=None, supportsAllDrives=None, media_mime_type=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800112<p class="firstline">Updates a file's metadata and/or content with patch semantics.</p>
113<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700114 <code><a href="#watch">watch(fileId, body=None, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800115<p class="firstline">Subscribes to changes to a file</p>
116<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700117 <code><a href="#watch_media">watch_media(fileId, body=None, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800118<p class="firstline">Subscribes to changes to a file</p>
119<h3>Method Details</h3>
120<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700121 <code class="details" id="copy">copy(fileId, body=None, enforceSingleParent=None, keepRevisionForever=None, ignoreDefaultVisibility=None, ocrLanguage=None, supportsTeamDrives=None, supportsAllDrives=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800122 <pre>Creates a copy of a file and applies any requested updates with patch semantics.
123
124Args:
125 fileId: string, The ID of the file. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700126 body: object, The request body.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800127 The object takes the form of:
128
129{ # The metadata for a file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700130 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800131 "mimeType": "A String", # The MIME type of the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700132 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800133 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.
134 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800135 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700136 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800137 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700138 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700139 "teamDriveId": "A String", # Deprecated - use driveId instead.
140 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.
141 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800142 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
143 "id": "A String", # The ID of the file.
144 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
145 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700146 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800147 "displayName": "A String", # A plain text displayable name for this user.
148 "permissionId": "A String", # The user's ID as visible in Permission resources.
149 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
150 "photoLink": "A String", # A link to the user's profile photo, if available.
151 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700152 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut.
153 "targetId": "A String", # The ID of the file that this shortcut points to.
154 "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.
155 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700156 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800157 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
158 "width": 42, # The width of the video in pixels.
159 "durationMillis": "A String", # The duration of the video in milliseconds.
160 "height": 42, # The height of the video in pixels.
161 },
162 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
163 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700164 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800165 "displayName": "A String", # A plain text displayable name for this user.
166 "permissionId": "A String", # The user's ID as visible in Permission resources.
167 "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.
168 "photoLink": "A String", # A link to the user's profile photo, if available.
169 },
170 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
171 # If an unsupported color is specified, the closest color in the palette will be used instead.
172 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
173 # Entries with null values are cleared in update and copy requests.
174 "a_key": "A String",
175 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700176 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
177 "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.
178 "canUntrash": True or False, # Whether the current user can restore this file from trash.
179 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead.
180 "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.
181 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead.
182 "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.
183 "canRename": True or False, # Whether the current user can rename this file.
Dan O'Mearadd494642020-05-01 07:42:23 -0700184 "canModifyContent": True or False, # Whether the current user can modify the content of this file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700185 "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.
186 "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.
187 "canShare": True or False, # Whether the current user can modify the sharing settings for this file.
188 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700189 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700190 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives.
191 "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.
192 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives.
193 "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.
194 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
195 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
196 "canComment": True or False, # Whether the current user can comment on this file.
197 "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.
198 "canChangeViewersCanCopyContent": True or False, # Deprecated
199 "canTrash": True or False, # Whether the current user can move this file to trash.
Dan O'Mearadd494642020-05-01 07:42:23 -0700200 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700201 "canDelete": True or False, # Whether the current user can delete this file.
202 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead.
203 "canDownload": True or False, # Whether the current user can download this file.
204 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file.
205 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead.
206 "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.
207 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead.
Dan O'Mearadd494642020-05-01 07:42:23 -0700208 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800209 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700210 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800211 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
212 "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.
213 "parents": [ # The IDs of the parent folders which contain the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700214 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800215 "A String",
216 ],
217 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700218 "exportLinks": { # Links for exporting Google Docs to specific formats.
219 "a_key": "A String", # A mapping from export format to URL
220 },
221 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives.
222 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
223 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800224 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700225 "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.
226 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800227 "description": "A String", # A short description of the file.
228 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
229 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
230 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800231 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700232 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800233 { # Information about a Drive user.
234 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700235 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800236 "displayName": "A String", # A plain text displayable name for this user.
237 "permissionId": "A String", # The user's ID as visible in Permission resources.
238 "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.
239 "photoLink": "A String", # A link to the user's profile photo, if available.
240 },
241 ],
242 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
243 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700244 "starred": True or False, # Whether the user has starred the file.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800245 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
246 # Entries with null values are cleared in update and copy requests.
247 "a_key": "A String",
248 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700249 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800250 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
251 "imageMediaMetadata": { # Additional metadata about image media, if available.
252 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
253 "exposureTime": 3.14, # The length of the exposure, in seconds.
254 "cameraMake": "A String", # The make of the camera used to create the photo.
255 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
256 "width": 42, # The width of the image in pixels.
257 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
258 "exposureMode": "A String", # The exposure mode used to create the photo.
259 "colorSpace": "A String", # The color space of the photo.
260 "location": { # Geographic location information stored in the image.
261 "latitude": 3.14, # The latitude stored in the image.
262 "altitude": 3.14, # The altitude stored in the image.
263 "longitude": 3.14, # The longitude stored in the image.
264 },
265 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
266 "height": 42, # The height of the image in pixels.
267 "lens": "A String", # The lens used to create the photo.
268 "isoSpeed": 42, # The ISO speed used to create the photo.
269 "meteringMode": "A String", # The metering mode used to create the photo.
270 "flashUsed": True or False, # Whether a flash was used to create the photo.
271 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
272 "aperture": 3.14, # The aperture used to create the photo (f-number).
Dan O'Mearadd494642020-05-01 07:42:23 -0700273 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800274 "sensor": "A String", # The type of sensor used to create the photo.
275 "whiteBalance": "A String", # The white balance mode used to create the photo.
276 "cameraModel": "A String", # The model of the camera used to create the photo.
277 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700278 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700279 "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.
280 "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.
281 "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.
282 "me": True or False, # Whether this user is the requesting user.
283 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
284 "displayName": "A String", # A plain text displayable name for this user.
285 "permissionId": "A String", # The user's ID as visible in Permission resources.
286 "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.
287 "photoLink": "A String", # A link to the user's profile photo, if available.
288 },
289 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800290 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
291 "A String",
292 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700293 "permissionIds": [ # List of permission IDs for users with access to this file.
294 "A String",
295 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800296 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
297 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
298 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700299 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800300 "mimeType": "A String", # The MIME type of the thumbnail.
301 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
302 },
303 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700304 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive.
Dan O'Mearadd494642020-05-01 07:42:23 -0700305 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700306 "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.
307 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
308 "domain": "A String", # The domain to which this permission refers.
Dan O'Mearadd494642020-05-01 07:42:23 -0700309 "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission:
310 # - user - User's full name, as defined for their Google account, such as "Joe Smith."
311 # - group - Name of the Google Group, such as "The Company Administrators."
312 # - domain - String domain name, such as "thecompany.com."
313 # - anyone - No displayName is present.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700314 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
315 {
316 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
317 "role": "A String", # Deprecated - use permissionDetails/role instead.
318 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
319 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
320 },
321 ],
322 "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.
323 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
324 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
325 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
326 "photoLink": "A String", # A link to the user's profile photo, if available.
327 "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.
328 {
329 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
330 # - organizer
331 # - fileOrganizer
332 # - writer
333 # - commenter
334 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -0700335 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700336 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
337 # - file
338 # - member
339 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
340 },
341 ],
342 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
343 # - They can only be set on user and group permissions
344 # - The time must be in the future
345 # - The time cannot be more than a year in the future
346 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
347 # - owner
348 # - organizer
349 # - fileOrganizer
350 # - writer
351 # - commenter
352 # - reader
353 "type": "A String", # The type of the grantee. Valid values are:
354 # - user
355 # - group
356 # - domain
Dan O'Mearadd494642020-05-01 07:42:23 -0700357 # - 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.
358 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700359 },
360 ],
361 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800362}
363
Dan O'Mearadd494642020-05-01 07:42:23 -0700364 enforceSingleParent: boolean, Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. Requests that specify more than one parent fail.
365 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700366 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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700367 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code).
368 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700369 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800370
371Returns:
372 An object of the form:
373
374 { # The metadata for a file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700375 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800376 "mimeType": "A String", # The MIME type of the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700377 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800378 # 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.
379 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800380 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700381 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800382 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700383 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700384 "teamDriveId": "A String", # Deprecated - use driveId instead.
385 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.
386 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800387 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
388 "id": "A String", # The ID of the file.
389 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
390 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700391 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800392 "displayName": "A String", # A plain text displayable name for this user.
393 "permissionId": "A String", # The user's ID as visible in Permission resources.
394 "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.
395 "photoLink": "A String", # A link to the user's profile photo, if available.
396 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700397 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut.
398 "targetId": "A String", # The ID of the file that this shortcut points to.
399 "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.
400 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700401 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800402 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
403 "width": 42, # The width of the video in pixels.
404 "durationMillis": "A String", # The duration of the video in milliseconds.
405 "height": 42, # The height of the video in pixels.
406 },
407 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
408 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700409 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800410 "displayName": "A String", # A plain text displayable name for this user.
411 "permissionId": "A String", # The user's ID as visible in Permission resources.
412 "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.
413 "photoLink": "A String", # A link to the user's profile photo, if available.
414 },
415 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
416 # If an unsupported color is specified, the closest color in the palette will be used instead.
417 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
418 # Entries with null values are cleared in update and copy requests.
419 "a_key": "A String",
420 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700421 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
422 "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.
423 "canUntrash": True or False, # Whether the current user can restore this file from trash.
424 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead.
425 "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.
426 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead.
427 "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.
428 "canRename": True or False, # Whether the current user can rename this file.
Dan O'Mearadd494642020-05-01 07:42:23 -0700429 "canModifyContent": True or False, # Whether the current user can modify the content of this file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700430 "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.
431 "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.
432 "canShare": True or False, # Whether the current user can modify the sharing settings for this file.
433 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700434 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700435 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives.
436 "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.
437 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives.
438 "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.
439 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
440 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
441 "canComment": True or False, # Whether the current user can comment on this file.
442 "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.
443 "canChangeViewersCanCopyContent": True or False, # Deprecated
444 "canTrash": True or False, # Whether the current user can move this file to trash.
Dan O'Mearadd494642020-05-01 07:42:23 -0700445 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700446 "canDelete": True or False, # Whether the current user can delete this file.
447 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead.
448 "canDownload": True or False, # Whether the current user can download this file.
449 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file.
450 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead.
451 "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.
452 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead.
Dan O'Mearadd494642020-05-01 07:42:23 -0700453 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800454 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700455 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800456 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
457 "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.
458 "parents": [ # The IDs of the parent folders which contain the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700459 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800460 "A String",
461 ],
462 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700463 "exportLinks": { # Links for exporting Google Docs to specific formats.
464 "a_key": "A String", # A mapping from export format to URL
465 },
466 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives.
467 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
468 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800469 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700470 "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.
471 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800472 "description": "A String", # A short description of the file.
473 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
474 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
475 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800476 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700477 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800478 { # Information about a Drive user.
479 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700480 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800481 "displayName": "A String", # A plain text displayable name for this user.
482 "permissionId": "A String", # The user's ID as visible in Permission resources.
483 "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.
484 "photoLink": "A String", # A link to the user's profile photo, if available.
485 },
486 ],
487 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
488 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700489 "starred": True or False, # Whether the user has starred the file.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800490 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
491 # Entries with null values are cleared in update and copy requests.
492 "a_key": "A String",
493 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700494 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800495 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
496 "imageMediaMetadata": { # Additional metadata about image media, if available.
497 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
498 "exposureTime": 3.14, # The length of the exposure, in seconds.
499 "cameraMake": "A String", # The make of the camera used to create the photo.
500 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
501 "width": 42, # The width of the image in pixels.
502 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
503 "exposureMode": "A String", # The exposure mode used to create the photo.
504 "colorSpace": "A String", # The color space of the photo.
505 "location": { # Geographic location information stored in the image.
506 "latitude": 3.14, # The latitude stored in the image.
507 "altitude": 3.14, # The altitude stored in the image.
508 "longitude": 3.14, # The longitude stored in the image.
509 },
510 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
511 "height": 42, # The height of the image in pixels.
512 "lens": "A String", # The lens used to create the photo.
513 "isoSpeed": 42, # The ISO speed used to create the photo.
514 "meteringMode": "A String", # The metering mode used to create the photo.
515 "flashUsed": True or False, # Whether a flash was used to create the photo.
516 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
517 "aperture": 3.14, # The aperture used to create the photo (f-number).
Dan O'Mearadd494642020-05-01 07:42:23 -0700518 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800519 "sensor": "A String", # The type of sensor used to create the photo.
520 "whiteBalance": "A String", # The white balance mode used to create the photo.
521 "cameraModel": "A String", # The model of the camera used to create the photo.
522 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700523 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700524 "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.
525 "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.
526 "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.
527 "me": True or False, # Whether this user is the requesting user.
528 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
529 "displayName": "A String", # A plain text displayable name for this user.
530 "permissionId": "A String", # The user's ID as visible in Permission resources.
531 "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.
532 "photoLink": "A String", # A link to the user's profile photo, if available.
533 },
534 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800535 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
536 "A String",
537 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700538 "permissionIds": [ # List of permission IDs for users with access to this file.
539 "A String",
540 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800541 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
542 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
543 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700544 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800545 "mimeType": "A String", # The MIME type of the thumbnail.
546 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
547 },
548 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700549 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive.
Dan O'Mearadd494642020-05-01 07:42:23 -0700550 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700551 "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.
552 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
553 "domain": "A String", # The domain to which this permission refers.
Dan O'Mearadd494642020-05-01 07:42:23 -0700554 "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission:
555 # - user - User's full name, as defined for their Google account, such as "Joe Smith."
556 # - group - Name of the Google Group, such as "The Company Administrators."
557 # - domain - String domain name, such as "thecompany.com."
558 # - anyone - No displayName is present.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700559 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
560 {
561 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
562 "role": "A String", # Deprecated - use permissionDetails/role instead.
563 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
564 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
565 },
566 ],
567 "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.
568 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
569 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
570 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
571 "photoLink": "A String", # A link to the user's profile photo, if available.
572 "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.
573 {
574 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
575 # - organizer
576 # - fileOrganizer
577 # - writer
578 # - commenter
579 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -0700580 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700581 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
582 # - file
583 # - member
584 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
585 },
586 ],
587 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
588 # - They can only be set on user and group permissions
589 # - The time must be in the future
590 # - The time cannot be more than a year in the future
591 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
592 # - owner
593 # - organizer
594 # - fileOrganizer
595 # - writer
596 # - commenter
597 # - reader
598 "type": "A String", # The type of the grantee. Valid values are:
599 # - user
600 # - group
601 # - domain
Dan O'Mearadd494642020-05-01 07:42:23 -0700602 # - 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.
603 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700604 },
605 ],
606 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800607 }</pre>
608</div>
609
610<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700611 <code class="details" id="create">create(body=None, enforceSingleParent=None, keepRevisionForever=None, media_body=None, useContentAsIndexableText=None, supportsTeamDrives=None, ocrLanguage=None, ignoreDefaultVisibility=None, supportsAllDrives=None, media_mime_type=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800612 <pre>Creates a new file.
613
614Args:
615 body: object, The request body.
616 The object takes the form of:
617
618{ # The metadata for a file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700619 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800620 "mimeType": "A String", # The MIME type of the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700621 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800622 # 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.
623 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800624 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700625 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800626 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700627 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700628 "teamDriveId": "A String", # Deprecated - use driveId instead.
629 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.
630 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800631 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
632 "id": "A String", # The ID of the file.
633 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
634 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700635 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800636 "displayName": "A String", # A plain text displayable name for this user.
637 "permissionId": "A String", # The user's ID as visible in Permission resources.
638 "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.
639 "photoLink": "A String", # A link to the user's profile photo, if available.
640 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700641 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut.
642 "targetId": "A String", # The ID of the file that this shortcut points to.
643 "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.
644 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700645 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800646 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
647 "width": 42, # The width of the video in pixels.
648 "durationMillis": "A String", # The duration of the video in milliseconds.
649 "height": 42, # The height of the video in pixels.
650 },
651 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
652 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700653 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800654 "displayName": "A String", # A plain text displayable name for this user.
655 "permissionId": "A String", # The user's ID as visible in Permission resources.
656 "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.
657 "photoLink": "A String", # A link to the user's profile photo, if available.
658 },
659 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
660 # If an unsupported color is specified, the closest color in the palette will be used instead.
661 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
662 # Entries with null values are cleared in update and copy requests.
663 "a_key": "A String",
664 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700665 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
666 "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.
667 "canUntrash": True or False, # Whether the current user can restore this file from trash.
668 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead.
669 "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.
670 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead.
671 "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.
672 "canRename": True or False, # Whether the current user can rename this file.
Dan O'Mearadd494642020-05-01 07:42:23 -0700673 "canModifyContent": True or False, # Whether the current user can modify the content of this file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700674 "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.
675 "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.
676 "canShare": True or False, # Whether the current user can modify the sharing settings for this file.
677 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700678 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700679 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives.
680 "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.
681 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives.
682 "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.
683 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
684 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
685 "canComment": True or False, # Whether the current user can comment on this file.
686 "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.
687 "canChangeViewersCanCopyContent": True or False, # Deprecated
688 "canTrash": True or False, # Whether the current user can move this file to trash.
Dan O'Mearadd494642020-05-01 07:42:23 -0700689 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700690 "canDelete": True or False, # Whether the current user can delete this file.
691 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead.
692 "canDownload": True or False, # Whether the current user can download this file.
693 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file.
694 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead.
695 "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.
696 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead.
Dan O'Mearadd494642020-05-01 07:42:23 -0700697 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800698 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700699 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800700 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
701 "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.
702 "parents": [ # The IDs of the parent folders which contain the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700703 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800704 "A String",
705 ],
706 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700707 "exportLinks": { # Links for exporting Google Docs to specific formats.
708 "a_key": "A String", # A mapping from export format to URL
709 },
710 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives.
711 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
712 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800713 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700714 "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.
715 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800716 "description": "A String", # A short description of the file.
717 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
718 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
719 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800720 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700721 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800722 { # Information about a Drive user.
723 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700724 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800725 "displayName": "A String", # A plain text displayable name for this user.
726 "permissionId": "A String", # The user's ID as visible in Permission resources.
727 "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.
728 "photoLink": "A String", # A link to the user's profile photo, if available.
729 },
730 ],
731 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
732 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700733 "starred": True or False, # Whether the user has starred the file.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800734 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
735 # Entries with null values are cleared in update and copy requests.
736 "a_key": "A String",
737 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700738 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800739 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
740 "imageMediaMetadata": { # Additional metadata about image media, if available.
741 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
742 "exposureTime": 3.14, # The length of the exposure, in seconds.
743 "cameraMake": "A String", # The make of the camera used to create the photo.
744 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
745 "width": 42, # The width of the image in pixels.
746 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
747 "exposureMode": "A String", # The exposure mode used to create the photo.
748 "colorSpace": "A String", # The color space of the photo.
749 "location": { # Geographic location information stored in the image.
750 "latitude": 3.14, # The latitude stored in the image.
751 "altitude": 3.14, # The altitude stored in the image.
752 "longitude": 3.14, # The longitude stored in the image.
753 },
754 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
755 "height": 42, # The height of the image in pixels.
756 "lens": "A String", # The lens used to create the photo.
757 "isoSpeed": 42, # The ISO speed used to create the photo.
758 "meteringMode": "A String", # The metering mode used to create the photo.
759 "flashUsed": True or False, # Whether a flash was used to create the photo.
760 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
761 "aperture": 3.14, # The aperture used to create the photo (f-number).
Dan O'Mearadd494642020-05-01 07:42:23 -0700762 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800763 "sensor": "A String", # The type of sensor used to create the photo.
764 "whiteBalance": "A String", # The white balance mode used to create the photo.
765 "cameraModel": "A String", # The model of the camera used to create the photo.
766 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700767 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700768 "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.
769 "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.
770 "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.
771 "me": True or False, # Whether this user is the requesting user.
772 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
773 "displayName": "A String", # A plain text displayable name for this user.
774 "permissionId": "A String", # The user's ID as visible in Permission resources.
775 "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.
776 "photoLink": "A String", # A link to the user's profile photo, if available.
777 },
778 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800779 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
780 "A String",
781 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700782 "permissionIds": [ # List of permission IDs for users with access to this file.
783 "A String",
784 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800785 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
786 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
787 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700788 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800789 "mimeType": "A String", # The MIME type of the thumbnail.
790 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
791 },
792 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700793 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive.
Dan O'Mearadd494642020-05-01 07:42:23 -0700794 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700795 "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.
796 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
797 "domain": "A String", # The domain to which this permission refers.
Dan O'Mearadd494642020-05-01 07:42:23 -0700798 "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission:
799 # - user - User's full name, as defined for their Google account, such as "Joe Smith."
800 # - group - Name of the Google Group, such as "The Company Administrators."
801 # - domain - String domain name, such as "thecompany.com."
802 # - anyone - No displayName is present.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700803 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
804 {
805 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
806 "role": "A String", # Deprecated - use permissionDetails/role instead.
807 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
808 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
809 },
810 ],
811 "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.
812 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
813 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
814 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
815 "photoLink": "A String", # A link to the user's profile photo, if available.
816 "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.
817 {
818 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
819 # - organizer
820 # - fileOrganizer
821 # - writer
822 # - commenter
823 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -0700824 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700825 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
826 # - file
827 # - member
828 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
829 },
830 ],
831 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
832 # - They can only be set on user and group permissions
833 # - The time must be in the future
834 # - The time cannot be more than a year in the future
835 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
836 # - owner
837 # - organizer
838 # - fileOrganizer
839 # - writer
840 # - commenter
841 # - reader
842 "type": "A String", # The type of the grantee. Valid values are:
843 # - user
844 # - group
845 # - domain
Dan O'Mearadd494642020-05-01 07:42:23 -0700846 # - 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.
847 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700848 },
849 ],
850 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800851}
852
Dan O'Mearadd494642020-05-01 07:42:23 -0700853 enforceSingleParent: boolean, Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. Requests that specify more than one parent fail.
854 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800855 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800856 useContentAsIndexableText: boolean, Whether to use the uploaded content as indexable text.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700857 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400858 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700859 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.
860 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
861 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800862
863Returns:
864 An object of the form:
865
866 { # The metadata for a file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700867 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800868 "mimeType": "A String", # The MIME type of the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700869 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800870 # 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.
871 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800872 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700873 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800874 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700875 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700876 "teamDriveId": "A String", # Deprecated - use driveId instead.
877 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.
878 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800879 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
880 "id": "A String", # The ID of the file.
881 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
882 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700883 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800884 "displayName": "A String", # A plain text displayable name for this user.
885 "permissionId": "A String", # The user's ID as visible in Permission resources.
886 "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.
887 "photoLink": "A String", # A link to the user's profile photo, if available.
888 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700889 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut.
890 "targetId": "A String", # The ID of the file that this shortcut points to.
891 "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.
892 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700893 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800894 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
895 "width": 42, # The width of the video in pixels.
896 "durationMillis": "A String", # The duration of the video in milliseconds.
897 "height": 42, # The height of the video in pixels.
898 },
899 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
900 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700901 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800902 "displayName": "A String", # A plain text displayable name for this user.
903 "permissionId": "A String", # The user's ID as visible in Permission resources.
904 "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.
905 "photoLink": "A String", # A link to the user's profile photo, if available.
906 },
907 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
908 # If an unsupported color is specified, the closest color in the palette will be used instead.
909 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
910 # Entries with null values are cleared in update and copy requests.
911 "a_key": "A String",
912 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700913 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
914 "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.
915 "canUntrash": True or False, # Whether the current user can restore this file from trash.
916 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead.
917 "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.
918 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead.
919 "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.
920 "canRename": True or False, # Whether the current user can rename this file.
Dan O'Mearadd494642020-05-01 07:42:23 -0700921 "canModifyContent": True or False, # Whether the current user can modify the content of this file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700922 "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.
923 "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.
924 "canShare": True or False, # Whether the current user can modify the sharing settings for this file.
925 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700926 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700927 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives.
928 "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.
929 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives.
930 "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.
931 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
932 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
933 "canComment": True or False, # Whether the current user can comment on this file.
934 "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.
935 "canChangeViewersCanCopyContent": True or False, # Deprecated
936 "canTrash": True or False, # Whether the current user can move this file to trash.
Dan O'Mearadd494642020-05-01 07:42:23 -0700937 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700938 "canDelete": True or False, # Whether the current user can delete this file.
939 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead.
940 "canDownload": True or False, # Whether the current user can download this file.
941 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file.
942 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead.
943 "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.
944 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead.
Dan O'Mearadd494642020-05-01 07:42:23 -0700945 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800946 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700947 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800948 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
949 "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.
950 "parents": [ # The IDs of the parent folders which contain the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700951 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800952 "A String",
953 ],
954 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700955 "exportLinks": { # Links for exporting Google Docs to specific formats.
956 "a_key": "A String", # A mapping from export format to URL
957 },
958 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives.
959 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
960 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800961 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700962 "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.
963 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800964 "description": "A String", # A short description of the file.
965 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
966 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
967 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800968 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700969 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800970 { # Information about a Drive user.
971 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700972 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800973 "displayName": "A String", # A plain text displayable name for this user.
974 "permissionId": "A String", # The user's ID as visible in Permission resources.
975 "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.
976 "photoLink": "A String", # A link to the user's profile photo, if available.
977 },
978 ],
979 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
980 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700981 "starred": True or False, # Whether the user has starred the file.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800982 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
983 # Entries with null values are cleared in update and copy requests.
984 "a_key": "A String",
985 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700986 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800987 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
988 "imageMediaMetadata": { # Additional metadata about image media, if available.
989 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
990 "exposureTime": 3.14, # The length of the exposure, in seconds.
991 "cameraMake": "A String", # The make of the camera used to create the photo.
992 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
993 "width": 42, # The width of the image in pixels.
994 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
995 "exposureMode": "A String", # The exposure mode used to create the photo.
996 "colorSpace": "A String", # The color space of the photo.
997 "location": { # Geographic location information stored in the image.
998 "latitude": 3.14, # The latitude stored in the image.
999 "altitude": 3.14, # The altitude stored in the image.
1000 "longitude": 3.14, # The longitude stored in the image.
1001 },
1002 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1003 "height": 42, # The height of the image in pixels.
1004 "lens": "A String", # The lens used to create the photo.
1005 "isoSpeed": 42, # The ISO speed used to create the photo.
1006 "meteringMode": "A String", # The metering mode used to create the photo.
1007 "flashUsed": True or False, # Whether a flash was used to create the photo.
1008 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1009 "aperture": 3.14, # The aperture used to create the photo (f-number).
Dan O'Mearadd494642020-05-01 07:42:23 -07001010 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001011 "sensor": "A String", # The type of sensor used to create the photo.
1012 "whiteBalance": "A String", # The white balance mode used to create the photo.
1013 "cameraModel": "A String", # The model of the camera used to create the photo.
1014 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001015 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001016 "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.
1017 "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.
1018 "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.
1019 "me": True or False, # Whether this user is the requesting user.
1020 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
1021 "displayName": "A String", # A plain text displayable name for this user.
1022 "permissionId": "A String", # The user's ID as visible in Permission resources.
1023 "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.
1024 "photoLink": "A String", # A link to the user's profile photo, if available.
1025 },
1026 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001027 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1028 "A String",
1029 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001030 "permissionIds": [ # List of permission IDs for users with access to this file.
1031 "A String",
1032 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001033 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
1034 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1035 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001036 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001037 "mimeType": "A String", # The MIME type of the thumbnail.
1038 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1039 },
1040 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001041 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive.
Dan O'Mearadd494642020-05-01 07:42:23 -07001042 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001043 "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.
1044 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1045 "domain": "A String", # The domain to which this permission refers.
Dan O'Mearadd494642020-05-01 07:42:23 -07001046 "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission:
1047 # - user - User's full name, as defined for their Google account, such as "Joe Smith."
1048 # - group - Name of the Google Group, such as "The Company Administrators."
1049 # - domain - String domain name, such as "thecompany.com."
1050 # - anyone - No displayName is present.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001051 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
1052 {
1053 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
1054 "role": "A String", # Deprecated - use permissionDetails/role instead.
1055 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
1056 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
1057 },
1058 ],
1059 "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.
1060 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
1061 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
1062 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1063 "photoLink": "A String", # A link to the user's profile photo, if available.
1064 "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.
1065 {
1066 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
1067 # - organizer
1068 # - fileOrganizer
1069 # - writer
1070 # - commenter
1071 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -07001072 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001073 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
1074 # - file
1075 # - member
1076 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
1077 },
1078 ],
1079 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
1080 # - They can only be set on user and group permissions
1081 # - The time must be in the future
1082 # - The time cannot be more than a year in the future
1083 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
1084 # - owner
1085 # - organizer
1086 # - fileOrganizer
1087 # - writer
1088 # - commenter
1089 # - reader
1090 "type": "A String", # The type of the grantee. Valid values are:
1091 # - user
1092 # - group
1093 # - domain
Dan O'Mearadd494642020-05-01 07:42:23 -07001094 # - 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.
1095 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001096 },
1097 ],
1098 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001099 }</pre>
1100</div>
1101
1102<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001103 <code class="details" id="delete">delete(fileId, supportsTeamDrives=None, supportsAllDrives=None)</code>
1104 <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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001105
1106Args:
1107 fileId: string, The ID of the file. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001108 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
1109 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001110</pre>
1111</div>
1112
1113<div class="method">
1114 <code class="details" id="emptyTrash">emptyTrash()</code>
1115 <pre>Permanently deletes all of the user's trashed files.
1116
1117Args:
1118</pre>
1119</div>
1120
1121<div class="method">
1122 <code class="details" id="export">export(fileId, mimeType)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001123 <pre>Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001124
1125Args:
1126 fileId: string, The ID of the file. (required)
1127 mimeType: string, The MIME type of the format requested for this export. (required)
1128</pre>
1129</div>
1130
1131<div class="method">
1132 <code class="details" id="export_media">export_media(fileId, mimeType)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001133 <pre>Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001134
1135Args:
1136 fileId: string, The ID of the file. (required)
1137 mimeType: string, The MIME type of the format requested for this export. (required)
1138</pre>
1139</div>
1140
1141<div class="method">
1142 <code class="details" id="generateIds">generateIds(count=None, space=None)</code>
Dan O'Mearadd494642020-05-01 07:42:23 -07001143 <pre>Generates a set of file IDs which can be provided in create or copy requests.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001144
1145Args:
1146 count: integer, The number of IDs to return.
1147 space: string, The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.
1148
1149Returns:
1150 An object of the form:
1151
1152 { # A list of generated file IDs which can be provided in create requests.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001153 "kind": "drive#generatedIds", # Identifies what kind of resource this is. Value: the fixed string "drive#generatedIds".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001154 "ids": [ # The IDs generated for the requesting user in the specified space.
1155 "A String",
1156 ],
1157 "space": "A String", # The type of file that can be created with these IDs.
1158 }</pre>
1159</div>
1160
1161<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001162 <code class="details" id="get">get(fileId, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001163 <pre>Gets a file's metadata or content by ID.
1164
1165Args:
1166 fileId: string, The ID of the file. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001167 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
1168 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001169 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
1170
1171Returns:
1172 An object of the form:
1173
1174 { # The metadata for a file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001175 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001176 "mimeType": "A String", # The MIME type of the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001177 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001178 # 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.
1179 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001180 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001181 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001182 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001183 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001184 "teamDriveId": "A String", # Deprecated - use driveId instead.
1185 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.
1186 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001187 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1188 "id": "A String", # The ID of the file.
1189 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1190 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001191 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001192 "displayName": "A String", # A plain text displayable name for this user.
1193 "permissionId": "A String", # The user's ID as visible in Permission resources.
1194 "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.
1195 "photoLink": "A String", # A link to the user's profile photo, if available.
1196 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001197 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut.
1198 "targetId": "A String", # The ID of the file that this shortcut points to.
1199 "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.
1200 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001201 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001202 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1203 "width": 42, # The width of the video in pixels.
1204 "durationMillis": "A String", # The duration of the video in milliseconds.
1205 "height": 42, # The height of the video in pixels.
1206 },
1207 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
1208 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001209 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001210 "displayName": "A String", # A plain text displayable name for this user.
1211 "permissionId": "A String", # The user's ID as visible in Permission resources.
1212 "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.
1213 "photoLink": "A String", # A link to the user's profile photo, if available.
1214 },
1215 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
1216 # If an unsupported color is specified, the closest color in the palette will be used instead.
1217 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
1218 # Entries with null values are cleared in update and copy requests.
1219 "a_key": "A String",
1220 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001221 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
1222 "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.
1223 "canUntrash": True or False, # Whether the current user can restore this file from trash.
1224 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead.
1225 "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.
1226 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead.
1227 "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.
1228 "canRename": True or False, # Whether the current user can rename this file.
Dan O'Mearadd494642020-05-01 07:42:23 -07001229 "canModifyContent": True or False, # Whether the current user can modify the content of this file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001230 "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.
1231 "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.
1232 "canShare": True or False, # Whether the current user can modify the sharing settings for this file.
1233 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -07001234 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001235 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives.
1236 "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.
1237 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives.
1238 "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.
1239 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
1240 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
1241 "canComment": True or False, # Whether the current user can comment on this file.
1242 "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.
1243 "canChangeViewersCanCopyContent": True or False, # Deprecated
1244 "canTrash": True or False, # Whether the current user can move this file to trash.
Dan O'Mearadd494642020-05-01 07:42:23 -07001245 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001246 "canDelete": True or False, # Whether the current user can delete this file.
1247 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead.
1248 "canDownload": True or False, # Whether the current user can download this file.
1249 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file.
1250 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead.
1251 "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.
1252 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead.
Dan O'Mearadd494642020-05-01 07:42:23 -07001253 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001254 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001255 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001256 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
1257 "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.
1258 "parents": [ # The IDs of the parent folders which contain the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001259 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001260 "A String",
1261 ],
1262 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001263 "exportLinks": { # Links for exporting Google Docs to specific formats.
1264 "a_key": "A String", # A mapping from export format to URL
1265 },
1266 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives.
1267 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
1268 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001269 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001270 "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.
1271 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001272 "description": "A String", # A short description of the file.
1273 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
1274 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
1275 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001276 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001277 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001278 { # Information about a Drive user.
1279 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001280 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001281 "displayName": "A String", # A plain text displayable name for this user.
1282 "permissionId": "A String", # The user's ID as visible in Permission resources.
1283 "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.
1284 "photoLink": "A String", # A link to the user's profile photo, if available.
1285 },
1286 ],
1287 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
1288 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001289 "starred": True or False, # Whether the user has starred the file.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001290 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
1291 # Entries with null values are cleared in update and copy requests.
1292 "a_key": "A String",
1293 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001294 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001295 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
1296 "imageMediaMetadata": { # Additional metadata about image media, if available.
1297 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1298 "exposureTime": 3.14, # The length of the exposure, in seconds.
1299 "cameraMake": "A String", # The make of the camera used to create the photo.
1300 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1301 "width": 42, # The width of the image in pixels.
1302 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1303 "exposureMode": "A String", # The exposure mode used to create the photo.
1304 "colorSpace": "A String", # The color space of the photo.
1305 "location": { # Geographic location information stored in the image.
1306 "latitude": 3.14, # The latitude stored in the image.
1307 "altitude": 3.14, # The altitude stored in the image.
1308 "longitude": 3.14, # The longitude stored in the image.
1309 },
1310 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1311 "height": 42, # The height of the image in pixels.
1312 "lens": "A String", # The lens used to create the photo.
1313 "isoSpeed": 42, # The ISO speed used to create the photo.
1314 "meteringMode": "A String", # The metering mode used to create the photo.
1315 "flashUsed": True or False, # Whether a flash was used to create the photo.
1316 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1317 "aperture": 3.14, # The aperture used to create the photo (f-number).
Dan O'Mearadd494642020-05-01 07:42:23 -07001318 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001319 "sensor": "A String", # The type of sensor used to create the photo.
1320 "whiteBalance": "A String", # The white balance mode used to create the photo.
1321 "cameraModel": "A String", # The model of the camera used to create the photo.
1322 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001323 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001324 "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.
1325 "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.
1326 "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.
1327 "me": True or False, # Whether this user is the requesting user.
1328 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
1329 "displayName": "A String", # A plain text displayable name for this user.
1330 "permissionId": "A String", # The user's ID as visible in Permission resources.
1331 "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.
1332 "photoLink": "A String", # A link to the user's profile photo, if available.
1333 },
1334 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001335 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1336 "A String",
1337 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001338 "permissionIds": [ # List of permission IDs for users with access to this file.
1339 "A String",
1340 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001341 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
1342 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1343 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001344 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001345 "mimeType": "A String", # The MIME type of the thumbnail.
1346 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1347 },
1348 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001349 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive.
Dan O'Mearadd494642020-05-01 07:42:23 -07001350 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001351 "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.
1352 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1353 "domain": "A String", # The domain to which this permission refers.
Dan O'Mearadd494642020-05-01 07:42:23 -07001354 "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission:
1355 # - user - User's full name, as defined for their Google account, such as "Joe Smith."
1356 # - group - Name of the Google Group, such as "The Company Administrators."
1357 # - domain - String domain name, such as "thecompany.com."
1358 # - anyone - No displayName is present.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001359 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
1360 {
1361 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
1362 "role": "A String", # Deprecated - use permissionDetails/role instead.
1363 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
1364 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
1365 },
1366 ],
1367 "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.
1368 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
1369 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
1370 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1371 "photoLink": "A String", # A link to the user's profile photo, if available.
1372 "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.
1373 {
1374 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
1375 # - organizer
1376 # - fileOrganizer
1377 # - writer
1378 # - commenter
1379 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -07001380 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001381 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
1382 # - file
1383 # - member
1384 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
1385 },
1386 ],
1387 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
1388 # - They can only be set on user and group permissions
1389 # - The time must be in the future
1390 # - The time cannot be more than a year in the future
1391 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
1392 # - owner
1393 # - organizer
1394 # - fileOrganizer
1395 # - writer
1396 # - commenter
1397 # - reader
1398 "type": "A String", # The type of the grantee. Valid values are:
1399 # - user
1400 # - group
1401 # - domain
Dan O'Mearadd494642020-05-01 07:42:23 -07001402 # - 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.
1403 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001404 },
1405 ],
1406 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001407 }</pre>
1408</div>
1409
1410<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001411 <code class="details" id="get_media">get_media(fileId, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001412 <pre>Gets a file's metadata or content by ID.
1413
1414Args:
1415 fileId: string, The ID of the file. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001416 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
1417 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001418 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
1419
1420Returns:
1421 The media object as a string.
1422
1423 </pre>
1424</div>
1425
1426<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001427 <code class="details" id="list">list(orderBy=None, pageSize=None, supportsTeamDrives=None, spaces=None, q=None, pageToken=None, corpus=None, teamDriveId=None, includeItemsFromAllDrives=None, includeTeamDriveItems=None, corpora=None, supportsAllDrives=None, driveId=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001428 <pre>Lists or searches files.
1429
1430Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001431 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.
1432 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.
1433 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001434 spaces: string, A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001435 q: string, A query for filtering the file results. See the "Search for Files" guide for supported syntax.
1436 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.
1437 corpus: string, The source of files to list. Deprecated: use 'corpora' instead.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001438 Allowed values
1439 domain - Files shared to the user's domain.
1440 user - Files owned by or shared to the user.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001441 teamDriveId: string, Deprecated use driveId instead.
Dan O'Mearadd494642020-05-01 07:42:23 -07001442 includeItemsFromAllDrives: boolean, Deprecated - Whether both My Drive and shared drive items should be included in results. This parameter will only be effective until June 1, 2020. Afterwards shared drive items are included in the results.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001443 includeTeamDriveItems: boolean, Deprecated use includeItemsFromAllDrives instead.
1444 corpora: string, Bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'drive' and 'allDrives'. Prefer 'user' or 'drive' to 'allDrives' for efficiency.
1445 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
1446 driveId: string, ID of the shared drive to search.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001447
1448Returns:
1449 An object of the form:
1450
1451 { # A list of files.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001452 "files": [ # The list of files. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001453 { # The metadata for a file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001454 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001455 "mimeType": "A String", # The MIME type of the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001456 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001457 # 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.
1458 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001459 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001460 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001461 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001462 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001463 "teamDriveId": "A String", # Deprecated - use driveId instead.
1464 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.
1465 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001466 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1467 "id": "A String", # The ID of the file.
1468 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1469 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001470 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001471 "displayName": "A String", # A plain text displayable name for this user.
1472 "permissionId": "A String", # The user's ID as visible in Permission resources.
1473 "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.
1474 "photoLink": "A String", # A link to the user's profile photo, if available.
1475 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001476 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut.
1477 "targetId": "A String", # The ID of the file that this shortcut points to.
1478 "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.
1479 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001480 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001481 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1482 "width": 42, # The width of the video in pixels.
1483 "durationMillis": "A String", # The duration of the video in milliseconds.
1484 "height": 42, # The height of the video in pixels.
1485 },
1486 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
1487 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001488 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001489 "displayName": "A String", # A plain text displayable name for this user.
1490 "permissionId": "A String", # The user's ID as visible in Permission resources.
1491 "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.
1492 "photoLink": "A String", # A link to the user's profile photo, if available.
1493 },
1494 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
1495 # If an unsupported color is specified, the closest color in the palette will be used instead.
1496 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
1497 # Entries with null values are cleared in update and copy requests.
1498 "a_key": "A String",
1499 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001500 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
1501 "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.
1502 "canUntrash": True or False, # Whether the current user can restore this file from trash.
1503 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead.
1504 "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.
1505 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead.
1506 "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.
1507 "canRename": True or False, # Whether the current user can rename this file.
Dan O'Mearadd494642020-05-01 07:42:23 -07001508 "canModifyContent": True or False, # Whether the current user can modify the content of this file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001509 "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.
1510 "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.
1511 "canShare": True or False, # Whether the current user can modify the sharing settings for this file.
1512 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -07001513 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001514 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives.
1515 "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.
1516 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives.
1517 "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.
1518 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
1519 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
1520 "canComment": True or False, # Whether the current user can comment on this file.
1521 "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.
1522 "canChangeViewersCanCopyContent": True or False, # Deprecated
1523 "canTrash": True or False, # Whether the current user can move this file to trash.
Dan O'Mearadd494642020-05-01 07:42:23 -07001524 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001525 "canDelete": True or False, # Whether the current user can delete this file.
1526 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead.
1527 "canDownload": True or False, # Whether the current user can download this file.
1528 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file.
1529 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead.
1530 "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.
1531 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead.
Dan O'Mearadd494642020-05-01 07:42:23 -07001532 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001533 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001534 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001535 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
1536 "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.
1537 "parents": [ # The IDs of the parent folders which contain the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001538 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001539 "A String",
1540 ],
1541 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001542 "exportLinks": { # Links for exporting Google Docs to specific formats.
1543 "a_key": "A String", # A mapping from export format to URL
1544 },
1545 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives.
1546 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
1547 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001548 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001549 "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.
1550 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001551 "description": "A String", # A short description of the file.
1552 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
1553 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
1554 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001555 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001556 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001557 { # Information about a Drive user.
1558 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001559 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001560 "displayName": "A String", # A plain text displayable name for this user.
1561 "permissionId": "A String", # The user's ID as visible in Permission resources.
1562 "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.
1563 "photoLink": "A String", # A link to the user's profile photo, if available.
1564 },
1565 ],
1566 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
1567 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001568 "starred": True or False, # Whether the user has starred the file.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001569 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
1570 # Entries with null values are cleared in update and copy requests.
1571 "a_key": "A String",
1572 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001573 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001574 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
1575 "imageMediaMetadata": { # Additional metadata about image media, if available.
1576 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1577 "exposureTime": 3.14, # The length of the exposure, in seconds.
1578 "cameraMake": "A String", # The make of the camera used to create the photo.
1579 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1580 "width": 42, # The width of the image in pixels.
1581 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1582 "exposureMode": "A String", # The exposure mode used to create the photo.
1583 "colorSpace": "A String", # The color space of the photo.
1584 "location": { # Geographic location information stored in the image.
1585 "latitude": 3.14, # The latitude stored in the image.
1586 "altitude": 3.14, # The altitude stored in the image.
1587 "longitude": 3.14, # The longitude stored in the image.
1588 },
1589 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1590 "height": 42, # The height of the image in pixels.
1591 "lens": "A String", # The lens used to create the photo.
1592 "isoSpeed": 42, # The ISO speed used to create the photo.
1593 "meteringMode": "A String", # The metering mode used to create the photo.
1594 "flashUsed": True or False, # Whether a flash was used to create the photo.
1595 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1596 "aperture": 3.14, # The aperture used to create the photo (f-number).
Dan O'Mearadd494642020-05-01 07:42:23 -07001597 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001598 "sensor": "A String", # The type of sensor used to create the photo.
1599 "whiteBalance": "A String", # The white balance mode used to create the photo.
1600 "cameraModel": "A String", # The model of the camera used to create the photo.
1601 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001602 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001603 "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.
1604 "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.
1605 "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.
1606 "me": True or False, # Whether this user is the requesting user.
1607 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
1608 "displayName": "A String", # A plain text displayable name for this user.
1609 "permissionId": "A String", # The user's ID as visible in Permission resources.
1610 "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.
1611 "photoLink": "A String", # A link to the user's profile photo, if available.
1612 },
1613 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001614 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1615 "A String",
1616 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001617 "permissionIds": [ # List of permission IDs for users with access to this file.
1618 "A String",
1619 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001620 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
1621 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1622 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001623 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001624 "mimeType": "A String", # The MIME type of the thumbnail.
1625 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1626 },
1627 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001628 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive.
Dan O'Mearadd494642020-05-01 07:42:23 -07001629 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001630 "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.
1631 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1632 "domain": "A String", # The domain to which this permission refers.
Dan O'Mearadd494642020-05-01 07:42:23 -07001633 "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission:
1634 # - user - User's full name, as defined for their Google account, such as "Joe Smith."
1635 # - group - Name of the Google Group, such as "The Company Administrators."
1636 # - domain - String domain name, such as "thecompany.com."
1637 # - anyone - No displayName is present.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001638 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
1639 {
1640 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
1641 "role": "A String", # Deprecated - use permissionDetails/role instead.
1642 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
1643 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
1644 },
1645 ],
1646 "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.
1647 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
1648 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
1649 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1650 "photoLink": "A String", # A link to the user's profile photo, if available.
1651 "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.
1652 {
1653 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
1654 # - organizer
1655 # - fileOrganizer
1656 # - writer
1657 # - commenter
1658 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -07001659 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001660 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
1661 # - file
1662 # - member
1663 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
1664 },
1665 ],
1666 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
1667 # - They can only be set on user and group permissions
1668 # - The time must be in the future
1669 # - The time cannot be more than a year in the future
1670 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
1671 # - owner
1672 # - organizer
1673 # - fileOrganizer
1674 # - writer
1675 # - commenter
1676 # - reader
1677 "type": "A String", # The type of the grantee. Valid values are:
1678 # - user
1679 # - group
1680 # - domain
Dan O'Mearadd494642020-05-01 07:42:23 -07001681 # - 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.
1682 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001683 },
1684 ],
1685 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001686 },
1687 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001688 "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".
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001689 "kind": "drive#fileList", # Identifies what kind of resource this is. Value: the fixed string "drive#fileList".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001690 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001691 }</pre>
1692</div>
1693
1694<div class="method">
1695 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1696 <pre>Retrieves the next page of results.
1697
1698Args:
1699 previous_request: The request for the previous page. (required)
1700 previous_response: The response from the request for the previous page. (required)
1701
1702Returns:
1703 A request object that you can call 'execute()' on to request the next
1704 page. Returns None if there are no more items in the collection.
1705 </pre>
1706</div>
1707
1708<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001709 <code class="details" id="update">update(fileId, body=None, keepRevisionForever=None, removeParents=None, supportsTeamDrives=None, media_body=None, ocrLanguage=None, addParents=None, enforceSingleParent=None, useContentAsIndexableText=None, supportsAllDrives=None, media_mime_type=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001710 <pre>Updates a file's metadata and/or content with patch semantics.
1711
1712Args:
1713 fileId: string, The ID of the file. (required)
1714 body: object, The request body.
1715 The object takes the form of:
1716
1717{ # The metadata for a file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001718 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001719 "mimeType": "A String", # The MIME type of the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001720 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001721 # 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.
1722 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001723 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001724 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001725 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001726 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001727 "teamDriveId": "A String", # Deprecated - use driveId instead.
1728 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.
1729 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001730 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1731 "id": "A String", # The ID of the file.
1732 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1733 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001734 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001735 "displayName": "A String", # A plain text displayable name for this user.
1736 "permissionId": "A String", # The user's ID as visible in Permission resources.
1737 "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.
1738 "photoLink": "A String", # A link to the user's profile photo, if available.
1739 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001740 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut.
1741 "targetId": "A String", # The ID of the file that this shortcut points to.
1742 "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.
1743 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001744 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001745 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1746 "width": 42, # The width of the video in pixels.
1747 "durationMillis": "A String", # The duration of the video in milliseconds.
1748 "height": 42, # The height of the video in pixels.
1749 },
1750 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
1751 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001752 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001753 "displayName": "A String", # A plain text displayable name for this user.
1754 "permissionId": "A String", # The user's ID as visible in Permission resources.
1755 "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.
1756 "photoLink": "A String", # A link to the user's profile photo, if available.
1757 },
1758 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
1759 # If an unsupported color is specified, the closest color in the palette will be used instead.
1760 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
1761 # Entries with null values are cleared in update and copy requests.
1762 "a_key": "A String",
1763 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001764 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
1765 "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.
1766 "canUntrash": True or False, # Whether the current user can restore this file from trash.
1767 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead.
1768 "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.
1769 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead.
1770 "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.
1771 "canRename": True or False, # Whether the current user can rename this file.
Dan O'Mearadd494642020-05-01 07:42:23 -07001772 "canModifyContent": True or False, # Whether the current user can modify the content of this file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001773 "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.
1774 "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.
1775 "canShare": True or False, # Whether the current user can modify the sharing settings for this file.
1776 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -07001777 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001778 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives.
1779 "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.
1780 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives.
1781 "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.
1782 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
1783 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
1784 "canComment": True or False, # Whether the current user can comment on this file.
1785 "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.
1786 "canChangeViewersCanCopyContent": True or False, # Deprecated
1787 "canTrash": True or False, # Whether the current user can move this file to trash.
Dan O'Mearadd494642020-05-01 07:42:23 -07001788 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001789 "canDelete": True or False, # Whether the current user can delete this file.
1790 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead.
1791 "canDownload": True or False, # Whether the current user can download this file.
1792 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file.
1793 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead.
1794 "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.
1795 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead.
Dan O'Mearadd494642020-05-01 07:42:23 -07001796 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001797 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001798 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001799 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
1800 "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.
1801 "parents": [ # The IDs of the parent folders which contain the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001802 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001803 "A String",
1804 ],
1805 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001806 "exportLinks": { # Links for exporting Google Docs to specific formats.
1807 "a_key": "A String", # A mapping from export format to URL
1808 },
1809 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives.
1810 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
1811 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001812 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001813 "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.
1814 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001815 "description": "A String", # A short description of the file.
1816 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
1817 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
1818 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001819 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001820 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001821 { # Information about a Drive user.
1822 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001823 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001824 "displayName": "A String", # A plain text displayable name for this user.
1825 "permissionId": "A String", # The user's ID as visible in Permission resources.
1826 "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.
1827 "photoLink": "A String", # A link to the user's profile photo, if available.
1828 },
1829 ],
1830 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
1831 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001832 "starred": True or False, # Whether the user has starred the file.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001833 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
1834 # Entries with null values are cleared in update and copy requests.
1835 "a_key": "A String",
1836 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001837 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001838 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
1839 "imageMediaMetadata": { # Additional metadata about image media, if available.
1840 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1841 "exposureTime": 3.14, # The length of the exposure, in seconds.
1842 "cameraMake": "A String", # The make of the camera used to create the photo.
1843 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1844 "width": 42, # The width of the image in pixels.
1845 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1846 "exposureMode": "A String", # The exposure mode used to create the photo.
1847 "colorSpace": "A String", # The color space of the photo.
1848 "location": { # Geographic location information stored in the image.
1849 "latitude": 3.14, # The latitude stored in the image.
1850 "altitude": 3.14, # The altitude stored in the image.
1851 "longitude": 3.14, # The longitude stored in the image.
1852 },
1853 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1854 "height": 42, # The height of the image in pixels.
1855 "lens": "A String", # The lens used to create the photo.
1856 "isoSpeed": 42, # The ISO speed used to create the photo.
1857 "meteringMode": "A String", # The metering mode used to create the photo.
1858 "flashUsed": True or False, # Whether a flash was used to create the photo.
1859 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1860 "aperture": 3.14, # The aperture used to create the photo (f-number).
Dan O'Mearadd494642020-05-01 07:42:23 -07001861 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001862 "sensor": "A String", # The type of sensor used to create the photo.
1863 "whiteBalance": "A String", # The white balance mode used to create the photo.
1864 "cameraModel": "A String", # The model of the camera used to create the photo.
1865 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001866 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001867 "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.
1868 "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.
1869 "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.
1870 "me": True or False, # Whether this user is the requesting user.
1871 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
1872 "displayName": "A String", # A plain text displayable name for this user.
1873 "permissionId": "A String", # The user's ID as visible in Permission resources.
1874 "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.
1875 "photoLink": "A String", # A link to the user's profile photo, if available.
1876 },
1877 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001878 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1879 "A String",
1880 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001881 "permissionIds": [ # List of permission IDs for users with access to this file.
1882 "A String",
1883 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001884 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
1885 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1886 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001887 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001888 "mimeType": "A String", # The MIME type of the thumbnail.
1889 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1890 },
1891 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001892 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive.
Dan O'Mearadd494642020-05-01 07:42:23 -07001893 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001894 "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.
1895 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1896 "domain": "A String", # The domain to which this permission refers.
Dan O'Mearadd494642020-05-01 07:42:23 -07001897 "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission:
1898 # - user - User's full name, as defined for their Google account, such as "Joe Smith."
1899 # - group - Name of the Google Group, such as "The Company Administrators."
1900 # - domain - String domain name, such as "thecompany.com."
1901 # - anyone - No displayName is present.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001902 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
1903 {
1904 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
1905 "role": "A String", # Deprecated - use permissionDetails/role instead.
1906 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
1907 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
1908 },
1909 ],
1910 "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.
1911 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
1912 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
1913 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1914 "photoLink": "A String", # A link to the user's profile photo, if available.
1915 "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.
1916 {
1917 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
1918 # - organizer
1919 # - fileOrganizer
1920 # - writer
1921 # - commenter
1922 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -07001923 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001924 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
1925 # - file
1926 # - member
1927 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
1928 },
1929 ],
1930 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
1931 # - They can only be set on user and group permissions
1932 # - The time must be in the future
1933 # - The time cannot be more than a year in the future
1934 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
1935 # - owner
1936 # - organizer
1937 # - fileOrganizer
1938 # - writer
1939 # - commenter
1940 # - reader
1941 "type": "A String", # The type of the grantee. Valid values are:
1942 # - user
1943 # - group
1944 # - domain
Dan O'Mearadd494642020-05-01 07:42:23 -07001945 # - 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.
1946 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001947 },
1948 ],
1949 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001950}
1951
Dan O'Mearadd494642020-05-01 07:42:23 -07001952 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001953 removeParents: string, A comma-separated list of parent IDs to remove.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001954 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
1955 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001956 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001957 addParents: string, A comma-separated list of parent IDs to add.
Dan O'Mearadd494642020-05-01 07:42:23 -07001958 enforceSingleParent: boolean, Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. If the item's owner makes a request to add a single parent, the item is removed from all current folders and placed in the requested folder. Other requests that increase the number of parents fail, except when the canAddMyDriveParent file capability is true and a single parent is being added.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001959 useContentAsIndexableText: boolean, Whether to use the uploaded content as indexable text.
1960 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
1961 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001962
1963Returns:
1964 An object of the form:
1965
1966 { # The metadata for a file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001967 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001968 "mimeType": "A String", # The MIME type of the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001969 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001970 # 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.
1971 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001972 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001973 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001974 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001975 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001976 "teamDriveId": "A String", # Deprecated - use driveId instead.
1977 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.
1978 "ownedByMe": True or False, # Whether the user owns the file. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001979 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1980 "id": "A String", # The ID of the file.
1981 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1982 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001983 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001984 "displayName": "A String", # A plain text displayable name for this user.
1985 "permissionId": "A String", # The user's ID as visible in Permission resources.
1986 "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.
1987 "photoLink": "A String", # A link to the user's profile photo, if available.
1988 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001989 "shortcutDetails": { # Shortcut file details. Only populated for shortcut files, which have the mimeType field set to application/vnd.google-apps.shortcut.
1990 "targetId": "A String", # The ID of the file that this shortcut points to.
1991 "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.
1992 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001993 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001994 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1995 "width": 42, # The width of the video in pixels.
1996 "durationMillis": "A String", # The duration of the video in milliseconds.
1997 "height": 42, # The height of the video in pixels.
1998 },
1999 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
2000 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07002001 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002002 "displayName": "A String", # A plain text displayable name for this user.
2003 "permissionId": "A String", # The user's ID as visible in Permission resources.
2004 "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.
2005 "photoLink": "A String", # A link to the user's profile photo, if available.
2006 },
2007 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
2008 # If an unsupported color is specified, the closest color in the palette will be used instead.
2009 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
2010 # Entries with null values are cleared in update and copy requests.
2011 "a_key": "A String",
2012 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002013 "capabilities": { # Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take.
2014 "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.
2015 "canUntrash": True or False, # Whether the current user can restore this file from trash.
2016 "canMoveItemWithinTeamDrive": True or False, # Deprecated - use canMoveItemWithinDrive instead.
2017 "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.
2018 "canMoveChildrenWithinTeamDrive": True or False, # Deprecated - use canMoveChildrenWithinDrive instead.
2019 "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.
2020 "canRename": True or False, # Whether the current user can rename this file.
Dan O'Mearadd494642020-05-01 07:42:23 -07002021 "canModifyContent": True or False, # Whether the current user can modify the content of this file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002022 "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.
2023 "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.
2024 "canShare": True or False, # Whether the current user can modify the sharing settings for this file.
2025 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -07002026 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002027 "canMoveChildrenWithinDrive": True or False, # Whether the current user can move children of this folder within the shared drive. This is false when the item is not a folder. Only populated for items in shared drives.
2028 "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.
2029 "canMoveItemWithinDrive": True or False, # Whether the current user can move this item within this shared drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added. Only populated for items in shared drives.
2030 "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.
2031 "canMoveItemIntoTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
2032 "canMoveItemOutOfTeamDrive": True or False, # Deprecated - use canMoveItemOutOfDrive instead.
2033 "canComment": True or False, # Whether the current user can comment on this file.
2034 "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.
2035 "canChangeViewersCanCopyContent": True or False, # Deprecated
2036 "canTrash": True or False, # Whether the current user can move this file to trash.
Dan O'Mearadd494642020-05-01 07:42:23 -07002037 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002038 "canDelete": True or False, # Whether the current user can delete this file.
2039 "canMoveTeamDriveItem": True or False, # Deprecated - use canMoveItemWithinDrive or canMoveItemOutOfDrive instead.
2040 "canDownload": True or False, # Whether the current user can download this file.
2041 "canChangeCopyRequiresWriterPermission": True or False, # Whether the current user can change the copyRequiresWriterPermission restriction of this file.
2042 "canMoveChildrenOutOfTeamDrive": True or False, # Deprecated - use canMoveChildrenOutOfDrive instead.
2043 "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.
2044 "canReadTeamDrive": True or False, # Deprecated - use canReadDrive instead.
Dan O'Mearadd494642020-05-01 07:42:23 -07002045 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002046 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002047 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002048 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
2049 "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.
2050 "parents": [ # The IDs of the parent folders which contain the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002051 # 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002052 "A String",
2053 ],
2054 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002055 "exportLinks": { # Links for exporting Google Docs to specific formats.
2056 "a_key": "A String", # A mapping from export format to URL
2057 },
2058 "shared": True or False, # Whether the file has been shared. Not populated for items in shared drives.
2059 "copyRequiresWriterPermission": True or False, # Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
2060 "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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002061 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002062 "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.
2063 "viewersCanCopyContent": True or False, # Deprecated - use copyRequiresWriterPermission instead.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002064 "description": "A String", # A short description of the file.
2065 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
2066 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
2067 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002068 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002069 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002070 { # Information about a Drive user.
2071 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07002072 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002073 "displayName": "A String", # A plain text displayable name for this user.
2074 "permissionId": "A String", # The user's ID as visible in Permission resources.
2075 "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.
2076 "photoLink": "A String", # A link to the user's profile photo, if available.
2077 },
2078 ],
2079 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
2080 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002081 "starred": True or False, # Whether the user has starred the file.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002082 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
2083 # Entries with null values are cleared in update and copy requests.
2084 "a_key": "A String",
2085 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002086 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002087 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
2088 "imageMediaMetadata": { # Additional metadata about image media, if available.
2089 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2090 "exposureTime": 3.14, # The length of the exposure, in seconds.
2091 "cameraMake": "A String", # The make of the camera used to create the photo.
2092 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2093 "width": 42, # The width of the image in pixels.
2094 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2095 "exposureMode": "A String", # The exposure mode used to create the photo.
2096 "colorSpace": "A String", # The color space of the photo.
2097 "location": { # Geographic location information stored in the image.
2098 "latitude": 3.14, # The latitude stored in the image.
2099 "altitude": 3.14, # The altitude stored in the image.
2100 "longitude": 3.14, # The longitude stored in the image.
2101 },
2102 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2103 "height": 42, # The height of the image in pixels.
2104 "lens": "A String", # The lens used to create the photo.
2105 "isoSpeed": 42, # The ISO speed used to create the photo.
2106 "meteringMode": "A String", # The metering mode used to create the photo.
2107 "flashUsed": True or False, # Whether a flash was used to create the photo.
2108 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
2109 "aperture": 3.14, # The aperture used to create the photo (f-number).
Dan O'Mearadd494642020-05-01 07:42:23 -07002110 "rotation": 42, # The number of clockwise 90 degree rotations applied from the image's original orientation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002111 "sensor": "A String", # The type of sensor used to create the photo.
2112 "whiteBalance": "A String", # The white balance mode used to create the photo.
2113 "cameraModel": "A String", # The model of the camera used to create the photo.
2114 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07002115 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002116 "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.
2117 "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.
2118 "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.
2119 "me": True or False, # Whether this user is the requesting user.
2120 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
2121 "displayName": "A String", # A plain text displayable name for this user.
2122 "permissionId": "A String", # The user's ID as visible in Permission resources.
2123 "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.
2124 "photoLink": "A String", # A link to the user's profile photo, if available.
2125 },
2126 "driveId": "A String", # ID of the shared drive the file resides in. Only populated for items in shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002127 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
2128 "A String",
2129 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002130 "permissionIds": [ # List of permission IDs for users with access to this file.
2131 "A String",
2132 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002133 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
2134 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
2135 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002136 "thumbnail": { # A thumbnail for the file. This will only be used if Google Drive cannot generate a standard thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002137 "mimeType": "A String", # The MIME type of the thumbnail.
2138 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
2139 },
2140 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002141 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Google Drive.
Dan O'Mearadd494642020-05-01 07:42:23 -07002142 "hasAugmentedPermissions": True or False, # Whether there are permissions directly on this file. This field is only populated for items in shared drives.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002143 "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.
2144 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
2145 "domain": "A String", # The domain to which this permission refers.
Dan O'Mearadd494642020-05-01 07:42:23 -07002146 "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission:
2147 # - user - User's full name, as defined for their Google account, such as "Joe Smith."
2148 # - group - Name of the Google Group, such as "The Company Administrators."
2149 # - domain - String domain name, such as "thecompany.com."
2150 # - anyone - No displayName is present.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002151 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
2152 {
2153 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
2154 "role": "A String", # Deprecated - use permissionDetails/role instead.
2155 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
2156 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
2157 },
2158 ],
2159 "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.
2160 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
2161 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
2162 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
2163 "photoLink": "A String", # A link to the user's profile photo, if available.
2164 "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.
2165 {
2166 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
2167 # - organizer
2168 # - fileOrganizer
2169 # - writer
2170 # - commenter
2171 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -07002172 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002173 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
2174 # - file
2175 # - member
2176 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
2177 },
2178 ],
2179 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
2180 # - They can only be set on user and group permissions
2181 # - The time must be in the future
2182 # - The time cannot be more than a year in the future
2183 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
2184 # - owner
2185 # - organizer
2186 # - fileOrganizer
2187 # - writer
2188 # - commenter
2189 # - reader
2190 "type": "A String", # The type of the grantee. Valid values are:
2191 # - user
2192 # - group
2193 # - domain
Dan O'Mearadd494642020-05-01 07:42:23 -07002194 # - 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.
2195 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002196 },
2197 ],
2198 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Google Drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002199 }</pre>
2200</div>
2201
2202<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002203 <code class="details" id="watch">watch(fileId, body=None, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002204 <pre>Subscribes to changes to a file
2205
2206Args:
2207 fileId: string, The ID of the file. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002208 body: object, The request body.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002209 The object takes the form of:
2210
2211{ # An notification channel used to watch for resource changes.
2212 "resourceUri": "A String", # A version-specific identifier for the watched resource.
Dan O'Mearadd494642020-05-01 07:42:23 -07002213 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource, which is "api#channel".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002214 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
2215 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
2216 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
2217 "params": { # Additional parameters controlling delivery channel behavior. Optional.
2218 "a_key": "A String", # Declares a new parameter by name.
2219 },
2220 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
2221 "address": "A String", # The address where notifications are delivered for this channel.
2222 "type": "A String", # The type of delivery mechanism used for this channel.
2223 "id": "A String", # A UUID or similar unique string that identifies this channel.
2224 }
2225
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002226 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
2227 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002228 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
2229
2230Returns:
2231 An object of the form:
2232
2233 { # An notification channel used to watch for resource changes.
2234 "resourceUri": "A String", # A version-specific identifier for the watched resource.
Dan O'Mearadd494642020-05-01 07:42:23 -07002235 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource, which is "api#channel".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002236 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
2237 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
2238 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
2239 "params": { # Additional parameters controlling delivery channel behavior. Optional.
2240 "a_key": "A String", # Declares a new parameter by name.
2241 },
2242 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
2243 "address": "A String", # The address where notifications are delivered for this channel.
2244 "type": "A String", # The type of delivery mechanism used for this channel.
2245 "id": "A String", # A UUID or similar unique string that identifies this channel.
2246 }</pre>
2247</div>
2248
2249<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002250 <code class="details" id="watch_media">watch_media(fileId, body=None, supportsTeamDrives=None, supportsAllDrives=None, acknowledgeAbuse=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002251 <pre>Subscribes to changes to a file
2252
2253Args:
2254 fileId: string, The ID of the file. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002255 body: object, The request body.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002256 The object takes the form of:
2257
2258{ # An notification channel used to watch for resource changes.
2259 "resourceUri": "A String", # A version-specific identifier for the watched resource.
Dan O'Mearadd494642020-05-01 07:42:23 -07002260 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource, which is "api#channel".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002261 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
2262 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
2263 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
2264 "params": { # Additional parameters controlling delivery channel behavior. Optional.
2265 "a_key": "A String", # Declares a new parameter by name.
2266 },
2267 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
2268 "address": "A String", # The address where notifications are delivered for this channel.
2269 "type": "A String", # The type of delivery mechanism used for this channel.
2270 "id": "A String", # A UUID or similar unique string that identifies this channel.
2271 }
2272
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002273 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
2274 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08002275 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
2276
2277Returns:
2278 The media object as a string.
2279
2280 </pre>
2281</div>
2282
2283</body></html>