blob: b0b5d02af249daa3b0b03460164313514ed569f6 [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">
78 <code><a href="#copy">copy(fileId, body, keepRevisionForever=None, ignoreDefaultVisibility=None, ocrLanguage=None)</a></code></p>
79<p class="firstline">Creates a copy of a file and applies any requested updates with patch semantics.</p>
80<p class="toc_element">
81 <code><a href="#create">create(body=None, media_body=None, keepRevisionForever=None, useContentAsIndexableText=None, ignoreDefaultVisibility=None, ocrLanguage=None)</a></code></p>
82<p class="firstline">Creates a new file.</p>
83<p class="toc_element">
84 <code><a href="#delete">delete(fileId)</a></code></p>
85<p class="firstline">Permanently deletes a file owned by the user without moving it to the trash. If the target is a folder, all descendants owned by the user are also deleted.</p>
86<p class="toc_element">
87 <code><a href="#emptyTrash">emptyTrash()</a></code></p>
88<p class="firstline">Permanently deletes all of the user's trashed files.</p>
89<p class="toc_element">
90 <code><a href="#export">export(fileId, mimeType)</a></code></p>
91<p class="firstline">Exports a Google Doc to the requested MIME type and returns the exported content.</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">
99 <code><a href="#get">get(fileId, acknowledgeAbuse=None)</a></code></p>
100<p class="firstline">Gets a file's metadata or content by ID.</p>
101<p class="toc_element">
102 <code><a href="#get_media">get_media(fileId, acknowledgeAbuse=None)</a></code></p>
103<p class="firstline">Gets a file's metadata or content by ID.</p>
104<p class="toc_element">
105 <code><a href="#list">list(orderBy=None, q=None, pageSize=None, pageToken=None, spaces=None, corpus=None)</a></code></p>
106<p class="firstline">Lists or searches files.</p>
107<p class="toc_element">
108 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
109<p class="firstline">Retrieves the next page of results.</p>
110<p class="toc_element">
111 <code><a href="#update">update(fileId, body=None, media_body=None, addParents=None, removeParents=None, useContentAsIndexableText=None, keepRevisionForever=None, ocrLanguage=None)</a></code></p>
112<p class="firstline">Updates a file's metadata and/or content with patch semantics.</p>
113<p class="toc_element">
114 <code><a href="#watch">watch(fileId, body, acknowledgeAbuse=None)</a></code></p>
115<p class="firstline">Subscribes to changes to a file</p>
116<p class="toc_element">
117 <code><a href="#watch_media">watch_media(fileId, body, acknowledgeAbuse=None)</a></code></p>
118<p class="firstline">Subscribes to changes to a file</p>
119<h3>Method Details</h3>
120<div class="method">
121 <code class="details" id="copy">copy(fileId, body, keepRevisionForever=None, ignoreDefaultVisibility=None, ocrLanguage=None)</code>
122 <pre>Creates a copy of a file and applies any requested updates with patch semantics.
123
124Args:
125 fileId: string, The ID of the file. (required)
126 body: object, The request body. (required)
127 The object takes the form of:
128
129{ # The metadata for a file.
130 "mimeType": "A String", # The MIME type of the file.
131 # 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.
132 # 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.
133 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
134 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours.
135 "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 -0700136 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800137 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
138 "ownedByMe": True or False, # Whether the user owns the file.
139 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
140 "id": "A String", # The ID of the file.
141 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
142 "me": True or False, # Whether this user is the requesting user.
143 "kind": "drive#user", # This is always drive#user.
144 "displayName": "A String", # A plain text displayable name for this user.
145 "permissionId": "A String", # The user's ID as visible in Permission resources.
146 "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.
147 "photoLink": "A String", # A link to the user's profile photo, if available.
148 },
149 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
150 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
151 "width": 42, # The width of the video in pixels.
152 "durationMillis": "A String", # The duration of the video in milliseconds.
153 "height": 42, # The height of the video in pixels.
154 },
155 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
156 "me": True or False, # Whether this user is the requesting user.
157 "kind": "drive#user", # This is always drive#user.
158 "displayName": "A String", # A plain text displayable name for this user.
159 "permissionId": "A String", # The user's ID as visible in Permission resources.
160 "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.
161 "photoLink": "A String", # A link to the user's profile photo, if available.
162 },
163 "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.
164 # If an unsupported color is specified, the closest color in the palette will be used instead.
165 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
166 # Entries with null values are cleared in update and copy requests.
167 "a_key": "A String",
168 },
169 "capabilities": { # Capabilities the current user has on the file.
170 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
171 "canCopy": True or False, # Whether the user can copy the file.
172 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
173 "canEdit": True or False, # Whether the user can edit the file's content.
174 "canComment": True or False, # Whether the user can comment on the file.
175 },
176 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
177 "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.
178 "parents": [ # The IDs of the parent folders which contain the file.
179 # 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.
180 "A String",
181 ],
182 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
183 "shared": True or False, # Whether the file has been shared.
184 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
185 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
186 "domain": "A String", # The domain to which this permission refers.
187 "displayName": "A String", # A displayable name for users, groups or domains.
188 "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.
189 "kind": "drive#permission", # This is always drive#permission.
190 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
191 "photoLink": "A String", # A link to the user's profile photo, if available.
192 "role": "A String", # The role granted by this permission. Valid values are:
193 # - owner
194 # - writer
195 # - commenter
196 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700197 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800198 "type": "A String", # The type of the grantee. Valid values are:
199 # - user
200 # - group
201 # - domain
202 # - anyone
203 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
204 },
205 ],
206 "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.
207 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
208 "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.
209 "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.
210 "description": "A String", # A short description of the file.
211 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
212 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
213 "viewedByMe": True or False, # Whether the file has been viewed by this user.
214 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
215 { # Information about a Drive user.
216 "me": True or False, # Whether this user is the requesting user.
217 "kind": "drive#user", # This is always drive#user.
218 "displayName": "A String", # A plain text displayable name for this user.
219 "permissionId": "A String", # The user's ID as visible in Permission resources.
220 "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.
221 "photoLink": "A String", # A link to the user's profile photo, if available.
222 },
223 ],
224 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
225 "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.
226 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
227 # Entries with null values are cleared in update and copy requests.
228 "a_key": "A String",
229 },
230 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
231 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
232 "imageMediaMetadata": { # Additional metadata about image media, if available.
233 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
234 "exposureTime": 3.14, # The length of the exposure, in seconds.
235 "cameraMake": "A String", # The make of the camera used to create the photo.
236 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
237 "width": 42, # The width of the image in pixels.
238 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
239 "exposureMode": "A String", # The exposure mode used to create the photo.
240 "colorSpace": "A String", # The color space of the photo.
241 "location": { # Geographic location information stored in the image.
242 "latitude": 3.14, # The latitude stored in the image.
243 "altitude": 3.14, # The altitude stored in the image.
244 "longitude": 3.14, # The longitude stored in the image.
245 },
246 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
247 "height": 42, # The height of the image in pixels.
248 "lens": "A String", # The lens used to create the photo.
249 "isoSpeed": 42, # The ISO speed used to create the photo.
250 "meteringMode": "A String", # The metering mode used to create the photo.
251 "flashUsed": True or False, # Whether a flash was used to create the photo.
252 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
253 "aperture": 3.14, # The aperture used to create the photo (f-number).
254 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
255 "sensor": "A String", # The type of sensor used to create the photo.
256 "whiteBalance": "A String", # The white balance mode used to create the photo.
257 "cameraModel": "A String", # The model of the camera used to create the photo.
258 },
259 "kind": "drive#file", # This is always drive#file.
260 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
261 "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.
262 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
263 "A String",
264 ],
265 "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.
266 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
267 "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.
268 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
269 "mimeType": "A String", # The MIME type of the thumbnail.
270 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
271 },
272 },
273 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
274 "starred": True or False, # Whether the user has starred the file.
275 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
276}
277
278 keepRevisionForever: boolean, Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.
279 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.
280 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code).
281
282Returns:
283 An object of the form:
284
285 { # The metadata for a file.
286 "mimeType": "A String", # The MIME type of the file.
287 # 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.
288 # 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.
289 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
290 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours.
291 "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 -0700292 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800293 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
294 "ownedByMe": True or False, # Whether the user owns the file.
295 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
296 "id": "A String", # The ID of the file.
297 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
298 "me": True or False, # Whether this user is the requesting user.
299 "kind": "drive#user", # This is always 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 },
305 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
306 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
307 "width": 42, # The width of the video in pixels.
308 "durationMillis": "A String", # The duration of the video in milliseconds.
309 "height": 42, # The height of the video in pixels.
310 },
311 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
312 "me": True or False, # Whether this user is the requesting user.
313 "kind": "drive#user", # This is always drive#user.
314 "displayName": "A String", # A plain text displayable name for this user.
315 "permissionId": "A String", # The user's ID as visible in Permission resources.
316 "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.
317 "photoLink": "A String", # A link to the user's profile photo, if available.
318 },
319 "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.
320 # If an unsupported color is specified, the closest color in the palette will be used instead.
321 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
322 # Entries with null values are cleared in update and copy requests.
323 "a_key": "A String",
324 },
325 "capabilities": { # Capabilities the current user has on the file.
326 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
327 "canCopy": True or False, # Whether the user can copy the file.
328 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
329 "canEdit": True or False, # Whether the user can edit the file's content.
330 "canComment": True or False, # Whether the user can comment on the file.
331 },
332 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
333 "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.
334 "parents": [ # The IDs of the parent folders which contain the file.
335 # 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.
336 "A String",
337 ],
338 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
339 "shared": True or False, # Whether the file has been shared.
340 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
341 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
342 "domain": "A String", # The domain to which this permission refers.
343 "displayName": "A String", # A displayable name for users, groups or domains.
344 "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.
345 "kind": "drive#permission", # This is always drive#permission.
346 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
347 "photoLink": "A String", # A link to the user's profile photo, if available.
348 "role": "A String", # The role granted by this permission. Valid values are:
349 # - owner
350 # - writer
351 # - commenter
352 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700353 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800354 "type": "A String", # The type of the grantee. Valid values are:
355 # - user
356 # - group
357 # - domain
358 # - anyone
359 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
360 },
361 ],
362 "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.
363 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
364 "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.
365 "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.
366 "description": "A String", # A short description of the file.
367 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
368 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
369 "viewedByMe": True or False, # Whether the file has been viewed by this user.
370 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
371 { # Information about a Drive user.
372 "me": True or False, # Whether this user is the requesting user.
373 "kind": "drive#user", # This is always drive#user.
374 "displayName": "A String", # A plain text displayable name for this user.
375 "permissionId": "A String", # The user's ID as visible in Permission resources.
376 "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.
377 "photoLink": "A String", # A link to the user's profile photo, if available.
378 },
379 ],
380 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
381 "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.
382 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
383 # Entries with null values are cleared in update and copy requests.
384 "a_key": "A String",
385 },
386 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
387 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
388 "imageMediaMetadata": { # Additional metadata about image media, if available.
389 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
390 "exposureTime": 3.14, # The length of the exposure, in seconds.
391 "cameraMake": "A String", # The make of the camera used to create the photo.
392 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
393 "width": 42, # The width of the image in pixels.
394 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
395 "exposureMode": "A String", # The exposure mode used to create the photo.
396 "colorSpace": "A String", # The color space of the photo.
397 "location": { # Geographic location information stored in the image.
398 "latitude": 3.14, # The latitude stored in the image.
399 "altitude": 3.14, # The altitude stored in the image.
400 "longitude": 3.14, # The longitude stored in the image.
401 },
402 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
403 "height": 42, # The height of the image in pixels.
404 "lens": "A String", # The lens used to create the photo.
405 "isoSpeed": 42, # The ISO speed used to create the photo.
406 "meteringMode": "A String", # The metering mode used to create the photo.
407 "flashUsed": True or False, # Whether a flash was used to create the photo.
408 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
409 "aperture": 3.14, # The aperture used to create the photo (f-number).
410 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
411 "sensor": "A String", # The type of sensor used to create the photo.
412 "whiteBalance": "A String", # The white balance mode used to create the photo.
413 "cameraModel": "A String", # The model of the camera used to create the photo.
414 },
415 "kind": "drive#file", # This is always drive#file.
416 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
417 "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.
418 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
419 "A String",
420 ],
421 "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.
422 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
423 "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.
424 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
425 "mimeType": "A String", # The MIME type of the thumbnail.
426 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
427 },
428 },
429 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
430 "starred": True or False, # Whether the user has starred the file.
431 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
432 }</pre>
433</div>
434
435<div class="method">
436 <code class="details" id="create">create(body=None, media_body=None, keepRevisionForever=None, useContentAsIndexableText=None, ignoreDefaultVisibility=None, ocrLanguage=None)</code>
437 <pre>Creates a new file.
438
439Args:
440 body: object, The request body.
441 The object takes the form of:
442
443{ # The metadata for a file.
444 "mimeType": "A String", # The MIME type of the file.
445 # 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.
446 # 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.
447 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
448 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours.
449 "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 -0700450 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800451 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
452 "ownedByMe": True or False, # Whether the user owns the file.
453 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
454 "id": "A String", # The ID of the file.
455 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
456 "me": True or False, # Whether this user is the requesting user.
457 "kind": "drive#user", # This is always drive#user.
458 "displayName": "A String", # A plain text displayable name for this user.
459 "permissionId": "A String", # The user's ID as visible in Permission resources.
460 "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.
461 "photoLink": "A String", # A link to the user's profile photo, if available.
462 },
463 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
464 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
465 "width": 42, # The width of the video in pixels.
466 "durationMillis": "A String", # The duration of the video in milliseconds.
467 "height": 42, # The height of the video in pixels.
468 },
469 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
470 "me": True or False, # Whether this user is the requesting user.
471 "kind": "drive#user", # This is always drive#user.
472 "displayName": "A String", # A plain text displayable name for this user.
473 "permissionId": "A String", # The user's ID as visible in Permission resources.
474 "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.
475 "photoLink": "A String", # A link to the user's profile photo, if available.
476 },
477 "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.
478 # If an unsupported color is specified, the closest color in the palette will be used instead.
479 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
480 # Entries with null values are cleared in update and copy requests.
481 "a_key": "A String",
482 },
483 "capabilities": { # Capabilities the current user has on the file.
484 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
485 "canCopy": True or False, # Whether the user can copy the file.
486 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
487 "canEdit": True or False, # Whether the user can edit the file's content.
488 "canComment": True or False, # Whether the user can comment on the file.
489 },
490 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
491 "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.
492 "parents": [ # The IDs of the parent folders which contain the file.
493 # 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.
494 "A String",
495 ],
496 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
497 "shared": True or False, # Whether the file has been shared.
498 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
499 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
500 "domain": "A String", # The domain to which this permission refers.
501 "displayName": "A String", # A displayable name for users, groups or domains.
502 "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.
503 "kind": "drive#permission", # This is always drive#permission.
504 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
505 "photoLink": "A String", # A link to the user's profile photo, if available.
506 "role": "A String", # The role granted by this permission. Valid values are:
507 # - owner
508 # - writer
509 # - commenter
510 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700511 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800512 "type": "A String", # The type of the grantee. Valid values are:
513 # - user
514 # - group
515 # - domain
516 # - anyone
517 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
518 },
519 ],
520 "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.
521 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
522 "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.
523 "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.
524 "description": "A String", # A short description of the file.
525 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
526 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
527 "viewedByMe": True or False, # Whether the file has been viewed by this user.
528 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
529 { # Information about a Drive user.
530 "me": True or False, # Whether this user is the requesting user.
531 "kind": "drive#user", # This is always drive#user.
532 "displayName": "A String", # A plain text displayable name for this user.
533 "permissionId": "A String", # The user's ID as visible in Permission resources.
534 "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.
535 "photoLink": "A String", # A link to the user's profile photo, if available.
536 },
537 ],
538 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
539 "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.
540 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
541 # Entries with null values are cleared in update and copy requests.
542 "a_key": "A String",
543 },
544 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
545 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
546 "imageMediaMetadata": { # Additional metadata about image media, if available.
547 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
548 "exposureTime": 3.14, # The length of the exposure, in seconds.
549 "cameraMake": "A String", # The make of the camera used to create the photo.
550 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
551 "width": 42, # The width of the image in pixels.
552 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
553 "exposureMode": "A String", # The exposure mode used to create the photo.
554 "colorSpace": "A String", # The color space of the photo.
555 "location": { # Geographic location information stored in the image.
556 "latitude": 3.14, # The latitude stored in the image.
557 "altitude": 3.14, # The altitude stored in the image.
558 "longitude": 3.14, # The longitude stored in the image.
559 },
560 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
561 "height": 42, # The height of the image in pixels.
562 "lens": "A String", # The lens used to create the photo.
563 "isoSpeed": 42, # The ISO speed used to create the photo.
564 "meteringMode": "A String", # The metering mode used to create the photo.
565 "flashUsed": True or False, # Whether a flash was used to create the photo.
566 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
567 "aperture": 3.14, # The aperture used to create the photo (f-number).
568 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
569 "sensor": "A String", # The type of sensor used to create the photo.
570 "whiteBalance": "A String", # The white balance mode used to create the photo.
571 "cameraModel": "A String", # The model of the camera used to create the photo.
572 },
573 "kind": "drive#file", # This is always drive#file.
574 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
575 "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.
576 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
577 "A String",
578 ],
579 "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.
580 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
581 "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.
582 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
583 "mimeType": "A String", # The MIME type of the thumbnail.
584 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
585 },
586 },
587 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
588 "starred": True or False, # Whether the user has starred the file.
589 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
590}
591
592 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
593 keepRevisionForever: boolean, Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.
594 useContentAsIndexableText: boolean, Whether to use the uploaded content as indexable text.
595 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.
596 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code).
597
598Returns:
599 An object of the form:
600
601 { # The metadata for a file.
602 "mimeType": "A String", # The MIME type of the file.
603 # 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.
604 # 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.
605 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
606 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours.
607 "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 -0700608 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800609 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
610 "ownedByMe": True or False, # Whether the user owns the file.
611 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
612 "id": "A String", # The ID of the file.
613 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
614 "me": True or False, # Whether this user is the requesting user.
615 "kind": "drive#user", # This is always drive#user.
616 "displayName": "A String", # A plain text displayable name for this user.
617 "permissionId": "A String", # The user's ID as visible in Permission resources.
618 "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.
619 "photoLink": "A String", # A link to the user's profile photo, if available.
620 },
621 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
622 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
623 "width": 42, # The width of the video in pixels.
624 "durationMillis": "A String", # The duration of the video in milliseconds.
625 "height": 42, # The height of the video in pixels.
626 },
627 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
628 "me": True or False, # Whether this user is the requesting user.
629 "kind": "drive#user", # This is always drive#user.
630 "displayName": "A String", # A plain text displayable name for this user.
631 "permissionId": "A String", # The user's ID as visible in Permission resources.
632 "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.
633 "photoLink": "A String", # A link to the user's profile photo, if available.
634 },
635 "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.
636 # If an unsupported color is specified, the closest color in the palette will be used instead.
637 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
638 # Entries with null values are cleared in update and copy requests.
639 "a_key": "A String",
640 },
641 "capabilities": { # Capabilities the current user has on the file.
642 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
643 "canCopy": True or False, # Whether the user can copy the file.
644 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
645 "canEdit": True or False, # Whether the user can edit the file's content.
646 "canComment": True or False, # Whether the user can comment on the file.
647 },
648 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
649 "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.
650 "parents": [ # The IDs of the parent folders which contain the file.
651 # 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.
652 "A String",
653 ],
654 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
655 "shared": True or False, # Whether the file has been shared.
656 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
657 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
658 "domain": "A String", # The domain to which this permission refers.
659 "displayName": "A String", # A displayable name for users, groups or domains.
660 "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.
661 "kind": "drive#permission", # This is always drive#permission.
662 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
663 "photoLink": "A String", # A link to the user's profile photo, if available.
664 "role": "A String", # The role granted by this permission. Valid values are:
665 # - owner
666 # - writer
667 # - commenter
668 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700669 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800670 "type": "A String", # The type of the grantee. Valid values are:
671 # - user
672 # - group
673 # - domain
674 # - anyone
675 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
676 },
677 ],
678 "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.
679 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
680 "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.
681 "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.
682 "description": "A String", # A short description of the file.
683 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
684 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
685 "viewedByMe": True or False, # Whether the file has been viewed by this user.
686 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
687 { # Information about a Drive user.
688 "me": True or False, # Whether this user is the requesting user.
689 "kind": "drive#user", # This is always drive#user.
690 "displayName": "A String", # A plain text displayable name for this user.
691 "permissionId": "A String", # The user's ID as visible in Permission resources.
692 "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.
693 "photoLink": "A String", # A link to the user's profile photo, if available.
694 },
695 ],
696 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
697 "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.
698 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
699 # Entries with null values are cleared in update and copy requests.
700 "a_key": "A String",
701 },
702 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
703 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
704 "imageMediaMetadata": { # Additional metadata about image media, if available.
705 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
706 "exposureTime": 3.14, # The length of the exposure, in seconds.
707 "cameraMake": "A String", # The make of the camera used to create the photo.
708 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
709 "width": 42, # The width of the image in pixels.
710 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
711 "exposureMode": "A String", # The exposure mode used to create the photo.
712 "colorSpace": "A String", # The color space of the photo.
713 "location": { # Geographic location information stored in the image.
714 "latitude": 3.14, # The latitude stored in the image.
715 "altitude": 3.14, # The altitude stored in the image.
716 "longitude": 3.14, # The longitude stored in the image.
717 },
718 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
719 "height": 42, # The height of the image in pixels.
720 "lens": "A String", # The lens used to create the photo.
721 "isoSpeed": 42, # The ISO speed used to create the photo.
722 "meteringMode": "A String", # The metering mode used to create the photo.
723 "flashUsed": True or False, # Whether a flash was used to create the photo.
724 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
725 "aperture": 3.14, # The aperture used to create the photo (f-number).
726 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
727 "sensor": "A String", # The type of sensor used to create the photo.
728 "whiteBalance": "A String", # The white balance mode used to create the photo.
729 "cameraModel": "A String", # The model of the camera used to create the photo.
730 },
731 "kind": "drive#file", # This is always drive#file.
732 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
733 "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.
734 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
735 "A String",
736 ],
737 "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.
738 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
739 "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.
740 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
741 "mimeType": "A String", # The MIME type of the thumbnail.
742 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
743 },
744 },
745 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
746 "starred": True or False, # Whether the user has starred the file.
747 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
748 }</pre>
749</div>
750
751<div class="method">
752 <code class="details" id="delete">delete(fileId)</code>
753 <pre>Permanently deletes a file owned by the user without moving it to the trash. If the target is a folder, all descendants owned by the user are also deleted.
754
755Args:
756 fileId: string, The ID of the file. (required)
757</pre>
758</div>
759
760<div class="method">
761 <code class="details" id="emptyTrash">emptyTrash()</code>
762 <pre>Permanently deletes all of the user's trashed files.
763
764Args:
765</pre>
766</div>
767
768<div class="method">
769 <code class="details" id="export">export(fileId, mimeType)</code>
770 <pre>Exports a Google Doc to the requested MIME type and returns the exported content.
771
772Args:
773 fileId: string, The ID of the file. (required)
774 mimeType: string, The MIME type of the format requested for this export. (required)
775</pre>
776</div>
777
778<div class="method">
779 <code class="details" id="export_media">export_media(fileId, mimeType)</code>
780 <pre>Exports a Google Doc to the requested MIME type and returns the exported content.
781
782Args:
783 fileId: string, The ID of the file. (required)
784 mimeType: string, The MIME type of the format requested for this export. (required)
785</pre>
786</div>
787
788<div class="method">
789 <code class="details" id="generateIds">generateIds(count=None, space=None)</code>
790 <pre>Generates a set of file IDs which can be provided in create requests.
791
792Args:
793 count: integer, The number of IDs to return.
794 space: string, The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.
795
796Returns:
797 An object of the form:
798
799 { # A list of generated file IDs which can be provided in create requests.
800 "kind": "drive#generatedIds", # This is always drive#generatedIds
801 "ids": [ # The IDs generated for the requesting user in the specified space.
802 "A String",
803 ],
804 "space": "A String", # The type of file that can be created with these IDs.
805 }</pre>
806</div>
807
808<div class="method">
809 <code class="details" id="get">get(fileId, acknowledgeAbuse=None)</code>
810 <pre>Gets a file's metadata or content by ID.
811
812Args:
813 fileId: string, The ID of the file. (required)
814 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
815
816Returns:
817 An object of the form:
818
819 { # The metadata for a file.
820 "mimeType": "A String", # The MIME type of the file.
821 # 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.
822 # 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.
823 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
824 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours.
825 "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 -0700826 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800827 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
828 "ownedByMe": True or False, # Whether the user owns the file.
829 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
830 "id": "A String", # The ID of the file.
831 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
832 "me": True or False, # Whether this user is the requesting user.
833 "kind": "drive#user", # This is always drive#user.
834 "displayName": "A String", # A plain text displayable name for this user.
835 "permissionId": "A String", # The user's ID as visible in Permission resources.
836 "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.
837 "photoLink": "A String", # A link to the user's profile photo, if available.
838 },
839 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
840 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
841 "width": 42, # The width of the video in pixels.
842 "durationMillis": "A String", # The duration of the video in milliseconds.
843 "height": 42, # The height of the video in pixels.
844 },
845 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
846 "me": True or False, # Whether this user is the requesting user.
847 "kind": "drive#user", # This is always drive#user.
848 "displayName": "A String", # A plain text displayable name for this user.
849 "permissionId": "A String", # The user's ID as visible in Permission resources.
850 "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.
851 "photoLink": "A String", # A link to the user's profile photo, if available.
852 },
853 "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.
854 # If an unsupported color is specified, the closest color in the palette will be used instead.
855 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
856 # Entries with null values are cleared in update and copy requests.
857 "a_key": "A String",
858 },
859 "capabilities": { # Capabilities the current user has on the file.
860 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
861 "canCopy": True or False, # Whether the user can copy the file.
862 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
863 "canEdit": True or False, # Whether the user can edit the file's content.
864 "canComment": True or False, # Whether the user can comment on the file.
865 },
866 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
867 "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.
868 "parents": [ # The IDs of the parent folders which contain the file.
869 # 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.
870 "A String",
871 ],
872 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
873 "shared": True or False, # Whether the file has been shared.
874 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
875 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
876 "domain": "A String", # The domain to which this permission refers.
877 "displayName": "A String", # A displayable name for users, groups or domains.
878 "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.
879 "kind": "drive#permission", # This is always drive#permission.
880 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
881 "photoLink": "A String", # A link to the user's profile photo, if available.
882 "role": "A String", # The role granted by this permission. Valid values are:
883 # - owner
884 # - writer
885 # - commenter
886 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700887 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800888 "type": "A String", # The type of the grantee. Valid values are:
889 # - user
890 # - group
891 # - domain
892 # - anyone
893 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
894 },
895 ],
896 "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.
897 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
898 "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.
899 "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.
900 "description": "A String", # A short description of the file.
901 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
902 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
903 "viewedByMe": True or False, # Whether the file has been viewed by this user.
904 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
905 { # Information about a Drive user.
906 "me": True or False, # Whether this user is the requesting user.
907 "kind": "drive#user", # This is always drive#user.
908 "displayName": "A String", # A plain text displayable name for this user.
909 "permissionId": "A String", # The user's ID as visible in Permission resources.
910 "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.
911 "photoLink": "A String", # A link to the user's profile photo, if available.
912 },
913 ],
914 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
915 "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.
916 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
917 # Entries with null values are cleared in update and copy requests.
918 "a_key": "A String",
919 },
920 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
921 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
922 "imageMediaMetadata": { # Additional metadata about image media, if available.
923 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
924 "exposureTime": 3.14, # The length of the exposure, in seconds.
925 "cameraMake": "A String", # The make of the camera used to create the photo.
926 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
927 "width": 42, # The width of the image in pixels.
928 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
929 "exposureMode": "A String", # The exposure mode used to create the photo.
930 "colorSpace": "A String", # The color space of the photo.
931 "location": { # Geographic location information stored in the image.
932 "latitude": 3.14, # The latitude stored in the image.
933 "altitude": 3.14, # The altitude stored in the image.
934 "longitude": 3.14, # The longitude stored in the image.
935 },
936 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
937 "height": 42, # The height of the image in pixels.
938 "lens": "A String", # The lens used to create the photo.
939 "isoSpeed": 42, # The ISO speed used to create the photo.
940 "meteringMode": "A String", # The metering mode used to create the photo.
941 "flashUsed": True or False, # Whether a flash was used to create the photo.
942 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
943 "aperture": 3.14, # The aperture used to create the photo (f-number).
944 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
945 "sensor": "A String", # The type of sensor used to create the photo.
946 "whiteBalance": "A String", # The white balance mode used to create the photo.
947 "cameraModel": "A String", # The model of the camera used to create the photo.
948 },
949 "kind": "drive#file", # This is always drive#file.
950 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
951 "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.
952 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
953 "A String",
954 ],
955 "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.
956 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
957 "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.
958 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
959 "mimeType": "A String", # The MIME type of the thumbnail.
960 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
961 },
962 },
963 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
964 "starred": True or False, # Whether the user has starred the file.
965 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
966 }</pre>
967</div>
968
969<div class="method">
970 <code class="details" id="get_media">get_media(fileId, acknowledgeAbuse=None)</code>
971 <pre>Gets a file's metadata or content by ID.
972
973Args:
974 fileId: string, The ID of the file. (required)
975 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
976
977Returns:
978 The media object as a string.
979
980 </pre>
981</div>
982
983<div class="method">
984 <code class="details" id="list">list(orderBy=None, q=None, pageSize=None, pageToken=None, spaces=None, corpus=None)</code>
985 <pre>Lists or searches files.
986
987Args:
988 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.
989 q: string, A query for filtering the file results. See the "Search for Files" guide for supported syntax.
990 pageSize: integer, The maximum number of files to return per page.
991 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.
992 spaces: string, A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
993 corpus: string, The source of files to list.
994 Allowed values
995 domain - Files shared to the user's domain.
996 user - Files owned by or shared to the user.
997
998Returns:
999 An object of the form:
1000
1001 { # A list of files.
1002 "files": [ # The page of files.
1003 { # The metadata for a file.
1004 "mimeType": "A String", # The MIME type of the file.
1005 # 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.
1006 # 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.
1007 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
1008 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours.
1009 "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 -07001010 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001011 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
1012 "ownedByMe": True or False, # Whether the user owns the file.
1013 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1014 "id": "A String", # The ID of the file.
1015 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1016 "me": True or False, # Whether this user is the requesting user.
1017 "kind": "drive#user", # This is always drive#user.
1018 "displayName": "A String", # A plain text displayable name for this user.
1019 "permissionId": "A String", # The user's ID as visible in Permission resources.
1020 "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.
1021 "photoLink": "A String", # A link to the user's profile photo, if available.
1022 },
1023 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
1024 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1025 "width": 42, # The width of the video in pixels.
1026 "durationMillis": "A String", # The duration of the video in milliseconds.
1027 "height": 42, # The height of the video in pixels.
1028 },
1029 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
1030 "me": True or False, # Whether this user is the requesting user.
1031 "kind": "drive#user", # This is always drive#user.
1032 "displayName": "A String", # A plain text displayable name for this user.
1033 "permissionId": "A String", # The user's ID as visible in Permission resources.
1034 "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.
1035 "photoLink": "A String", # A link to the user's profile photo, if available.
1036 },
1037 "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.
1038 # If an unsupported color is specified, the closest color in the palette will be used instead.
1039 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
1040 # Entries with null values are cleared in update and copy requests.
1041 "a_key": "A String",
1042 },
1043 "capabilities": { # Capabilities the current user has on the file.
1044 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
1045 "canCopy": True or False, # Whether the user can copy the file.
1046 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
1047 "canEdit": True or False, # Whether the user can edit the file's content.
1048 "canComment": True or False, # Whether the user can comment on the file.
1049 },
1050 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
1051 "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.
1052 "parents": [ # The IDs of the parent folders which contain the file.
1053 # 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.
1054 "A String",
1055 ],
1056 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
1057 "shared": True or False, # Whether the file has been shared.
1058 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
1059 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1060 "domain": "A String", # The domain to which this permission refers.
1061 "displayName": "A String", # A displayable name for users, groups or domains.
1062 "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.
1063 "kind": "drive#permission", # This is always drive#permission.
1064 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1065 "photoLink": "A String", # A link to the user's profile photo, if available.
1066 "role": "A String", # The role granted by this permission. Valid values are:
1067 # - owner
1068 # - writer
1069 # - commenter
1070 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001071 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001072 "type": "A String", # The type of the grantee. Valid values are:
1073 # - user
1074 # - group
1075 # - domain
1076 # - anyone
1077 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
1078 },
1079 ],
1080 "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.
1081 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
1082 "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.
1083 "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.
1084 "description": "A String", # A short description of the file.
1085 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
1086 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
1087 "viewedByMe": True or False, # Whether the file has been viewed by this user.
1088 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
1089 { # Information about a Drive user.
1090 "me": True or False, # Whether this user is the requesting user.
1091 "kind": "drive#user", # This is always drive#user.
1092 "displayName": "A String", # A plain text displayable name for this user.
1093 "permissionId": "A String", # The user's ID as visible in Permission resources.
1094 "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.
1095 "photoLink": "A String", # A link to the user's profile photo, if available.
1096 },
1097 ],
1098 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
1099 "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.
1100 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
1101 # Entries with null values are cleared in update and copy requests.
1102 "a_key": "A String",
1103 },
1104 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
1105 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
1106 "imageMediaMetadata": { # Additional metadata about image media, if available.
1107 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1108 "exposureTime": 3.14, # The length of the exposure, in seconds.
1109 "cameraMake": "A String", # The make of the camera used to create the photo.
1110 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1111 "width": 42, # The width of the image in pixels.
1112 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1113 "exposureMode": "A String", # The exposure mode used to create the photo.
1114 "colorSpace": "A String", # The color space of the photo.
1115 "location": { # Geographic location information stored in the image.
1116 "latitude": 3.14, # The latitude stored in the image.
1117 "altitude": 3.14, # The altitude stored in the image.
1118 "longitude": 3.14, # The longitude stored in the image.
1119 },
1120 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1121 "height": 42, # The height of the image in pixels.
1122 "lens": "A String", # The lens used to create the photo.
1123 "isoSpeed": 42, # The ISO speed used to create the photo.
1124 "meteringMode": "A String", # The metering mode used to create the photo.
1125 "flashUsed": True or False, # Whether a flash was used to create the photo.
1126 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1127 "aperture": 3.14, # The aperture used to create the photo (f-number).
1128 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1129 "sensor": "A String", # The type of sensor used to create the photo.
1130 "whiteBalance": "A String", # The white balance mode used to create the photo.
1131 "cameraModel": "A String", # The model of the camera used to create the photo.
1132 },
1133 "kind": "drive#file", # This is always drive#file.
1134 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
1135 "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.
1136 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1137 "A String",
1138 ],
1139 "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.
1140 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1141 "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.
1142 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
1143 "mimeType": "A String", # The MIME type of the thumbnail.
1144 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1145 },
1146 },
1147 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
1148 "starred": True or False, # Whether the user has starred the file.
1149 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
1150 },
1151 ],
1152 "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.
1153 "kind": "drive#fileList", # This is always drive#fileList.
1154 }</pre>
1155</div>
1156
1157<div class="method">
1158 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1159 <pre>Retrieves the next page of results.
1160
1161Args:
1162 previous_request: The request for the previous page. (required)
1163 previous_response: The response from the request for the previous page. (required)
1164
1165Returns:
1166 A request object that you can call 'execute()' on to request the next
1167 page. Returns None if there are no more items in the collection.
1168 </pre>
1169</div>
1170
1171<div class="method">
1172 <code class="details" id="update">update(fileId, body=None, media_body=None, addParents=None, removeParents=None, useContentAsIndexableText=None, keepRevisionForever=None, ocrLanguage=None)</code>
1173 <pre>Updates a file's metadata and/or content with patch semantics.
1174
1175Args:
1176 fileId: string, The ID of the file. (required)
1177 body: object, The request body.
1178 The object takes the form of:
1179
1180{ # The metadata for a file.
1181 "mimeType": "A String", # The MIME type of the file.
1182 # 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.
1183 # 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.
1184 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
1185 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours.
1186 "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 -07001187 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001188 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
1189 "ownedByMe": True or False, # Whether the user owns the file.
1190 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1191 "id": "A String", # The ID of the file.
1192 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1193 "me": True or False, # Whether this user is the requesting user.
1194 "kind": "drive#user", # This is always drive#user.
1195 "displayName": "A String", # A plain text displayable name for this user.
1196 "permissionId": "A String", # The user's ID as visible in Permission resources.
1197 "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.
1198 "photoLink": "A String", # A link to the user's profile photo, if available.
1199 },
1200 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
1201 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1202 "width": 42, # The width of the video in pixels.
1203 "durationMillis": "A String", # The duration of the video in milliseconds.
1204 "height": 42, # The height of the video in pixels.
1205 },
1206 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
1207 "me": True or False, # Whether this user is the requesting user.
1208 "kind": "drive#user", # This is always drive#user.
1209 "displayName": "A String", # A plain text displayable name for this user.
1210 "permissionId": "A String", # The user's ID as visible in Permission resources.
1211 "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.
1212 "photoLink": "A String", # A link to the user's profile photo, if available.
1213 },
1214 "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.
1215 # If an unsupported color is specified, the closest color in the palette will be used instead.
1216 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
1217 # Entries with null values are cleared in update and copy requests.
1218 "a_key": "A String",
1219 },
1220 "capabilities": { # Capabilities the current user has on the file.
1221 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
1222 "canCopy": True or False, # Whether the user can copy the file.
1223 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
1224 "canEdit": True or False, # Whether the user can edit the file's content.
1225 "canComment": True or False, # Whether the user can comment on the file.
1226 },
1227 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
1228 "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.
1229 "parents": [ # The IDs of the parent folders which contain the file.
1230 # 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.
1231 "A String",
1232 ],
1233 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
1234 "shared": True or False, # Whether the file has been shared.
1235 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
1236 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1237 "domain": "A String", # The domain to which this permission refers.
1238 "displayName": "A String", # A displayable name for users, groups or domains.
1239 "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.
1240 "kind": "drive#permission", # This is always drive#permission.
1241 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1242 "photoLink": "A String", # A link to the user's profile photo, if available.
1243 "role": "A String", # The role granted by this permission. Valid values are:
1244 # - owner
1245 # - writer
1246 # - commenter
1247 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001248 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001249 "type": "A String", # The type of the grantee. Valid values are:
1250 # - user
1251 # - group
1252 # - domain
1253 # - anyone
1254 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
1255 },
1256 ],
1257 "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.
1258 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
1259 "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.
1260 "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.
1261 "description": "A String", # A short description of the file.
1262 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
1263 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
1264 "viewedByMe": True or False, # Whether the file has been viewed by this user.
1265 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
1266 { # Information about a Drive user.
1267 "me": True or False, # Whether this user is the requesting user.
1268 "kind": "drive#user", # This is always drive#user.
1269 "displayName": "A String", # A plain text displayable name for this user.
1270 "permissionId": "A String", # The user's ID as visible in Permission resources.
1271 "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.
1272 "photoLink": "A String", # A link to the user's profile photo, if available.
1273 },
1274 ],
1275 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
1276 "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.
1277 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
1278 # Entries with null values are cleared in update and copy requests.
1279 "a_key": "A String",
1280 },
1281 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
1282 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
1283 "imageMediaMetadata": { # Additional metadata about image media, if available.
1284 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1285 "exposureTime": 3.14, # The length of the exposure, in seconds.
1286 "cameraMake": "A String", # The make of the camera used to create the photo.
1287 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1288 "width": 42, # The width of the image in pixels.
1289 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1290 "exposureMode": "A String", # The exposure mode used to create the photo.
1291 "colorSpace": "A String", # The color space of the photo.
1292 "location": { # Geographic location information stored in the image.
1293 "latitude": 3.14, # The latitude stored in the image.
1294 "altitude": 3.14, # The altitude stored in the image.
1295 "longitude": 3.14, # The longitude stored in the image.
1296 },
1297 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1298 "height": 42, # The height of the image in pixels.
1299 "lens": "A String", # The lens used to create the photo.
1300 "isoSpeed": 42, # The ISO speed used to create the photo.
1301 "meteringMode": "A String", # The metering mode used to create the photo.
1302 "flashUsed": True or False, # Whether a flash was used to create the photo.
1303 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1304 "aperture": 3.14, # The aperture used to create the photo (f-number).
1305 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1306 "sensor": "A String", # The type of sensor used to create the photo.
1307 "whiteBalance": "A String", # The white balance mode used to create the photo.
1308 "cameraModel": "A String", # The model of the camera used to create the photo.
1309 },
1310 "kind": "drive#file", # This is always drive#file.
1311 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
1312 "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.
1313 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1314 "A String",
1315 ],
1316 "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.
1317 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1318 "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.
1319 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
1320 "mimeType": "A String", # The MIME type of the thumbnail.
1321 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1322 },
1323 },
1324 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
1325 "starred": True or False, # Whether the user has starred the file.
1326 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
1327}
1328
1329 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
1330 addParents: string, A comma-separated list of parent IDs to add.
1331 removeParents: string, A comma-separated list of parent IDs to remove.
1332 useContentAsIndexableText: boolean, Whether to use the uploaded content as indexable text.
1333 keepRevisionForever: boolean, Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.
1334 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code).
1335
1336Returns:
1337 An object of the form:
1338
1339 { # The metadata for a file.
1340 "mimeType": "A String", # The MIME type of the file.
1341 # 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.
1342 # 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.
1343 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
1344 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours.
1345 "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 -07001346 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001347 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
1348 "ownedByMe": True or False, # Whether the user owns the file.
1349 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1350 "id": "A String", # The ID of the file.
1351 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1352 "me": True or False, # Whether this user is the requesting user.
1353 "kind": "drive#user", # This is always drive#user.
1354 "displayName": "A String", # A plain text displayable name for this user.
1355 "permissionId": "A String", # The user's ID as visible in Permission resources.
1356 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
1357 "photoLink": "A String", # A link to the user's profile photo, if available.
1358 },
1359 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
1360 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1361 "width": 42, # The width of the video in pixels.
1362 "durationMillis": "A String", # The duration of the video in milliseconds.
1363 "height": 42, # The height of the video in pixels.
1364 },
1365 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
1366 "me": True or False, # Whether this user is the requesting user.
1367 "kind": "drive#user", # This is always drive#user.
1368 "displayName": "A String", # A plain text displayable name for this user.
1369 "permissionId": "A String", # The user's ID as visible in Permission resources.
1370 "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.
1371 "photoLink": "A String", # A link to the user's profile photo, if available.
1372 },
1373 "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.
1374 # If an unsupported color is specified, the closest color in the palette will be used instead.
1375 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
1376 # Entries with null values are cleared in update and copy requests.
1377 "a_key": "A String",
1378 },
1379 "capabilities": { # Capabilities the current user has on the file.
1380 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
1381 "canCopy": True or False, # Whether the user can copy the file.
1382 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
1383 "canEdit": True or False, # Whether the user can edit the file's content.
1384 "canComment": True or False, # Whether the user can comment on the file.
1385 },
1386 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
1387 "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.
1388 "parents": [ # The IDs of the parent folders which contain the file.
1389 # 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.
1390 "A String",
1391 ],
1392 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
1393 "shared": True or False, # Whether the file has been shared.
1394 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
1395 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1396 "domain": "A String", # The domain to which this permission refers.
1397 "displayName": "A String", # A displayable name for users, groups or domains.
1398 "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.
1399 "kind": "drive#permission", # This is always drive#permission.
1400 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1401 "photoLink": "A String", # A link to the user's profile photo, if available.
1402 "role": "A String", # The role granted by this permission. Valid values are:
1403 # - owner
1404 # - writer
1405 # - commenter
1406 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001407 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001408 "type": "A String", # The type of the grantee. Valid values are:
1409 # - user
1410 # - group
1411 # - domain
1412 # - anyone
1413 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
1414 },
1415 ],
1416 "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.
1417 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
1418 "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.
1419 "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.
1420 "description": "A String", # A short description of the file.
1421 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
1422 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
1423 "viewedByMe": True or False, # Whether the file has been viewed by this user.
1424 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
1425 { # Information about a Drive user.
1426 "me": True or False, # Whether this user is the requesting user.
1427 "kind": "drive#user", # This is always drive#user.
1428 "displayName": "A String", # A plain text displayable name for this user.
1429 "permissionId": "A String", # The user's ID as visible in Permission resources.
1430 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
1431 "photoLink": "A String", # A link to the user's profile photo, if available.
1432 },
1433 ],
1434 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
1435 "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.
1436 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
1437 # Entries with null values are cleared in update and copy requests.
1438 "a_key": "A String",
1439 },
1440 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
1441 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
1442 "imageMediaMetadata": { # Additional metadata about image media, if available.
1443 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1444 "exposureTime": 3.14, # The length of the exposure, in seconds.
1445 "cameraMake": "A String", # The make of the camera used to create the photo.
1446 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1447 "width": 42, # The width of the image in pixels.
1448 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1449 "exposureMode": "A String", # The exposure mode used to create the photo.
1450 "colorSpace": "A String", # The color space of the photo.
1451 "location": { # Geographic location information stored in the image.
1452 "latitude": 3.14, # The latitude stored in the image.
1453 "altitude": 3.14, # The altitude stored in the image.
1454 "longitude": 3.14, # The longitude stored in the image.
1455 },
1456 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1457 "height": 42, # The height of the image in pixels.
1458 "lens": "A String", # The lens used to create the photo.
1459 "isoSpeed": 42, # The ISO speed used to create the photo.
1460 "meteringMode": "A String", # The metering mode used to create the photo.
1461 "flashUsed": True or False, # Whether a flash was used to create the photo.
1462 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1463 "aperture": 3.14, # The aperture used to create the photo (f-number).
1464 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1465 "sensor": "A String", # The type of sensor used to create the photo.
1466 "whiteBalance": "A String", # The white balance mode used to create the photo.
1467 "cameraModel": "A String", # The model of the camera used to create the photo.
1468 },
1469 "kind": "drive#file", # This is always drive#file.
1470 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
1471 "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.
1472 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1473 "A String",
1474 ],
1475 "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.
1476 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1477 "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.
1478 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
1479 "mimeType": "A String", # The MIME type of the thumbnail.
1480 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1481 },
1482 },
1483 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
1484 "starred": True or False, # Whether the user has starred the file.
1485 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
1486 }</pre>
1487</div>
1488
1489<div class="method">
1490 <code class="details" id="watch">watch(fileId, body, acknowledgeAbuse=None)</code>
1491 <pre>Subscribes to changes to a file
1492
1493Args:
1494 fileId: string, The ID of the file. (required)
1495 body: object, The request body. (required)
1496 The object takes the form of:
1497
1498{ # An notification channel used to watch for resource changes.
1499 "resourceUri": "A String", # A version-specific identifier for the watched resource.
1500 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
1501 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
1502 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
1503 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
1504 "params": { # Additional parameters controlling delivery channel behavior. Optional.
1505 "a_key": "A String", # Declares a new parameter by name.
1506 },
1507 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
1508 "address": "A String", # The address where notifications are delivered for this channel.
1509 "type": "A String", # The type of delivery mechanism used for this channel.
1510 "id": "A String", # A UUID or similar unique string that identifies this channel.
1511 }
1512
1513 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
1514
1515Returns:
1516 An object of the form:
1517
1518 { # An notification channel used to watch for resource changes.
1519 "resourceUri": "A String", # A version-specific identifier for the watched resource.
1520 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
1521 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
1522 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
1523 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
1524 "params": { # Additional parameters controlling delivery channel behavior. Optional.
1525 "a_key": "A String", # Declares a new parameter by name.
1526 },
1527 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
1528 "address": "A String", # The address where notifications are delivered for this channel.
1529 "type": "A String", # The type of delivery mechanism used for this channel.
1530 "id": "A String", # A UUID or similar unique string that identifies this channel.
1531 }</pre>
1532</div>
1533
1534<div class="method">
1535 <code class="details" id="watch_media">watch_media(fileId, body, acknowledgeAbuse=None)</code>
1536 <pre>Subscribes to changes to a file
1537
1538Args:
1539 fileId: string, The ID of the file. (required)
1540 body: object, The request body. (required)
1541 The object takes the form of:
1542
1543{ # An notification channel used to watch for resource changes.
1544 "resourceUri": "A String", # A version-specific identifier for the watched resource.
1545 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
1546 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
1547 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
1548 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
1549 "params": { # Additional parameters controlling delivery channel behavior. Optional.
1550 "a_key": "A String", # Declares a new parameter by name.
1551 },
1552 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
1553 "address": "A String", # The address where notifications are delivered for this channel.
1554 "type": "A String", # The type of delivery mechanism used for this channel.
1555 "id": "A String", # A UUID or similar unique string that identifies this channel.
1556 }
1557
1558 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
1559
1560Returns:
1561 The media object as a string.
1562
1563 </pre>
1564</div>
1565
1566</body></html>