blob: e3ea11f1a42ee38b8cbfdcfd1561d368bc93cbd1 [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">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040078 <code><a href="#copy">copy(fileId, body, keepRevisionForever=None, supportsTeamDrives=None, ocrLanguage=None, ignoreDefaultVisibility=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">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040081 <code><a href="#create">create(body=None, media_body=None, keepRevisionForever=None, media_mime_type=None, useContentAsIndexableText=None, supportsTeamDrives=None, ocrLanguage=None, ignoreDefaultVisibility=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">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040084 <code><a href="#delete">delete(fileId, supportsTeamDrives=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 Team 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>
91<p class="firstline">Exports a Google Doc to the requested MIME type and returns the exported content.</p>
92<p class="toc_element">
93 <code><a href="#export_media">export_media(fileId, mimeType)</a></code></p>
94<p class="firstline">Exports a Google Doc to the requested MIME type and returns the exported content.</p>
95<p class="toc_element">
96 <code><a href="#generateIds">generateIds(count=None, space=None)</a></code></p>
97<p class="firstline">Generates a set of file IDs which can be provided in create requests.</p>
98<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040099 <code><a href="#get">get(fileId, supportsTeamDrives=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">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400102 <code><a href="#get_media">get_media(fileId, supportsTeamDrives=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">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400105 <code><a href="#list">list(orderBy=None, q=None, includeTeamDriveItems=None, pageSize=None, pageToken=None, corpora=None, supportsTeamDrives=None, spaces=None, teamDriveId=None, corpus=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">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400111 <code><a href="#update">update(fileId, body=None, media_body=None, addParents=None, removeParents=None, media_mime_type=None, useContentAsIndexableText=None, keepRevisionForever=None, supportsTeamDrives=None, ocrLanguage=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">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400114 <code><a href="#watch">watch(fileId, body, supportsTeamDrives=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">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400117 <code><a href="#watch_media">watch_media(fileId, body, supportsTeamDrives=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">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400121 <code class="details" id="copy">copy(fileId, body, keepRevisionForever=None, supportsTeamDrives=None, ocrLanguage=None, ignoreDefaultVisibility=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)
126 body: object, The request body. (required)
127 The object takes the form of:
128
129{ # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800130 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800131 "mimeType": "A String", # The MIME type of the file.
132 # Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded.
133 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.
134 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400136 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400139 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for Team Drive files.
140 "ownedByMe": True or False, # Whether the user owns the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800141 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
142 "id": "A String", # The ID of the file.
143 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
144 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700145 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800146 "displayName": "A String", # A plain text displayable name for this user.
147 "permissionId": "A String", # The user's ID as visible in Permission resources.
148 "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.
149 "photoLink": "A String", # A link to the user's profile photo, if available.
150 },
151 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
152 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
153 "width": 42, # The width of the video in pixels.
154 "durationMillis": "A String", # The duration of the video in milliseconds.
155 "height": 42, # The height of the video in pixels.
156 },
157 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
158 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700159 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800160 "displayName": "A String", # A plain text displayable name for this user.
161 "permissionId": "A String", # The user's ID as visible in Permission resources.
162 "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.
163 "photoLink": "A String", # A link to the user's profile photo, if available.
164 },
165 "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.
166 # If an unsupported color is specified, the closest color in the palette will be used instead.
167 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
168 # Entries with null values are cleared in update and copy requests.
169 "a_key": "A String",
170 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400171 "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
172 "canReadRevisions": True or False, # Whether the user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
173 "canTrash": True or False, # Whether the file can be trashed by the user.
174 "canCopy": True or False, # Whether the user can copy the file. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800175 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400176 "canDelete": True or False, # Whether the file can be deleted by the user.
177 "canMoveTeamDriveItem": True or False, # Whether the user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
178 "canRename": True or False, # Whether the file can be renamed by the user.
179 "canListChildren": True or False, # Whether the user can list the children of this folder. This is always false when the item is not a folder.
180 "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
181 "canDownload": True or False, # Whether the file can be downloaded by the user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800182 "canComment": True or False, # Whether the user can comment on the file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400183 "canRemoveChildren": True or False, # Whether the user can remove children from this folder. This is always false when the item is not a folder.
184 "canReadTeamDrive": True or False, # Whether the user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
185 "canAddChildren": True or False, # Whether the user can add children to this folder. This is always false when the item is not a folder.
186 "canEdit": True or False, # Whether the user can edit the file's content.
187 "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800188 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400189 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800190 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
191 "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.
192 "parents": [ # The IDs of the parent folders which contain the file.
193 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
194 "A String",
195 ],
196 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400197 "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
198 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800199 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
200 "domain": "A String", # The domain to which this permission refers.
201 "displayName": "A String", # A displayable name for users, groups or domains.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400202 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
203 {
204 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
205 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
206 # - organizer
207 # - writer
208 # - commenter
209 # - reader
210 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
211 # - file
212 # -
213 # - member
214 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
215 },
216 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800217 "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.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700218 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800219 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
220 "photoLink": "A String", # A link to the user's profile photo, if available.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400221 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
222 # - organizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800223 # - owner
224 # - writer
225 # - commenter
226 # - reader
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400227 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
228 # - They can only be set on user and group permissions
229 # - The time must be in the future
230 # - The time cannot be more than a year in the future
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800231 "type": "A String", # The type of the grantee. Valid values are:
232 # - user
233 # - group
234 # - domain
235 # - anyone
236 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
237 },
238 ],
239 "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 Drive.
240 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
241 "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 Drive.
242 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
243 "description": "A String", # A short description of the file.
244 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
245 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
246 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800247 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400248 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800249 { # Information about a Drive user.
250 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700251 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800252 "displayName": "A String", # A plain text displayable name for this user.
253 "permissionId": "A String", # The user's ID as visible in Permission resources.
254 "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.
255 "photoLink": "A String", # A link to the user's profile photo, if available.
256 },
257 ],
258 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
259 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400260 "teamDriveId": "A String", # ID of the Team Drive the file resides in.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800261 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
262 # Entries with null values are cleared in update and copy requests.
263 "a_key": "A String",
264 },
265 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
266 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
267 "imageMediaMetadata": { # Additional metadata about image media, if available.
268 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
269 "exposureTime": 3.14, # The length of the exposure, in seconds.
270 "cameraMake": "A String", # The make of the camera used to create the photo.
271 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
272 "width": 42, # The width of the image in pixels.
273 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
274 "exposureMode": "A String", # The exposure mode used to create the photo.
275 "colorSpace": "A String", # The color space of the photo.
276 "location": { # Geographic location information stored in the image.
277 "latitude": 3.14, # The latitude stored in the image.
278 "altitude": 3.14, # The altitude stored in the image.
279 "longitude": 3.14, # The longitude stored in the image.
280 },
281 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
282 "height": 42, # The height of the image in pixels.
283 "lens": "A String", # The lens used to create the photo.
284 "isoSpeed": 42, # The ISO speed used to create the photo.
285 "meteringMode": "A String", # The metering mode used to create the photo.
286 "flashUsed": True or False, # Whether a flash was used to create the photo.
287 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
288 "aperture": 3.14, # The aperture used to create the photo (f-number).
289 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
290 "sensor": "A String", # The type of sensor used to create the photo.
291 "whiteBalance": "A String", # The white balance mode used to create the photo.
292 "cameraModel": "A String", # The model of the camera used to create the photo.
293 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700294 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800295 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
296 "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 Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400297 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
298 "me": True or False, # Whether this user is the requesting user.
299 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
300 "displayName": "A String", # A plain text displayable name for this user.
301 "permissionId": "A String", # The user's ID as visible in Permission resources.
302 "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.
303 "photoLink": "A String", # A link to the user's profile photo, if available.
304 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800305 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
306 "A String",
307 ],
308 "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.
309 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
310 "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.
311 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
312 "mimeType": "A String", # The MIME type of the thumbnail.
313 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
314 },
315 },
316 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400317 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800318 "starred": True or False, # Whether the user has starred the file.
319 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
320}
321
322 keepRevisionForever: boolean, Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400323 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800324 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400325 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800326
327Returns:
328 An object of the form:
329
330 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800331 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800332 "mimeType": "A String", # The MIME type of the file.
333 # 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.
334 # 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.
335 "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 -0800336 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400337 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800338 "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 -0700339 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400340 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for Team Drive files.
341 "ownedByMe": True or False, # Whether the user owns the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800342 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
343 "id": "A String", # The ID of the file.
344 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
345 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700346 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800347 "displayName": "A String", # A plain text displayable name for this user.
348 "permissionId": "A String", # The user's ID as visible in Permission resources.
349 "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.
350 "photoLink": "A String", # A link to the user's profile photo, if available.
351 },
352 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
353 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
354 "width": 42, # The width of the video in pixels.
355 "durationMillis": "A String", # The duration of the video in milliseconds.
356 "height": 42, # The height of the video in pixels.
357 },
358 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
359 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700360 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800361 "displayName": "A String", # A plain text displayable name for this user.
362 "permissionId": "A String", # The user's ID as visible in Permission resources.
363 "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.
364 "photoLink": "A String", # A link to the user's profile photo, if available.
365 },
366 "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.
367 # If an unsupported color is specified, the closest color in the palette will be used instead.
368 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
369 # Entries with null values are cleared in update and copy requests.
370 "a_key": "A String",
371 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400372 "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
373 "canReadRevisions": True or False, # Whether the user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
374 "canTrash": True or False, # Whether the file can be trashed by the user.
375 "canCopy": True or False, # Whether the user can copy the file. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800376 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400377 "canDelete": True or False, # Whether the file can be deleted by the user.
378 "canMoveTeamDriveItem": True or False, # Whether the user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
379 "canRename": True or False, # Whether the file can be renamed by the user.
380 "canListChildren": True or False, # Whether the user can list the children of this folder. This is always false when the item is not a folder.
381 "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
382 "canDownload": True or False, # Whether the file can be downloaded by the user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800383 "canComment": True or False, # Whether the user can comment on the file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400384 "canRemoveChildren": True or False, # Whether the user can remove children from this folder. This is always false when the item is not a folder.
385 "canReadTeamDrive": True or False, # Whether the user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
386 "canAddChildren": True or False, # Whether the user can add children to this folder. This is always false when the item is not a folder.
387 "canEdit": True or False, # Whether the user can edit the file's content.
388 "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800389 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400390 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800391 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
392 "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.
393 "parents": [ # The IDs of the parent folders which contain the file.
394 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
395 "A String",
396 ],
397 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400398 "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
399 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800400 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
401 "domain": "A String", # The domain to which this permission refers.
402 "displayName": "A String", # A displayable name for users, groups or domains.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400403 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
404 {
405 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
406 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
407 # - organizer
408 # - writer
409 # - commenter
410 # - reader
411 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
412 # - file
413 # -
414 # - member
415 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
416 },
417 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800418 "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.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700419 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800420 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
421 "photoLink": "A String", # A link to the user's profile photo, if available.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400422 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
423 # - organizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800424 # - owner
425 # - writer
426 # - commenter
427 # - reader
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400428 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
429 # - They can only be set on user and group permissions
430 # - The time must be in the future
431 # - The time cannot be more than a year in the future
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800432 "type": "A String", # The type of the grantee. Valid values are:
433 # - user
434 # - group
435 # - domain
436 # - anyone
437 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
438 },
439 ],
440 "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 Drive.
441 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
442 "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 Drive.
443 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
444 "description": "A String", # A short description of the file.
445 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
446 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
447 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800448 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400449 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800450 { # Information about a Drive user.
451 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700452 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800453 "displayName": "A String", # A plain text displayable name for this user.
454 "permissionId": "A String", # The user's ID as visible in Permission resources.
455 "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.
456 "photoLink": "A String", # A link to the user's profile photo, if available.
457 },
458 ],
459 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
460 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400461 "teamDriveId": "A String", # ID of the Team Drive the file resides in.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800462 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
463 # Entries with null values are cleared in update and copy requests.
464 "a_key": "A String",
465 },
466 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
467 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
468 "imageMediaMetadata": { # Additional metadata about image media, if available.
469 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
470 "exposureTime": 3.14, # The length of the exposure, in seconds.
471 "cameraMake": "A String", # The make of the camera used to create the photo.
472 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
473 "width": 42, # The width of the image in pixels.
474 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
475 "exposureMode": "A String", # The exposure mode used to create the photo.
476 "colorSpace": "A String", # The color space of the photo.
477 "location": { # Geographic location information stored in the image.
478 "latitude": 3.14, # The latitude stored in the image.
479 "altitude": 3.14, # The altitude stored in the image.
480 "longitude": 3.14, # The longitude stored in the image.
481 },
482 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
483 "height": 42, # The height of the image in pixels.
484 "lens": "A String", # The lens used to create the photo.
485 "isoSpeed": 42, # The ISO speed used to create the photo.
486 "meteringMode": "A String", # The metering mode used to create the photo.
487 "flashUsed": True or False, # Whether a flash was used to create the photo.
488 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
489 "aperture": 3.14, # The aperture used to create the photo (f-number).
490 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
491 "sensor": "A String", # The type of sensor used to create the photo.
492 "whiteBalance": "A String", # The white balance mode used to create the photo.
493 "cameraModel": "A String", # The model of the camera used to create the photo.
494 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700495 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800496 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
497 "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 Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400498 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
499 "me": True or False, # Whether this user is the requesting user.
500 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
501 "displayName": "A String", # A plain text displayable name for this user.
502 "permissionId": "A String", # The user's ID as visible in Permission resources.
503 "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.
504 "photoLink": "A String", # A link to the user's profile photo, if available.
505 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800506 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
507 "A String",
508 ],
509 "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.
510 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
511 "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.
512 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
513 "mimeType": "A String", # The MIME type of the thumbnail.
514 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
515 },
516 },
517 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400518 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800519 "starred": True or False, # Whether the user has starred the file.
520 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
521 }</pre>
522</div>
523
524<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400525 <code class="details" id="create">create(body=None, media_body=None, keepRevisionForever=None, media_mime_type=None, useContentAsIndexableText=None, supportsTeamDrives=None, ocrLanguage=None, ignoreDefaultVisibility=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800526 <pre>Creates a new file.
527
528Args:
529 body: object, The request body.
530 The object takes the form of:
531
532{ # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800533 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800534 "mimeType": "A String", # The MIME type of the file.
535 # 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.
536 # 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.
537 "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 -0800538 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400539 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800540 "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 -0700541 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400542 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for Team Drive files.
543 "ownedByMe": True or False, # Whether the user owns the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800544 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
545 "id": "A String", # The ID of the file.
546 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
547 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700548 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800549 "displayName": "A String", # A plain text displayable name for this user.
550 "permissionId": "A String", # The user's ID as visible in Permission resources.
551 "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.
552 "photoLink": "A String", # A link to the user's profile photo, if available.
553 },
554 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
555 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
556 "width": 42, # The width of the video in pixels.
557 "durationMillis": "A String", # The duration of the video in milliseconds.
558 "height": 42, # The height of the video in pixels.
559 },
560 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
561 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700562 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800563 "displayName": "A String", # A plain text displayable name for this user.
564 "permissionId": "A String", # The user's ID as visible in Permission resources.
565 "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.
566 "photoLink": "A String", # A link to the user's profile photo, if available.
567 },
568 "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.
569 # If an unsupported color is specified, the closest color in the palette will be used instead.
570 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
571 # Entries with null values are cleared in update and copy requests.
572 "a_key": "A String",
573 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400574 "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
575 "canReadRevisions": True or False, # Whether the user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
576 "canTrash": True or False, # Whether the file can be trashed by the user.
577 "canCopy": True or False, # Whether the user can copy the file. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800578 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400579 "canDelete": True or False, # Whether the file can be deleted by the user.
580 "canMoveTeamDriveItem": True or False, # Whether the user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
581 "canRename": True or False, # Whether the file can be renamed by the user.
582 "canListChildren": True or False, # Whether the user can list the children of this folder. This is always false when the item is not a folder.
583 "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
584 "canDownload": True or False, # Whether the file can be downloaded by the user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800585 "canComment": True or False, # Whether the user can comment on the file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400586 "canRemoveChildren": True or False, # Whether the user can remove children from this folder. This is always false when the item is not a folder.
587 "canReadTeamDrive": True or False, # Whether the user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
588 "canAddChildren": True or False, # Whether the user can add children to this folder. This is always false when the item is not a folder.
589 "canEdit": True or False, # Whether the user can edit the file's content.
590 "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800591 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400592 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800593 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
594 "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.
595 "parents": [ # The IDs of the parent folders which contain the file.
596 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
597 "A String",
598 ],
599 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400600 "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
601 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800602 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
603 "domain": "A String", # The domain to which this permission refers.
604 "displayName": "A String", # A displayable name for users, groups or domains.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400605 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
606 {
607 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
608 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
609 # - organizer
610 # - writer
611 # - commenter
612 # - reader
613 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
614 # - file
615 # -
616 # - member
617 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
618 },
619 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800620 "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.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700621 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800622 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
623 "photoLink": "A String", # A link to the user's profile photo, if available.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400624 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
625 # - organizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800626 # - owner
627 # - writer
628 # - commenter
629 # - reader
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400630 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
631 # - They can only be set on user and group permissions
632 # - The time must be in the future
633 # - The time cannot be more than a year in the future
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800634 "type": "A String", # The type of the grantee. Valid values are:
635 # - user
636 # - group
637 # - domain
638 # - anyone
639 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
640 },
641 ],
642 "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 Drive.
643 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
644 "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 Drive.
645 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
646 "description": "A String", # A short description of the file.
647 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
648 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
649 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800650 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400651 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800652 { # Information about a Drive user.
653 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700654 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800655 "displayName": "A String", # A plain text displayable name for this user.
656 "permissionId": "A String", # The user's ID as visible in Permission resources.
657 "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.
658 "photoLink": "A String", # A link to the user's profile photo, if available.
659 },
660 ],
661 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
662 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400663 "teamDriveId": "A String", # ID of the Team Drive the file resides in.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800664 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
665 # Entries with null values are cleared in update and copy requests.
666 "a_key": "A String",
667 },
668 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
669 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
670 "imageMediaMetadata": { # Additional metadata about image media, if available.
671 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
672 "exposureTime": 3.14, # The length of the exposure, in seconds.
673 "cameraMake": "A String", # The make of the camera used to create the photo.
674 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
675 "width": 42, # The width of the image in pixels.
676 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
677 "exposureMode": "A String", # The exposure mode used to create the photo.
678 "colorSpace": "A String", # The color space of the photo.
679 "location": { # Geographic location information stored in the image.
680 "latitude": 3.14, # The latitude stored in the image.
681 "altitude": 3.14, # The altitude stored in the image.
682 "longitude": 3.14, # The longitude stored in the image.
683 },
684 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
685 "height": 42, # The height of the image in pixels.
686 "lens": "A String", # The lens used to create the photo.
687 "isoSpeed": 42, # The ISO speed used to create the photo.
688 "meteringMode": "A String", # The metering mode used to create the photo.
689 "flashUsed": True or False, # Whether a flash was used to create the photo.
690 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
691 "aperture": 3.14, # The aperture used to create the photo (f-number).
692 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
693 "sensor": "A String", # The type of sensor used to create the photo.
694 "whiteBalance": "A String", # The white balance mode used to create the photo.
695 "cameraModel": "A String", # The model of the camera used to create the photo.
696 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700697 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800698 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
699 "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 Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400700 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
701 "me": True or False, # Whether this user is the requesting user.
702 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
703 "displayName": "A String", # A plain text displayable name for this user.
704 "permissionId": "A String", # The user's ID as visible in Permission resources.
705 "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.
706 "photoLink": "A String", # A link to the user's profile photo, if available.
707 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800708 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
709 "A String",
710 ],
711 "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.
712 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
713 "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.
714 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
715 "mimeType": "A String", # The MIME type of the thumbnail.
716 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
717 },
718 },
719 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400720 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800721 "starred": True or False, # Whether the user has starred the file.
722 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
723}
724
725 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
726 keepRevisionForever: boolean, Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800727 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 -0800728 useContentAsIndexableText: boolean, Whether to use the uploaded content as indexable text.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400729 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800730 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400731 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800732
733Returns:
734 An object of the form:
735
736 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800737 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800738 "mimeType": "A String", # The MIME type of the file.
739 # 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.
740 # 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.
741 "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 -0800742 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400743 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800744 "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 -0700745 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400746 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for Team Drive files.
747 "ownedByMe": True or False, # Whether the user owns the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800748 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
749 "id": "A String", # The ID of the file.
750 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
751 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700752 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800753 "displayName": "A String", # A plain text displayable name for this user.
754 "permissionId": "A String", # The user's ID as visible in Permission resources.
755 "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.
756 "photoLink": "A String", # A link to the user's profile photo, if available.
757 },
758 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
759 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
760 "width": 42, # The width of the video in pixels.
761 "durationMillis": "A String", # The duration of the video in milliseconds.
762 "height": 42, # The height of the video in pixels.
763 },
764 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
765 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700766 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800767 "displayName": "A String", # A plain text displayable name for this user.
768 "permissionId": "A String", # The user's ID as visible in Permission resources.
769 "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.
770 "photoLink": "A String", # A link to the user's profile photo, if available.
771 },
772 "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.
773 # If an unsupported color is specified, the closest color in the palette will be used instead.
774 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
775 # Entries with null values are cleared in update and copy requests.
776 "a_key": "A String",
777 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400778 "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
779 "canReadRevisions": True or False, # Whether the user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
780 "canTrash": True or False, # Whether the file can be trashed by the user.
781 "canCopy": True or False, # Whether the user can copy the file. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800782 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400783 "canDelete": True or False, # Whether the file can be deleted by the user.
784 "canMoveTeamDriveItem": True or False, # Whether the user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
785 "canRename": True or False, # Whether the file can be renamed by the user.
786 "canListChildren": True or False, # Whether the user can list the children of this folder. This is always false when the item is not a folder.
787 "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
788 "canDownload": True or False, # Whether the file can be downloaded by the user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800789 "canComment": True or False, # Whether the user can comment on the file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400790 "canRemoveChildren": True or False, # Whether the user can remove children from this folder. This is always false when the item is not a folder.
791 "canReadTeamDrive": True or False, # Whether the user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
792 "canAddChildren": True or False, # Whether the user can add children to this folder. This is always false when the item is not a folder.
793 "canEdit": True or False, # Whether the user can edit the file's content.
794 "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800795 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400796 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800797 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
798 "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.
799 "parents": [ # The IDs of the parent folders which contain the file.
800 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
801 "A String",
802 ],
803 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400804 "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
805 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800806 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
807 "domain": "A String", # The domain to which this permission refers.
808 "displayName": "A String", # A displayable name for users, groups or domains.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400809 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
810 {
811 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
812 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
813 # - organizer
814 # - writer
815 # - commenter
816 # - reader
817 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
818 # - file
819 # -
820 # - member
821 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
822 },
823 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800824 "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.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700825 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800826 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
827 "photoLink": "A String", # A link to the user's profile photo, if available.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400828 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
829 # - organizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800830 # - owner
831 # - writer
832 # - commenter
833 # - reader
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400834 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
835 # - They can only be set on user and group permissions
836 # - The time must be in the future
837 # - The time cannot be more than a year in the future
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800838 "type": "A String", # The type of the grantee. Valid values are:
839 # - user
840 # - group
841 # - domain
842 # - anyone
843 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
844 },
845 ],
846 "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 Drive.
847 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
848 "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 Drive.
849 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
850 "description": "A String", # A short description of the file.
851 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
852 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
853 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800854 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400855 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800856 { # Information about a Drive user.
857 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700858 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800859 "displayName": "A String", # A plain text displayable name for this user.
860 "permissionId": "A String", # The user's ID as visible in Permission resources.
861 "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.
862 "photoLink": "A String", # A link to the user's profile photo, if available.
863 },
864 ],
865 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
866 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400867 "teamDriveId": "A String", # ID of the Team Drive the file resides in.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800868 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
869 # Entries with null values are cleared in update and copy requests.
870 "a_key": "A String",
871 },
872 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
873 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
874 "imageMediaMetadata": { # Additional metadata about image media, if available.
875 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
876 "exposureTime": 3.14, # The length of the exposure, in seconds.
877 "cameraMake": "A String", # The make of the camera used to create the photo.
878 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
879 "width": 42, # The width of the image in pixels.
880 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
881 "exposureMode": "A String", # The exposure mode used to create the photo.
882 "colorSpace": "A String", # The color space of the photo.
883 "location": { # Geographic location information stored in the image.
884 "latitude": 3.14, # The latitude stored in the image.
885 "altitude": 3.14, # The altitude stored in the image.
886 "longitude": 3.14, # The longitude stored in the image.
887 },
888 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
889 "height": 42, # The height of the image in pixels.
890 "lens": "A String", # The lens used to create the photo.
891 "isoSpeed": 42, # The ISO speed used to create the photo.
892 "meteringMode": "A String", # The metering mode used to create the photo.
893 "flashUsed": True or False, # Whether a flash was used to create the photo.
894 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
895 "aperture": 3.14, # The aperture used to create the photo (f-number).
896 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
897 "sensor": "A String", # The type of sensor used to create the photo.
898 "whiteBalance": "A String", # The white balance mode used to create the photo.
899 "cameraModel": "A String", # The model of the camera used to create the photo.
900 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700901 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800902 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
903 "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 Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400904 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
905 "me": True or False, # Whether this user is the requesting user.
906 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
907 "displayName": "A String", # A plain text displayable name for this user.
908 "permissionId": "A String", # The user's ID as visible in Permission resources.
909 "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.
910 "photoLink": "A String", # A link to the user's profile photo, if available.
911 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800912 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
913 "A String",
914 ],
915 "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.
916 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
917 "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.
918 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
919 "mimeType": "A String", # The MIME type of the thumbnail.
920 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
921 },
922 },
923 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400924 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800925 "starred": True or False, # Whether the user has starred the file.
926 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
927 }</pre>
928</div>
929
930<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400931 <code class="details" id="delete">delete(fileId, supportsTeamDrives=None)</code>
932 <pre>Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team 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 -0800933
934Args:
935 fileId: string, The ID of the file. (required)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400936 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800937</pre>
938</div>
939
940<div class="method">
941 <code class="details" id="emptyTrash">emptyTrash()</code>
942 <pre>Permanently deletes all of the user's trashed files.
943
944Args:
945</pre>
946</div>
947
948<div class="method">
949 <code class="details" id="export">export(fileId, mimeType)</code>
950 <pre>Exports a Google Doc to the requested MIME type and returns the exported content.
951
952Args:
953 fileId: string, The ID of the file. (required)
954 mimeType: string, The MIME type of the format requested for this export. (required)
955</pre>
956</div>
957
958<div class="method">
959 <code class="details" id="export_media">export_media(fileId, mimeType)</code>
960 <pre>Exports a Google Doc to the requested MIME type and returns the exported content.
961
962Args:
963 fileId: string, The ID of the file. (required)
964 mimeType: string, The MIME type of the format requested for this export. (required)
965</pre>
966</div>
967
968<div class="method">
969 <code class="details" id="generateIds">generateIds(count=None, space=None)</code>
970 <pre>Generates a set of file IDs which can be provided in create requests.
971
972Args:
973 count: integer, The number of IDs to return.
974 space: string, The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.
975
976Returns:
977 An object of the form:
978
979 { # A list of generated file IDs which can be provided in create requests.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700980 "kind": "drive#generatedIds", # Identifies what kind of resource this is. Value: the fixed string "drive#generatedIds".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800981 "ids": [ # The IDs generated for the requesting user in the specified space.
982 "A String",
983 ],
984 "space": "A String", # The type of file that can be created with these IDs.
985 }</pre>
986</div>
987
988<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400989 <code class="details" id="get">get(fileId, supportsTeamDrives=None, acknowledgeAbuse=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800990 <pre>Gets a file's metadata or content by ID.
991
992Args:
993 fileId: string, The ID of the file. (required)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400994 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800995 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
996
997Returns:
998 An object of the form:
999
1000 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001001 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001002 "mimeType": "A String", # The MIME type of the file.
1003 # 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.
1004 # 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.
1005 "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 -08001006 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001007 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001008 "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 -07001009 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001010 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for Team Drive files.
1011 "ownedByMe": True or False, # Whether the user owns the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001012 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1013 "id": "A String", # The ID of the file.
1014 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1015 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001016 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001017 "displayName": "A String", # A plain text displayable name for this user.
1018 "permissionId": "A String", # The user's ID as visible in Permission resources.
1019 "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.
1020 "photoLink": "A String", # A link to the user's profile photo, if available.
1021 },
1022 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
1023 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1024 "width": 42, # The width of the video in pixels.
1025 "durationMillis": "A String", # The duration of the video in milliseconds.
1026 "height": 42, # The height of the video in pixels.
1027 },
1028 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
1029 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001030 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001031 "displayName": "A String", # A plain text displayable name for this user.
1032 "permissionId": "A String", # The user's ID as visible in Permission resources.
1033 "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.
1034 "photoLink": "A String", # A link to the user's profile photo, if available.
1035 },
1036 "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.
1037 # If an unsupported color is specified, the closest color in the palette will be used instead.
1038 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
1039 # Entries with null values are cleared in update and copy requests.
1040 "a_key": "A String",
1041 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001042 "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
1043 "canReadRevisions": True or False, # Whether the user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
1044 "canTrash": True or False, # Whether the file can be trashed by the user.
1045 "canCopy": True or False, # Whether the user can copy the file. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001046 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001047 "canDelete": True or False, # Whether the file can be deleted by the user.
1048 "canMoveTeamDriveItem": True or False, # Whether the user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
1049 "canRename": True or False, # Whether the file can be renamed by the user.
1050 "canListChildren": True or False, # Whether the user can list the children of this folder. This is always false when the item is not a folder.
1051 "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
1052 "canDownload": True or False, # Whether the file can be downloaded by the user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001053 "canComment": True or False, # Whether the user can comment on the file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001054 "canRemoveChildren": True or False, # Whether the user can remove children from this folder. This is always false when the item is not a folder.
1055 "canReadTeamDrive": True or False, # Whether the user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
1056 "canAddChildren": True or False, # Whether the user can add children to this folder. This is always false when the item is not a folder.
1057 "canEdit": True or False, # Whether the user can edit the file's content.
1058 "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001059 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001060 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001061 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
1062 "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.
1063 "parents": [ # The IDs of the parent folders which contain the file.
1064 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
1065 "A String",
1066 ],
1067 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001068 "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
1069 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001070 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1071 "domain": "A String", # The domain to which this permission refers.
1072 "displayName": "A String", # A displayable name for users, groups or domains.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001073 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
1074 {
1075 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
1076 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
1077 # - organizer
1078 # - writer
1079 # - commenter
1080 # - reader
1081 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
1082 # - file
1083 # -
1084 # - member
1085 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
1086 },
1087 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001088 "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.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001089 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001090 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1091 "photoLink": "A String", # A link to the user's profile photo, if available.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001092 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
1093 # - organizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001094 # - owner
1095 # - writer
1096 # - commenter
1097 # - reader
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001098 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
1099 # - They can only be set on user and group permissions
1100 # - The time must be in the future
1101 # - The time cannot be more than a year in the future
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001102 "type": "A String", # The type of the grantee. Valid values are:
1103 # - user
1104 # - group
1105 # - domain
1106 # - anyone
1107 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
1108 },
1109 ],
1110 "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 Drive.
1111 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
1112 "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 Drive.
1113 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
1114 "description": "A String", # A short description of the file.
1115 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
1116 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
1117 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001118 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001119 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001120 { # Information about a Drive user.
1121 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001122 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001123 "displayName": "A String", # A plain text displayable name for this user.
1124 "permissionId": "A String", # The user's ID as visible in Permission resources.
1125 "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.
1126 "photoLink": "A String", # A link to the user's profile photo, if available.
1127 },
1128 ],
1129 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
1130 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001131 "teamDriveId": "A String", # ID of the Team Drive the file resides in.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001132 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
1133 # Entries with null values are cleared in update and copy requests.
1134 "a_key": "A String",
1135 },
1136 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
1137 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
1138 "imageMediaMetadata": { # Additional metadata about image media, if available.
1139 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1140 "exposureTime": 3.14, # The length of the exposure, in seconds.
1141 "cameraMake": "A String", # The make of the camera used to create the photo.
1142 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1143 "width": 42, # The width of the image in pixels.
1144 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1145 "exposureMode": "A String", # The exposure mode used to create the photo.
1146 "colorSpace": "A String", # The color space of the photo.
1147 "location": { # Geographic location information stored in the image.
1148 "latitude": 3.14, # The latitude stored in the image.
1149 "altitude": 3.14, # The altitude stored in the image.
1150 "longitude": 3.14, # The longitude stored in the image.
1151 },
1152 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1153 "height": 42, # The height of the image in pixels.
1154 "lens": "A String", # The lens used to create the photo.
1155 "isoSpeed": 42, # The ISO speed used to create the photo.
1156 "meteringMode": "A String", # The metering mode used to create the photo.
1157 "flashUsed": True or False, # Whether a flash was used to create the photo.
1158 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1159 "aperture": 3.14, # The aperture used to create the photo (f-number).
1160 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1161 "sensor": "A String", # The type of sensor used to create the photo.
1162 "whiteBalance": "A String", # The white balance mode used to create the photo.
1163 "cameraModel": "A String", # The model of the camera used to create the photo.
1164 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001165 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001166 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
1167 "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 Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001168 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
1169 "me": True or False, # Whether this user is the requesting user.
1170 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
1171 "displayName": "A String", # A plain text displayable name for this user.
1172 "permissionId": "A String", # The user's ID as visible in Permission resources.
1173 "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.
1174 "photoLink": "A String", # A link to the user's profile photo, if available.
1175 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001176 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1177 "A String",
1178 ],
1179 "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.
1180 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1181 "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.
1182 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
1183 "mimeType": "A String", # The MIME type of the thumbnail.
1184 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1185 },
1186 },
1187 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001188 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001189 "starred": True or False, # Whether the user has starred the file.
1190 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
1191 }</pre>
1192</div>
1193
1194<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001195 <code class="details" id="get_media">get_media(fileId, supportsTeamDrives=None, acknowledgeAbuse=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001196 <pre>Gets a file's metadata or content by ID.
1197
1198Args:
1199 fileId: string, The ID of the file. (required)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001200 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001201 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
1202
1203Returns:
1204 The media object as a string.
1205
1206 </pre>
1207</div>
1208
1209<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001210 <code class="details" id="list">list(orderBy=None, q=None, includeTeamDriveItems=None, pageSize=None, pageToken=None, corpora=None, supportsTeamDrives=None, spaces=None, teamDriveId=None, corpus=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001211 <pre>Lists or searches files.
1212
1213Args:
1214 orderBy: string, A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', '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.
1215 q: string, A query for filtering the file results. See the "Search for Files" guide for supported syntax.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001216 includeTeamDriveItems: boolean, Whether Team Drive items should be included in results.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001217 pageSize: integer, The maximum number of files to return per page.
1218 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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001219 corpora: string, Comma-separated list of bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'teamDrive' and 'allTeamDrives'. 'allTeamDrives' must be combined with 'user'; all other values must be used in isolation. Prefer 'user' or 'teamDrive' to 'allTeamDrives' for efficiency.
1220 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001221 spaces: string, A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001222 teamDriveId: string, ID of Team Drive to search.
1223 corpus: string, The source of files to list. Deprecated: use 'corpora' instead.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001224 Allowed values
1225 domain - Files shared to the user's domain.
1226 user - Files owned by or shared to the user.
1227
1228Returns:
1229 An object of the form:
1230
1231 { # A list of files.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001232 "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 -08001233 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001234 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001235 "mimeType": "A String", # The MIME type of the file.
1236 # 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.
1237 # 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.
1238 "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 -08001239 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001240 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001241 "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 -07001242 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001243 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for Team Drive files.
1244 "ownedByMe": True or False, # Whether the user owns the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001245 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1246 "id": "A String", # The ID of the file.
1247 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1248 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001249 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001250 "displayName": "A String", # A plain text displayable name for this user.
1251 "permissionId": "A String", # The user's ID as visible in Permission resources.
1252 "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.
1253 "photoLink": "A String", # A link to the user's profile photo, if available.
1254 },
1255 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
1256 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1257 "width": 42, # The width of the video in pixels.
1258 "durationMillis": "A String", # The duration of the video in milliseconds.
1259 "height": 42, # The height of the video in pixels.
1260 },
1261 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
1262 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001263 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001264 "displayName": "A String", # A plain text displayable name for this user.
1265 "permissionId": "A String", # The user's ID as visible in Permission resources.
1266 "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.
1267 "photoLink": "A String", # A link to the user's profile photo, if available.
1268 },
1269 "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.
1270 # If an unsupported color is specified, the closest color in the palette will be used instead.
1271 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
1272 # Entries with null values are cleared in update and copy requests.
1273 "a_key": "A String",
1274 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001275 "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
1276 "canReadRevisions": True or False, # Whether the user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
1277 "canTrash": True or False, # Whether the file can be trashed by the user.
1278 "canCopy": True or False, # Whether the user can copy the file. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001279 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001280 "canDelete": True or False, # Whether the file can be deleted by the user.
1281 "canMoveTeamDriveItem": True or False, # Whether the user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
1282 "canRename": True or False, # Whether the file can be renamed by the user.
1283 "canListChildren": True or False, # Whether the user can list the children of this folder. This is always false when the item is not a folder.
1284 "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
1285 "canDownload": True or False, # Whether the file can be downloaded by the user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001286 "canComment": True or False, # Whether the user can comment on the file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001287 "canRemoveChildren": True or False, # Whether the user can remove children from this folder. This is always false when the item is not a folder.
1288 "canReadTeamDrive": True or False, # Whether the user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
1289 "canAddChildren": True or False, # Whether the user can add children to this folder. This is always false when the item is not a folder.
1290 "canEdit": True or False, # Whether the user can edit the file's content.
1291 "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001292 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001293 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001294 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
1295 "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.
1296 "parents": [ # The IDs of the parent folders which contain the file.
1297 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
1298 "A String",
1299 ],
1300 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001301 "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
1302 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001303 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1304 "domain": "A String", # The domain to which this permission refers.
1305 "displayName": "A String", # A displayable name for users, groups or domains.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001306 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
1307 {
1308 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
1309 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
1310 # - organizer
1311 # - writer
1312 # - commenter
1313 # - reader
1314 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
1315 # - file
1316 # -
1317 # - member
1318 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
1319 },
1320 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001321 "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.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001322 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001323 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1324 "photoLink": "A String", # A link to the user's profile photo, if available.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001325 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
1326 # - organizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001327 # - owner
1328 # - writer
1329 # - commenter
1330 # - reader
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001331 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
1332 # - They can only be set on user and group permissions
1333 # - The time must be in the future
1334 # - The time cannot be more than a year in the future
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001335 "type": "A String", # The type of the grantee. Valid values are:
1336 # - user
1337 # - group
1338 # - domain
1339 # - anyone
1340 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
1341 },
1342 ],
1343 "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 Drive.
1344 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
1345 "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 Drive.
1346 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
1347 "description": "A String", # A short description of the file.
1348 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
1349 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
1350 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001351 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001352 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001353 { # Information about a Drive user.
1354 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001355 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001356 "displayName": "A String", # A plain text displayable name for this user.
1357 "permissionId": "A String", # The user's ID as visible in Permission resources.
1358 "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.
1359 "photoLink": "A String", # A link to the user's profile photo, if available.
1360 },
1361 ],
1362 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
1363 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001364 "teamDriveId": "A String", # ID of the Team Drive the file resides in.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001365 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
1366 # Entries with null values are cleared in update and copy requests.
1367 "a_key": "A String",
1368 },
1369 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
1370 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
1371 "imageMediaMetadata": { # Additional metadata about image media, if available.
1372 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1373 "exposureTime": 3.14, # The length of the exposure, in seconds.
1374 "cameraMake": "A String", # The make of the camera used to create the photo.
1375 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1376 "width": 42, # The width of the image in pixels.
1377 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1378 "exposureMode": "A String", # The exposure mode used to create the photo.
1379 "colorSpace": "A String", # The color space of the photo.
1380 "location": { # Geographic location information stored in the image.
1381 "latitude": 3.14, # The latitude stored in the image.
1382 "altitude": 3.14, # The altitude stored in the image.
1383 "longitude": 3.14, # The longitude stored in the image.
1384 },
1385 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1386 "height": 42, # The height of the image in pixels.
1387 "lens": "A String", # The lens used to create the photo.
1388 "isoSpeed": 42, # The ISO speed used to create the photo.
1389 "meteringMode": "A String", # The metering mode used to create the photo.
1390 "flashUsed": True or False, # Whether a flash was used to create the photo.
1391 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1392 "aperture": 3.14, # The aperture used to create the photo (f-number).
1393 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1394 "sensor": "A String", # The type of sensor used to create the photo.
1395 "whiteBalance": "A String", # The white balance mode used to create the photo.
1396 "cameraModel": "A String", # The model of the camera used to create the photo.
1397 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001398 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001399 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
1400 "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 Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001401 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
1402 "me": True or False, # Whether this user is the requesting user.
1403 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
1404 "displayName": "A String", # A plain text displayable name for this user.
1405 "permissionId": "A String", # The user's ID as visible in Permission resources.
1406 "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.
1407 "photoLink": "A String", # A link to the user's profile photo, if available.
1408 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001409 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1410 "A String",
1411 ],
1412 "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.
1413 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1414 "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.
1415 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
1416 "mimeType": "A String", # The MIME type of the thumbnail.
1417 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1418 },
1419 },
1420 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001421 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001422 "starred": True or False, # Whether the user has starred the file.
1423 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
1424 },
1425 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001426 "incompleteSearch": True or False, # Whether the search process was incomplete. If true, then some search results may be missing, since all documents were not searched. This may occur when searching multiple Team Drives with the "user,allTeamDrives" corpora, but all corpora could not be searched. When this happens, it is suggested that clients narrow their query by choosing a different corpus such as "user" or "teamDrive".
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001427 "kind": "drive#fileList", # Identifies what kind of resource this is. Value: the fixed string "drive#fileList".
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001428 "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 -08001429 }</pre>
1430</div>
1431
1432<div class="method">
1433 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1434 <pre>Retrieves the next page of results.
1435
1436Args:
1437 previous_request: The request for the previous page. (required)
1438 previous_response: The response from the request for the previous page. (required)
1439
1440Returns:
1441 A request object that you can call 'execute()' on to request the next
1442 page. Returns None if there are no more items in the collection.
1443 </pre>
1444</div>
1445
1446<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001447 <code class="details" id="update">update(fileId, body=None, media_body=None, addParents=None, removeParents=None, media_mime_type=None, useContentAsIndexableText=None, keepRevisionForever=None, supportsTeamDrives=None, ocrLanguage=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001448 <pre>Updates a file's metadata and/or content with patch semantics.
1449
1450Args:
1451 fileId: string, The ID of the file. (required)
1452 body: object, The request body.
1453 The object takes the form of:
1454
1455{ # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001456 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001457 "mimeType": "A String", # The MIME type of the file.
1458 # 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.
1459 # 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.
1460 "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 -08001461 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001462 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001463 "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 -07001464 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001465 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for Team Drive files.
1466 "ownedByMe": True or False, # Whether the user owns the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001467 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1468 "id": "A String", # The ID of the file.
1469 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1470 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001471 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001472 "displayName": "A String", # A plain text displayable name for this user.
1473 "permissionId": "A String", # The user's ID as visible in Permission resources.
1474 "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.
1475 "photoLink": "A String", # A link to the user's profile photo, if available.
1476 },
1477 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
1478 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1479 "width": 42, # The width of the video in pixels.
1480 "durationMillis": "A String", # The duration of the video in milliseconds.
1481 "height": 42, # The height of the video in pixels.
1482 },
1483 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
1484 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001485 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001486 "displayName": "A String", # A plain text displayable name for this user.
1487 "permissionId": "A String", # The user's ID as visible in Permission resources.
1488 "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.
1489 "photoLink": "A String", # A link to the user's profile photo, if available.
1490 },
1491 "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.
1492 # If an unsupported color is specified, the closest color in the palette will be used instead.
1493 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
1494 # Entries with null values are cleared in update and copy requests.
1495 "a_key": "A String",
1496 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001497 "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
1498 "canReadRevisions": True or False, # Whether the user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
1499 "canTrash": True or False, # Whether the file can be trashed by the user.
1500 "canCopy": True or False, # Whether the user can copy the file. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001501 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001502 "canDelete": True or False, # Whether the file can be deleted by the user.
1503 "canMoveTeamDriveItem": True or False, # Whether the user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
1504 "canRename": True or False, # Whether the file can be renamed by the user.
1505 "canListChildren": True or False, # Whether the user can list the children of this folder. This is always false when the item is not a folder.
1506 "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
1507 "canDownload": True or False, # Whether the file can be downloaded by the user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001508 "canComment": True or False, # Whether the user can comment on the file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001509 "canRemoveChildren": True or False, # Whether the user can remove children from this folder. This is always false when the item is not a folder.
1510 "canReadTeamDrive": True or False, # Whether the user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
1511 "canAddChildren": True or False, # Whether the user can add children to this folder. This is always false when the item is not a folder.
1512 "canEdit": True or False, # Whether the user can edit the file's content.
1513 "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001514 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001515 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001516 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
1517 "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.
1518 "parents": [ # The IDs of the parent folders which contain the file.
1519 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
1520 "A String",
1521 ],
1522 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001523 "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
1524 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001525 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1526 "domain": "A String", # The domain to which this permission refers.
1527 "displayName": "A String", # A displayable name for users, groups or domains.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001528 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
1529 {
1530 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
1531 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
1532 # - organizer
1533 # - writer
1534 # - commenter
1535 # - reader
1536 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
1537 # - file
1538 # -
1539 # - member
1540 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
1541 },
1542 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001543 "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.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001544 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001545 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1546 "photoLink": "A String", # A link to the user's profile photo, if available.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001547 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
1548 # - organizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001549 # - owner
1550 # - writer
1551 # - commenter
1552 # - reader
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001553 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
1554 # - They can only be set on user and group permissions
1555 # - The time must be in the future
1556 # - The time cannot be more than a year in the future
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001557 "type": "A String", # The type of the grantee. Valid values are:
1558 # - user
1559 # - group
1560 # - domain
1561 # - anyone
1562 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
1563 },
1564 ],
1565 "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 Drive.
1566 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
1567 "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 Drive.
1568 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
1569 "description": "A String", # A short description of the file.
1570 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
1571 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
1572 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001573 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001574 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001575 { # Information about a Drive user.
1576 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001577 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001578 "displayName": "A String", # A plain text displayable name for this user.
1579 "permissionId": "A String", # The user's ID as visible in Permission resources.
1580 "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.
1581 "photoLink": "A String", # A link to the user's profile photo, if available.
1582 },
1583 ],
1584 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
1585 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001586 "teamDriveId": "A String", # ID of the Team Drive the file resides in.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001587 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
1588 # Entries with null values are cleared in update and copy requests.
1589 "a_key": "A String",
1590 },
1591 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
1592 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
1593 "imageMediaMetadata": { # Additional metadata about image media, if available.
1594 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1595 "exposureTime": 3.14, # The length of the exposure, in seconds.
1596 "cameraMake": "A String", # The make of the camera used to create the photo.
1597 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1598 "width": 42, # The width of the image in pixels.
1599 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1600 "exposureMode": "A String", # The exposure mode used to create the photo.
1601 "colorSpace": "A String", # The color space of the photo.
1602 "location": { # Geographic location information stored in the image.
1603 "latitude": 3.14, # The latitude stored in the image.
1604 "altitude": 3.14, # The altitude stored in the image.
1605 "longitude": 3.14, # The longitude stored in the image.
1606 },
1607 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1608 "height": 42, # The height of the image in pixels.
1609 "lens": "A String", # The lens used to create the photo.
1610 "isoSpeed": 42, # The ISO speed used to create the photo.
1611 "meteringMode": "A String", # The metering mode used to create the photo.
1612 "flashUsed": True or False, # Whether a flash was used to create the photo.
1613 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1614 "aperture": 3.14, # The aperture used to create the photo (f-number).
1615 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1616 "sensor": "A String", # The type of sensor used to create the photo.
1617 "whiteBalance": "A String", # The white balance mode used to create the photo.
1618 "cameraModel": "A String", # The model of the camera used to create the photo.
1619 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001620 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001621 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
1622 "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 Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001623 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
1624 "me": True or False, # Whether this user is the requesting user.
1625 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
1626 "displayName": "A String", # A plain text displayable name for this user.
1627 "permissionId": "A String", # The user's ID as visible in Permission resources.
1628 "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.
1629 "photoLink": "A String", # A link to the user's profile photo, if available.
1630 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001631 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1632 "A String",
1633 ],
1634 "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.
1635 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1636 "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.
1637 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
1638 "mimeType": "A String", # The MIME type of the thumbnail.
1639 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1640 },
1641 },
1642 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001643 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001644 "starred": True or False, # Whether the user has starred the file.
1645 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
1646}
1647
1648 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
1649 addParents: string, A comma-separated list of parent IDs to add.
1650 removeParents: string, A comma-separated list of parent IDs to remove.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001651 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 -08001652 useContentAsIndexableText: boolean, Whether to use the uploaded content as indexable text.
1653 keepRevisionForever: boolean, Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001654 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001655 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code).
1656
1657Returns:
1658 An object of the form:
1659
1660 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001661 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001662 "mimeType": "A String", # The MIME type of the file.
1663 # 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.
1664 # 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.
1665 "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 -08001666 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001667 "thumbnailVersion": "A String", # The thumbnail version for use in thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001668 "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 -07001669 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001670 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions. Not populated for Team Drive files.
1671 "ownedByMe": True or False, # Whether the user owns the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001672 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1673 "id": "A String", # The ID of the file.
1674 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1675 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001676 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001677 "displayName": "A String", # A plain text displayable name for this user.
1678 "permissionId": "A String", # The user's ID as visible in Permission resources.
1679 "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.
1680 "photoLink": "A String", # A link to the user's profile photo, if available.
1681 },
1682 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
1683 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1684 "width": 42, # The width of the video in pixels.
1685 "durationMillis": "A String", # The duration of the video in milliseconds.
1686 "height": 42, # The height of the video in pixels.
1687 },
1688 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
1689 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001690 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001691 "displayName": "A String", # A plain text displayable name for this user.
1692 "permissionId": "A String", # The user's ID as visible in Permission resources.
1693 "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.
1694 "photoLink": "A String", # A link to the user's profile photo, if available.
1695 },
1696 "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.
1697 # If an unsupported color is specified, the closest color in the palette will be used instead.
1698 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
1699 # Entries with null values are cleared in update and copy requests.
1700 "a_key": "A String",
1701 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001702 "capabilities": { # Capabilities the current user has on the file. Each capability corresponds to a fine-grained action that a user may take.
1703 "canReadRevisions": True or False, # Whether the user has read access to the Revisions resource of the file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
1704 "canTrash": True or False, # Whether the file can be trashed by the user.
1705 "canCopy": True or False, # Whether the user can copy the file. For a Team Drive item, whether non-folder descendants of this item, or this item itself if it is not a folder, can be copied.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001706 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001707 "canDelete": True or False, # Whether the file can be deleted by the user.
1708 "canMoveTeamDriveItem": True or False, # Whether the user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files.
1709 "canRename": True or False, # Whether the file can be renamed by the user.
1710 "canListChildren": True or False, # Whether the user can list the children of this folder. This is always false when the item is not a folder.
1711 "canMoveItemIntoTeamDrive": True or False, # Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem.
1712 "canDownload": True or False, # Whether the file can be downloaded by the user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001713 "canComment": True or False, # Whether the user can comment on the file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001714 "canRemoveChildren": True or False, # Whether the user can remove children from this folder. This is always false when the item is not a folder.
1715 "canReadTeamDrive": True or False, # Whether the user has read access to the Team Drive to which this file belongs. Only populated for Team Drive files.
1716 "canAddChildren": True or False, # Whether the user can add children to this folder. This is always false when the item is not a folder.
1717 "canEdit": True or False, # Whether the user can edit the file's content.
1718 "canUntrash": True or False, # Whether the file can be restored from the trash by the current user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001719 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001720 "trashedTime": "A String", # The time that the item was trashed (RFC 3339 date-time). Only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001721 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
1722 "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.
1723 "parents": [ # The IDs of the parent folders which contain the file.
1724 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
1725 "A String",
1726 ],
1727 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001728 "shared": True or False, # Whether the file has been shared. Not populated for Team Drive files.
1729 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001730 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1731 "domain": "A String", # The domain to which this permission refers.
1732 "displayName": "A String", # A displayable name for users, groups or domains.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001733 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
1734 {
1735 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
1736 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
1737 # - organizer
1738 # - writer
1739 # - commenter
1740 # - reader
1741 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
1742 # - file
1743 # -
1744 # - member
1745 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
1746 },
1747 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001748 "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.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001749 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001750 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1751 "photoLink": "A String", # A link to the user's profile photo, if available.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001752 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
1753 # - organizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001754 # - owner
1755 # - writer
1756 # - commenter
1757 # - reader
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001758 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
1759 # - They can only be set on user and group permissions
1760 # - The time must be in the future
1761 # - The time cannot be more than a year in the future
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001762 "type": "A String", # The type of the grantee. Valid values are:
1763 # - user
1764 # - group
1765 # - domain
1766 # - anyone
1767 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
1768 },
1769 ],
1770 "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 Drive.
1771 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
1772 "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 Drive.
1773 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
1774 "description": "A String", # A short description of the file.
1775 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
1776 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
1777 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001778 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001779 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001780 { # Information about a Drive user.
1781 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001782 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001783 "displayName": "A String", # A plain text displayable name for this user.
1784 "permissionId": "A String", # The user's ID as visible in Permission resources.
1785 "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.
1786 "photoLink": "A String", # A link to the user's profile photo, if available.
1787 },
1788 ],
1789 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
1790 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001791 "teamDriveId": "A String", # ID of the Team Drive the file resides in.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001792 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
1793 # Entries with null values are cleared in update and copy requests.
1794 "a_key": "A String",
1795 },
1796 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
1797 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
1798 "imageMediaMetadata": { # Additional metadata about image media, if available.
1799 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1800 "exposureTime": 3.14, # The length of the exposure, in seconds.
1801 "cameraMake": "A String", # The make of the camera used to create the photo.
1802 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1803 "width": 42, # The width of the image in pixels.
1804 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1805 "exposureMode": "A String", # The exposure mode used to create the photo.
1806 "colorSpace": "A String", # The color space of the photo.
1807 "location": { # Geographic location information stored in the image.
1808 "latitude": 3.14, # The latitude stored in the image.
1809 "altitude": 3.14, # The altitude stored in the image.
1810 "longitude": 3.14, # The longitude stored in the image.
1811 },
1812 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1813 "height": 42, # The height of the image in pixels.
1814 "lens": "A String", # The lens used to create the photo.
1815 "isoSpeed": 42, # The ISO speed used to create the photo.
1816 "meteringMode": "A String", # The metering mode used to create the photo.
1817 "flashUsed": True or False, # Whether a flash was used to create the photo.
1818 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1819 "aperture": 3.14, # The aperture used to create the photo (f-number).
1820 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1821 "sensor": "A String", # The type of sensor used to create the photo.
1822 "whiteBalance": "A String", # The white balance mode used to create the photo.
1823 "cameraModel": "A String", # The model of the camera used to create the photo.
1824 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001825 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001826 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
1827 "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 Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001828 "trashingUser": { # Information about a Drive user. # If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files.
1829 "me": True or False, # Whether this user is the requesting user.
1830 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
1831 "displayName": "A String", # A plain text displayable name for this user.
1832 "permissionId": "A String", # The user's ID as visible in Permission resources.
1833 "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.
1834 "photoLink": "A String", # A link to the user's profile photo, if available.
1835 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001836 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1837 "A String",
1838 ],
1839 "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.
1840 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1841 "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.
1842 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
1843 "mimeType": "A String", # The MIME type of the thumbnail.
1844 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1845 },
1846 },
1847 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001848 "hasAugmentedPermissions": True or False, # Whether any users are granted file access directly on this file. This field is only populated for Team Drive files.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001849 "starred": True or False, # Whether the user has starred the file.
1850 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
1851 }</pre>
1852</div>
1853
1854<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001855 <code class="details" id="watch">watch(fileId, body, supportsTeamDrives=None, acknowledgeAbuse=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001856 <pre>Subscribes to changes to a file
1857
1858Args:
1859 fileId: string, The ID of the file. (required)
1860 body: object, The request body. (required)
1861 The object takes the form of:
1862
1863{ # An notification channel used to watch for resource changes.
1864 "resourceUri": "A String", # A version-specific identifier for the watched resource.
1865 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
1866 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
1867 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
1868 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
1869 "params": { # Additional parameters controlling delivery channel behavior. Optional.
1870 "a_key": "A String", # Declares a new parameter by name.
1871 },
1872 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
1873 "address": "A String", # The address where notifications are delivered for this channel.
1874 "type": "A String", # The type of delivery mechanism used for this channel.
1875 "id": "A String", # A UUID or similar unique string that identifies this channel.
1876 }
1877
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001878 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001879 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
1880
1881Returns:
1882 An object of the form:
1883
1884 { # An notification channel used to watch for resource changes.
1885 "resourceUri": "A String", # A version-specific identifier for the watched resource.
1886 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
1887 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
1888 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
1889 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
1890 "params": { # Additional parameters controlling delivery channel behavior. Optional.
1891 "a_key": "A String", # Declares a new parameter by name.
1892 },
1893 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
1894 "address": "A String", # The address where notifications are delivered for this channel.
1895 "type": "A String", # The type of delivery mechanism used for this channel.
1896 "id": "A String", # A UUID or similar unique string that identifies this channel.
1897 }</pre>
1898</div>
1899
1900<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001901 <code class="details" id="watch_media">watch_media(fileId, body, supportsTeamDrives=None, acknowledgeAbuse=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001902 <pre>Subscribes to changes to a file
1903
1904Args:
1905 fileId: string, The ID of the file. (required)
1906 body: object, The request body. (required)
1907 The object takes the form of:
1908
1909{ # An notification channel used to watch for resource changes.
1910 "resourceUri": "A String", # A version-specific identifier for the watched resource.
1911 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
1912 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
1913 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
1914 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
1915 "params": { # Additional parameters controlling delivery channel behavior. Optional.
1916 "a_key": "A String", # Declares a new parameter by name.
1917 },
1918 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
1919 "address": "A String", # The address where notifications are delivered for this channel.
1920 "type": "A String", # The type of delivery mechanism used for this channel.
1921 "id": "A String", # A UUID or similar unique string that identifies this channel.
1922 }
1923
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001924 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001925 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
1926
1927Returns:
1928 The media object as a string.
1929
1930 </pre>
1931</div>
1932
1933</body></html>