blob: 7eea6d3edc95bcd4d0d10fd4493f197b56e9f5e4 [file] [log] [blame]
Joe Gregorio075572b2012-07-09 16:53:09 -04001<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_v2.html">Drive API</a> . <a href="drive_v2.files.html">files</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#copy">copy(fileId, body, convert=None, targetLanguage=None, sourceLanguage=None, ocrLanguage=None, ocr=None, timedTextTrackName=None, timedTextLanguage=None)</a></code></p>
79<p class="firstline">Creates a copy of the specified file.</p>
80<p class="toc_element">
81 <code><a href="#delete">delete(fileId)</a></code></p>
82<p class="firstline">Permanently deletes a file by ID. Skips the trash.</p>
83<p class="toc_element">
84 <code><a href="#get">get(fileId, projection=None, updateViewedDate=None)</a></code></p>
85<p class="firstline">Gets a file's metadata by ID.</p>
86<p class="toc_element">
87 <code><a href="#insert">insert(body=None, media_body=None, convert=None, ocr=None, sourceLanguage=None, ocrLanguage=None, targetLanguage=None, timedTextLanguage=None, timedTextTrackName=None, pinned=None)</a></code></p>
88<p class="firstline">Insert a new file.</p>
89<p class="toc_element">
90 <code><a href="#list">list(q=None, projection=None, pageToken=None, maxResults=None)</a></code></p>
91<p class="firstline">Lists the user's files.</p>
92<p class="toc_element">
93 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
94<p class="firstline">Retrieves the next page of results.</p>
95<p class="toc_element">
96 <code><a href="#patch">patch(fileId, body, newRevision=None, pinned=None, targetLanguage=None, ocrLanguage=None, ocr=None, sourceLanguage=None, updateViewedDate=None, timedTextTrackName=None, convert=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
97<p class="firstline">Updates file metadata and/or content. This method supports patch semantics.</p>
98<p class="toc_element">
99 <code><a href="#touch">touch(fileId)</a></code></p>
100<p class="firstline">Set the file's updated time to the current server time.</p>
101<p class="toc_element">
102 <code><a href="#trash">trash(fileId)</a></code></p>
103<p class="firstline">Moves a file to the trash.</p>
104<p class="toc_element">
105 <code><a href="#untrash">untrash(fileId)</a></code></p>
106<p class="firstline">Restores a file from the trash.</p>
107<p class="toc_element">
108 <code><a href="#update">update(fileId, body=None, newRevision=None, media_body=None, targetLanguage=None, ocrLanguage=None, ocr=None, pinned=None, sourceLanguage=None, updateViewedDate=None, timedTextTrackName=None, convert=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
109<p class="firstline">Updates file metadata and/or content</p>
110<h3>Method Details</h3>
111<div class="method">
112 <code class="details" id="copy">copy(fileId, body, convert=None, targetLanguage=None, sourceLanguage=None, ocrLanguage=None, ocr=None, timedTextTrackName=None, timedTextLanguage=None)</code>
113 <pre>Creates a copy of the specified file.
114
115Args:
116 fileId: string, The ID of the file to copy. (required)
117 body: object, The request body. (required)
118 The object takes the form of:
119
120{ # The metadata for a file.
121 "mimeType": "A String", # The MIME type of the file.
122 "thumbnailLink": "A String", # A link to the file's thumbnail.
123 "labels": { # A group of labels for the file.
124 "restricted": True or False, # Whether viewers are prevented from downloading this file.
125 "hidden": True or False, # Whether this file is hidden from the user.
126 "viewed": True or False, # Whether this file has been viewed by this user.
127 "starred": True or False, # Whether this file is starred by the user.
128 "trashed": True or False, # Whether this file has been trashed.
129 },
130 "indexableText": { # Indexable text attributes for the file (can only be written)
131 "text": "A String", # The text to be indexed for this file
132 },
133 "etag": "A String", # ETag of the file.
134 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
135 "writersCanShare": True or False, # Whether writers can share the document with other users.
136 "id": "A String", # The id of the file.
137 "title": "A String", # The title of this file.
138 "ownerNames": [ # Name(s) of the owner(s) of this file.
139 "A String",
140 ],
141 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
142 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
143 "parents": [ # Collection of parent folders which contain this file.
144 # On insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.
145 { # A reference to a file's parent.
146 "selfLink": "A String", # A link back to this reference.
147 "kind": "drive#parentReference", # This is always drive#parentReference.
148 "id": "A String", # The ID of the parent.
149 "isRoot": True or False, # Whether or not the parent is the root folder.
150 "parentLink": "A String", # A link to the parent.
151 },
152 ],
153 "exportLinks": { # Links for exporting Google Docs to specific formats.
154 },
155 "originalFilename": "A String", # The filename when uploading this file. This will only be populated on files with content stored in Drive.
156 "description": "A String", # A short description of the file.
157 "editable": True or False, # Whether the file can be edited by the current user.
158 "kind": "drive#file", # The type of file. This is always drive#file.
159 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
160 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
161 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
162 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
163 "embedLink": "A String", # A link for embedding the file.
164 "alternateLink": "A String", # A link for opening the file in a browser.
165 "permissionsLink": "A String", # A link to the permissions collection.
166 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp).
167 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
168 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
169 "withLink": True or False, # Whether the link is required for this permission.
170 "kind": "drive#permission", # This is always drive#permission.
171 "name": "A String", # The name for this permission.
172 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
173 "id": "A String", # The ID of the permission.
174 "authKey": "A String", # The authkey parameter required for this permission.
175 "etag": "A String", # The ETag of the permission.
176 "role": "A String", # The primary role for this user. Allowed values are:
177 # - owner
178 # - reader
179 # - writer
180 "photoLink": "A String", # A link to the profile photo, if available.
181 "type": "A String", # The account type. Allowed values are:
182 # - user
183 # - group
184 # - domain
185 # - anyone
186 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
187 "A String",
188 ],
189 "selfLink": "A String", # A link back to this permission.
190 },
191 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive.
192 "selfLink": "A String", # A link back to this file.
193 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp).
194}
195
196 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
197 targetLanguage: string, Target language to translate the file to. If no sourceLanguage is provided, the API will attempt to detect the language.
198 sourceLanguage: string, The language of the original file to be translated.
199 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
200 ocr: boolean, Whether to attempt OCR on .jpg, .png, or .gif uploads.
201 timedTextTrackName: string, The timed text track name.
202 timedTextLanguage: string, The language of the timed text.
203
204Returns:
205 An object of the form:
206
207 { # The metadata for a file.
208 "mimeType": "A String", # The MIME type of the file.
209 "thumbnailLink": "A String", # A link to the file's thumbnail.
210 "labels": { # A group of labels for the file.
211 "restricted": True or False, # Whether viewers are prevented from downloading this file.
212 "hidden": True or False, # Whether this file is hidden from the user.
213 "viewed": True or False, # Whether this file has been viewed by this user.
214 "starred": True or False, # Whether this file is starred by the user.
215 "trashed": True or False, # Whether this file has been trashed.
216 },
217 "indexableText": { # Indexable text attributes for the file (can only be written)
218 "text": "A String", # The text to be indexed for this file
219 },
220 "etag": "A String", # ETag of the file.
221 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
222 "writersCanShare": True or False, # Whether writers can share the document with other users.
223 "id": "A String", # The id of the file.
224 "title": "A String", # The title of this file.
225 "ownerNames": [ # Name(s) of the owner(s) of this file.
226 "A String",
227 ],
228 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
229 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
230 "parents": [ # Collection of parent folders which contain this file.
231 # On insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.
232 { # A reference to a file's parent.
233 "selfLink": "A String", # A link back to this reference.
234 "kind": "drive#parentReference", # This is always drive#parentReference.
235 "id": "A String", # The ID of the parent.
236 "isRoot": True or False, # Whether or not the parent is the root folder.
237 "parentLink": "A String", # A link to the parent.
238 },
239 ],
240 "exportLinks": { # Links for exporting Google Docs to specific formats.
241 },
242 "originalFilename": "A String", # The filename when uploading this file. This will only be populated on files with content stored in Drive.
243 "description": "A String", # A short description of the file.
244 "editable": True or False, # Whether the file can be edited by the current user.
245 "kind": "drive#file", # The type of file. This is always drive#file.
246 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
247 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
248 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
249 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
250 "embedLink": "A String", # A link for embedding the file.
251 "alternateLink": "A String", # A link for opening the file in a browser.
252 "permissionsLink": "A String", # A link to the permissions collection.
253 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp).
254 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
255 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
256 "withLink": True or False, # Whether the link is required for this permission.
257 "kind": "drive#permission", # This is always drive#permission.
258 "name": "A String", # The name for this permission.
259 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
260 "id": "A String", # The ID of the permission.
261 "authKey": "A String", # The authkey parameter required for this permission.
262 "etag": "A String", # The ETag of the permission.
263 "role": "A String", # The primary role for this user. Allowed values are:
264 # - owner
265 # - reader
266 # - writer
267 "photoLink": "A String", # A link to the profile photo, if available.
268 "type": "A String", # The account type. Allowed values are:
269 # - user
270 # - group
271 # - domain
272 # - anyone
273 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
274 "A String",
275 ],
276 "selfLink": "A String", # A link back to this permission.
277 },
278 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive.
279 "selfLink": "A String", # A link back to this file.
280 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp).
281 }</pre>
282</div>
283
284<div class="method">
285 <code class="details" id="delete">delete(fileId)</code>
286 <pre>Permanently deletes a file by ID. Skips the trash.
287
288Args:
289 fileId: string, The ID of the file to delete. (required)
290</pre>
291</div>
292
293<div class="method">
294 <code class="details" id="get">get(fileId, projection=None, updateViewedDate=None)</code>
295 <pre>Gets a file's metadata by ID.
296
297Args:
298 fileId: string, The ID for the file in question. (required)
299 projection: string, Restrict information returned for simplicity and optimization.
300 Allowed values
301 BASIC - Includes only the basic metadata fields
302 FULL - Includes all metadata fields
303 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
304
305Returns:
306 An object of the form:
307
308 { # The metadata for a file.
309 "mimeType": "A String", # The MIME type of the file.
310 "thumbnailLink": "A String", # A link to the file's thumbnail.
311 "labels": { # A group of labels for the file.
312 "restricted": True or False, # Whether viewers are prevented from downloading this file.
313 "hidden": True or False, # Whether this file is hidden from the user.
314 "viewed": True or False, # Whether this file has been viewed by this user.
315 "starred": True or False, # Whether this file is starred by the user.
316 "trashed": True or False, # Whether this file has been trashed.
317 },
318 "indexableText": { # Indexable text attributes for the file (can only be written)
319 "text": "A String", # The text to be indexed for this file
320 },
321 "etag": "A String", # ETag of the file.
322 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
323 "writersCanShare": True or False, # Whether writers can share the document with other users.
324 "id": "A String", # The id of the file.
325 "title": "A String", # The title of this file.
326 "ownerNames": [ # Name(s) of the owner(s) of this file.
327 "A String",
328 ],
329 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
330 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
331 "parents": [ # Collection of parent folders which contain this file.
332 # On insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.
333 { # A reference to a file's parent.
334 "selfLink": "A String", # A link back to this reference.
335 "kind": "drive#parentReference", # This is always drive#parentReference.
336 "id": "A String", # The ID of the parent.
337 "isRoot": True or False, # Whether or not the parent is the root folder.
338 "parentLink": "A String", # A link to the parent.
339 },
340 ],
341 "exportLinks": { # Links for exporting Google Docs to specific formats.
342 },
343 "originalFilename": "A String", # The filename when uploading this file. This will only be populated on files with content stored in Drive.
344 "description": "A String", # A short description of the file.
345 "editable": True or False, # Whether the file can be edited by the current user.
346 "kind": "drive#file", # The type of file. This is always drive#file.
347 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
348 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
349 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
350 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
351 "embedLink": "A String", # A link for embedding the file.
352 "alternateLink": "A String", # A link for opening the file in a browser.
353 "permissionsLink": "A String", # A link to the permissions collection.
354 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp).
355 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
356 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
357 "withLink": True or False, # Whether the link is required for this permission.
358 "kind": "drive#permission", # This is always drive#permission.
359 "name": "A String", # The name for this permission.
360 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
361 "id": "A String", # The ID of the permission.
362 "authKey": "A String", # The authkey parameter required for this permission.
363 "etag": "A String", # The ETag of the permission.
364 "role": "A String", # The primary role for this user. Allowed values are:
365 # - owner
366 # - reader
367 # - writer
368 "photoLink": "A String", # A link to the profile photo, if available.
369 "type": "A String", # The account type. Allowed values are:
370 # - user
371 # - group
372 # - domain
373 # - anyone
374 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
375 "A String",
376 ],
377 "selfLink": "A String", # A link back to this permission.
378 },
379 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive.
380 "selfLink": "A String", # A link back to this file.
381 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp).
382 }</pre>
383</div>
384
385<div class="method">
386 <code class="details" id="insert">insert(body=None, media_body=None, convert=None, ocr=None, sourceLanguage=None, ocrLanguage=None, targetLanguage=None, timedTextLanguage=None, timedTextTrackName=None, pinned=None)</code>
387 <pre>Insert a new file.
388
389Args:
390 body: object, The request body.
391 The object takes the form of:
392
393{ # The metadata for a file.
394 "mimeType": "A String", # The MIME type of the file.
395 "thumbnailLink": "A String", # A link to the file's thumbnail.
396 "labels": { # A group of labels for the file.
397 "restricted": True or False, # Whether viewers are prevented from downloading this file.
398 "hidden": True or False, # Whether this file is hidden from the user.
399 "viewed": True or False, # Whether this file has been viewed by this user.
400 "starred": True or False, # Whether this file is starred by the user.
401 "trashed": True or False, # Whether this file has been trashed.
402 },
403 "indexableText": { # Indexable text attributes for the file (can only be written)
404 "text": "A String", # The text to be indexed for this file
405 },
406 "etag": "A String", # ETag of the file.
407 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
408 "writersCanShare": True or False, # Whether writers can share the document with other users.
409 "id": "A String", # The id of the file.
410 "title": "A String", # The title of this file.
411 "ownerNames": [ # Name(s) of the owner(s) of this file.
412 "A String",
413 ],
414 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
415 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
416 "parents": [ # Collection of parent folders which contain this file.
417 # On insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.
418 { # A reference to a file's parent.
419 "selfLink": "A String", # A link back to this reference.
420 "kind": "drive#parentReference", # This is always drive#parentReference.
421 "id": "A String", # The ID of the parent.
422 "isRoot": True or False, # Whether or not the parent is the root folder.
423 "parentLink": "A String", # A link to the parent.
424 },
425 ],
426 "exportLinks": { # Links for exporting Google Docs to specific formats.
427 },
428 "originalFilename": "A String", # The filename when uploading this file. This will only be populated on files with content stored in Drive.
429 "description": "A String", # A short description of the file.
430 "editable": True or False, # Whether the file can be edited by the current user.
431 "kind": "drive#file", # The type of file. This is always drive#file.
432 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
433 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
434 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
435 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
436 "embedLink": "A String", # A link for embedding the file.
437 "alternateLink": "A String", # A link for opening the file in a browser.
438 "permissionsLink": "A String", # A link to the permissions collection.
439 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp).
440 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
441 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
442 "withLink": True or False, # Whether the link is required for this permission.
443 "kind": "drive#permission", # This is always drive#permission.
444 "name": "A String", # The name for this permission.
445 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
446 "id": "A String", # The ID of the permission.
447 "authKey": "A String", # The authkey parameter required for this permission.
448 "etag": "A String", # The ETag of the permission.
449 "role": "A String", # The primary role for this user. Allowed values are:
450 # - owner
451 # - reader
452 # - writer
453 "photoLink": "A String", # A link to the profile photo, if available.
454 "type": "A String", # The account type. Allowed values are:
455 # - user
456 # - group
457 # - domain
458 # - anyone
459 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
460 "A String",
461 ],
462 "selfLink": "A String", # A link back to this permission.
463 },
464 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive.
465 "selfLink": "A String", # A link back to this file.
466 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp).
467}
468
469 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
470 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
471 ocr: boolean, Whether to attempt OCR on .jpg, .png, or .gif uploads.
472 sourceLanguage: string, The language of the original file to be translated.
473 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
474 targetLanguage: string, Target language to translate the file to. If no sourceLanguage is provided, the API will attempt to detect the language.
475 timedTextLanguage: string, The language of the timed text.
476 timedTextTrackName: string, The timed text track name.
477 pinned: boolean, Whether to pin the head revision of the uploaded file.
478
479Returns:
480 An object of the form:
481
482 { # The metadata for a file.
483 "mimeType": "A String", # The MIME type of the file.
484 "thumbnailLink": "A String", # A link to the file's thumbnail.
485 "labels": { # A group of labels for the file.
486 "restricted": True or False, # Whether viewers are prevented from downloading this file.
487 "hidden": True or False, # Whether this file is hidden from the user.
488 "viewed": True or False, # Whether this file has been viewed by this user.
489 "starred": True or False, # Whether this file is starred by the user.
490 "trashed": True or False, # Whether this file has been trashed.
491 },
492 "indexableText": { # Indexable text attributes for the file (can only be written)
493 "text": "A String", # The text to be indexed for this file
494 },
495 "etag": "A String", # ETag of the file.
496 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
497 "writersCanShare": True or False, # Whether writers can share the document with other users.
498 "id": "A String", # The id of the file.
499 "title": "A String", # The title of this file.
500 "ownerNames": [ # Name(s) of the owner(s) of this file.
501 "A String",
502 ],
503 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
504 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
505 "parents": [ # Collection of parent folders which contain this file.
506 # On insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.
507 { # A reference to a file's parent.
508 "selfLink": "A String", # A link back to this reference.
509 "kind": "drive#parentReference", # This is always drive#parentReference.
510 "id": "A String", # The ID of the parent.
511 "isRoot": True or False, # Whether or not the parent is the root folder.
512 "parentLink": "A String", # A link to the parent.
513 },
514 ],
515 "exportLinks": { # Links for exporting Google Docs to specific formats.
516 },
517 "originalFilename": "A String", # The filename when uploading this file. This will only be populated on files with content stored in Drive.
518 "description": "A String", # A short description of the file.
519 "editable": True or False, # Whether the file can be edited by the current user.
520 "kind": "drive#file", # The type of file. This is always drive#file.
521 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
522 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
523 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
524 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
525 "embedLink": "A String", # A link for embedding the file.
526 "alternateLink": "A String", # A link for opening the file in a browser.
527 "permissionsLink": "A String", # A link to the permissions collection.
528 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp).
529 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
530 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
531 "withLink": True or False, # Whether the link is required for this permission.
532 "kind": "drive#permission", # This is always drive#permission.
533 "name": "A String", # The name for this permission.
534 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
535 "id": "A String", # The ID of the permission.
536 "authKey": "A String", # The authkey parameter required for this permission.
537 "etag": "A String", # The ETag of the permission.
538 "role": "A String", # The primary role for this user. Allowed values are:
539 # - owner
540 # - reader
541 # - writer
542 "photoLink": "A String", # A link to the profile photo, if available.
543 "type": "A String", # The account type. Allowed values are:
544 # - user
545 # - group
546 # - domain
547 # - anyone
548 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
549 "A String",
550 ],
551 "selfLink": "A String", # A link back to this permission.
552 },
553 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive.
554 "selfLink": "A String", # A link back to this file.
555 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp).
556 }</pre>
557</div>
558
559<div class="method">
560 <code class="details" id="list">list(q=None, projection=None, pageToken=None, maxResults=None)</code>
561 <pre>Lists the user's files.
562
563Args:
564 q: string, Query string for searching files.
565 projection: string, Restrict information returned for simplicity and optimization.
566 Allowed values
567 BASIC - Includes only the basic metadata fields
568 FULL - Includes all metadata fields
569 pageToken: string, Page token for files.
570 maxResults: integer, Maximum number of files to return.
571
572Returns:
573 An object of the form:
574
575 { # A list of files.
576 "nextPageToken": "A String", # The page token for the next page of files.
577 "kind": "drive#fileList", # This is always drive#fileList.
578 "items": [ # The actual list of files.
579 { # The metadata for a file.
580 "mimeType": "A String", # The MIME type of the file.
581 "thumbnailLink": "A String", # A link to the file's thumbnail.
582 "labels": { # A group of labels for the file.
583 "restricted": True or False, # Whether viewers are prevented from downloading this file.
584 "hidden": True or False, # Whether this file is hidden from the user.
585 "viewed": True or False, # Whether this file has been viewed by this user.
586 "starred": True or False, # Whether this file is starred by the user.
587 "trashed": True or False, # Whether this file has been trashed.
588 },
589 "indexableText": { # Indexable text attributes for the file (can only be written)
590 "text": "A String", # The text to be indexed for this file
591 },
592 "etag": "A String", # ETag of the file.
593 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
594 "writersCanShare": True or False, # Whether writers can share the document with other users.
595 "id": "A String", # The id of the file.
596 "title": "A String", # The title of this file.
597 "ownerNames": [ # Name(s) of the owner(s) of this file.
598 "A String",
599 ],
600 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
601 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
602 "parents": [ # Collection of parent folders which contain this file.
603 # On insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.
604 { # A reference to a file's parent.
605 "selfLink": "A String", # A link back to this reference.
606 "kind": "drive#parentReference", # This is always drive#parentReference.
607 "id": "A String", # The ID of the parent.
608 "isRoot": True or False, # Whether or not the parent is the root folder.
609 "parentLink": "A String", # A link to the parent.
610 },
611 ],
612 "exportLinks": { # Links for exporting Google Docs to specific formats.
613 },
614 "originalFilename": "A String", # The filename when uploading this file. This will only be populated on files with content stored in Drive.
615 "description": "A String", # A short description of the file.
616 "editable": True or False, # Whether the file can be edited by the current user.
617 "kind": "drive#file", # The type of file. This is always drive#file.
618 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
619 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
620 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
621 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
622 "embedLink": "A String", # A link for embedding the file.
623 "alternateLink": "A String", # A link for opening the file in a browser.
624 "permissionsLink": "A String", # A link to the permissions collection.
625 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp).
626 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
627 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
628 "withLink": True or False, # Whether the link is required for this permission.
629 "kind": "drive#permission", # This is always drive#permission.
630 "name": "A String", # The name for this permission.
631 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
632 "id": "A String", # The ID of the permission.
633 "authKey": "A String", # The authkey parameter required for this permission.
634 "etag": "A String", # The ETag of the permission.
635 "role": "A String", # The primary role for this user. Allowed values are:
636 # - owner
637 # - reader
638 # - writer
639 "photoLink": "A String", # A link to the profile photo, if available.
640 "type": "A String", # The account type. Allowed values are:
641 # - user
642 # - group
643 # - domain
644 # - anyone
645 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
646 "A String",
647 ],
648 "selfLink": "A String", # A link back to this permission.
649 },
650 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive.
651 "selfLink": "A String", # A link back to this file.
652 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp).
653 },
654 ],
655 "nextLink": "A String", # A link to the next page of files.
656 "etag": "A String", # The ETag of the list.
657 "selfLink": "A String", # A link back to this list.
658 }</pre>
659</div>
660
661<div class="method">
662 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
663 <pre>Retrieves the next page of results.
664
665Args:
666 previous_request: The request for the previous page. (required)
667 previous_response: The response from the request for the previous page. (required)
668
669Returns:
670 A request object that you can call 'execute()' on to request the next
671 page. Returns None if there are no more items in the collection.
672 </pre>
673</div>
674
675<div class="method">
676 <code class="details" id="patch">patch(fileId, body, newRevision=None, pinned=None, targetLanguage=None, ocrLanguage=None, ocr=None, sourceLanguage=None, updateViewedDate=None, timedTextTrackName=None, convert=None, setModifiedDate=None, timedTextLanguage=None)</code>
677 <pre>Updates file metadata and/or content. This method supports patch semantics.
678
679Args:
680 fileId: string, The ID of the file to update. (required)
681 body: object, The request body. (required)
682 The object takes the form of:
683
684{ # The metadata for a file.
685 "mimeType": "A String", # The MIME type of the file.
686 "thumbnailLink": "A String", # A link to the file's thumbnail.
687 "labels": { # A group of labels for the file.
688 "restricted": True or False, # Whether viewers are prevented from downloading this file.
689 "hidden": True or False, # Whether this file is hidden from the user.
690 "viewed": True or False, # Whether this file has been viewed by this user.
691 "starred": True or False, # Whether this file is starred by the user.
692 "trashed": True or False, # Whether this file has been trashed.
693 },
694 "indexableText": { # Indexable text attributes for the file (can only be written)
695 "text": "A String", # The text to be indexed for this file
696 },
697 "etag": "A String", # ETag of the file.
698 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
699 "writersCanShare": True or False, # Whether writers can share the document with other users.
700 "id": "A String", # The id of the file.
701 "title": "A String", # The title of this file.
702 "ownerNames": [ # Name(s) of the owner(s) of this file.
703 "A String",
704 ],
705 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
706 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
707 "parents": [ # Collection of parent folders which contain this file.
708 # On insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.
709 { # A reference to a file's parent.
710 "selfLink": "A String", # A link back to this reference.
711 "kind": "drive#parentReference", # This is always drive#parentReference.
712 "id": "A String", # The ID of the parent.
713 "isRoot": True or False, # Whether or not the parent is the root folder.
714 "parentLink": "A String", # A link to the parent.
715 },
716 ],
717 "exportLinks": { # Links for exporting Google Docs to specific formats.
718 },
719 "originalFilename": "A String", # The filename when uploading this file. This will only be populated on files with content stored in Drive.
720 "description": "A String", # A short description of the file.
721 "editable": True or False, # Whether the file can be edited by the current user.
722 "kind": "drive#file", # The type of file. This is always drive#file.
723 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
724 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
725 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
726 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
727 "embedLink": "A String", # A link for embedding the file.
728 "alternateLink": "A String", # A link for opening the file in a browser.
729 "permissionsLink": "A String", # A link to the permissions collection.
730 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp).
731 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
732 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
733 "withLink": True or False, # Whether the link is required for this permission.
734 "kind": "drive#permission", # This is always drive#permission.
735 "name": "A String", # The name for this permission.
736 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
737 "id": "A String", # The ID of the permission.
738 "authKey": "A String", # The authkey parameter required for this permission.
739 "etag": "A String", # The ETag of the permission.
740 "role": "A String", # The primary role for this user. Allowed values are:
741 # - owner
742 # - reader
743 # - writer
744 "photoLink": "A String", # A link to the profile photo, if available.
745 "type": "A String", # The account type. Allowed values are:
746 # - user
747 # - group
748 # - domain
749 # - anyone
750 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
751 "A String",
752 ],
753 "selfLink": "A String", # A link back to this permission.
754 },
755 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive.
756 "selfLink": "A String", # A link back to this file.
757 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp).
758}
759
760 newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision will be replaced.
761 pinned: boolean, Whether to pin the new revision.
762 targetLanguage: string, Target language to translate the file to. If no sourceLanguage is provided, the API will attempt to detect the language.
763 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
764 ocr: boolean, Whether to attempt OCR on .jpg, .png, or .gif uploads.
765 sourceLanguage: string, The language of the original file to be translated.
766 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
767 timedTextTrackName: string, The timed text track name.
768 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
769 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
770 timedTextLanguage: string, The language of the timed text.
771
772Returns:
773 An object of the form:
774
775 { # The metadata for a file.
776 "mimeType": "A String", # The MIME type of the file.
777 "thumbnailLink": "A String", # A link to the file's thumbnail.
778 "labels": { # A group of labels for the file.
779 "restricted": True or False, # Whether viewers are prevented from downloading this file.
780 "hidden": True or False, # Whether this file is hidden from the user.
781 "viewed": True or False, # Whether this file has been viewed by this user.
782 "starred": True or False, # Whether this file is starred by the user.
783 "trashed": True or False, # Whether this file has been trashed.
784 },
785 "indexableText": { # Indexable text attributes for the file (can only be written)
786 "text": "A String", # The text to be indexed for this file
787 },
788 "etag": "A String", # ETag of the file.
789 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
790 "writersCanShare": True or False, # Whether writers can share the document with other users.
791 "id": "A String", # The id of the file.
792 "title": "A String", # The title of this file.
793 "ownerNames": [ # Name(s) of the owner(s) of this file.
794 "A String",
795 ],
796 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
797 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
798 "parents": [ # Collection of parent folders which contain this file.
799 # On insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.
800 { # A reference to a file's parent.
801 "selfLink": "A String", # A link back to this reference.
802 "kind": "drive#parentReference", # This is always drive#parentReference.
803 "id": "A String", # The ID of the parent.
804 "isRoot": True or False, # Whether or not the parent is the root folder.
805 "parentLink": "A String", # A link to the parent.
806 },
807 ],
808 "exportLinks": { # Links for exporting Google Docs to specific formats.
809 },
810 "originalFilename": "A String", # The filename when uploading this file. This will only be populated on files with content stored in Drive.
811 "description": "A String", # A short description of the file.
812 "editable": True or False, # Whether the file can be edited by the current user.
813 "kind": "drive#file", # The type of file. This is always drive#file.
814 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
815 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
816 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
817 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
818 "embedLink": "A String", # A link for embedding the file.
819 "alternateLink": "A String", # A link for opening the file in a browser.
820 "permissionsLink": "A String", # A link to the permissions collection.
821 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp).
822 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
823 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
824 "withLink": True or False, # Whether the link is required for this permission.
825 "kind": "drive#permission", # This is always drive#permission.
826 "name": "A String", # The name for this permission.
827 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
828 "id": "A String", # The ID of the permission.
829 "authKey": "A String", # The authkey parameter required for this permission.
830 "etag": "A String", # The ETag of the permission.
831 "role": "A String", # The primary role for this user. Allowed values are:
832 # - owner
833 # - reader
834 # - writer
835 "photoLink": "A String", # A link to the profile photo, if available.
836 "type": "A String", # The account type. Allowed values are:
837 # - user
838 # - group
839 # - domain
840 # - anyone
841 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
842 "A String",
843 ],
844 "selfLink": "A String", # A link back to this permission.
845 },
846 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive.
847 "selfLink": "A String", # A link back to this file.
848 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp).
849 }</pre>
850</div>
851
852<div class="method">
853 <code class="details" id="touch">touch(fileId)</code>
854 <pre>Set the file's updated time to the current server time.
855
856Args:
857 fileId: string, The ID of the file to update. (required)
858
859Returns:
860 An object of the form:
861
862 { # The metadata for a file.
863 "mimeType": "A String", # The MIME type of the file.
864 "thumbnailLink": "A String", # A link to the file's thumbnail.
865 "labels": { # A group of labels for the file.
866 "restricted": True or False, # Whether viewers are prevented from downloading this file.
867 "hidden": True or False, # Whether this file is hidden from the user.
868 "viewed": True or False, # Whether this file has been viewed by this user.
869 "starred": True or False, # Whether this file is starred by the user.
870 "trashed": True or False, # Whether this file has been trashed.
871 },
872 "indexableText": { # Indexable text attributes for the file (can only be written)
873 "text": "A String", # The text to be indexed for this file
874 },
875 "etag": "A String", # ETag of the file.
876 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
877 "writersCanShare": True or False, # Whether writers can share the document with other users.
878 "id": "A String", # The id of the file.
879 "title": "A String", # The title of this file.
880 "ownerNames": [ # Name(s) of the owner(s) of this file.
881 "A String",
882 ],
883 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
884 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
885 "parents": [ # Collection of parent folders which contain this file.
886 # On insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.
887 { # A reference to a file's parent.
888 "selfLink": "A String", # A link back to this reference.
889 "kind": "drive#parentReference", # This is always drive#parentReference.
890 "id": "A String", # The ID of the parent.
891 "isRoot": True or False, # Whether or not the parent is the root folder.
892 "parentLink": "A String", # A link to the parent.
893 },
894 ],
895 "exportLinks": { # Links for exporting Google Docs to specific formats.
896 },
897 "originalFilename": "A String", # The filename when uploading this file. This will only be populated on files with content stored in Drive.
898 "description": "A String", # A short description of the file.
899 "editable": True or False, # Whether the file can be edited by the current user.
900 "kind": "drive#file", # The type of file. This is always drive#file.
901 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
902 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
903 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
904 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
905 "embedLink": "A String", # A link for embedding the file.
906 "alternateLink": "A String", # A link for opening the file in a browser.
907 "permissionsLink": "A String", # A link to the permissions collection.
908 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp).
909 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
910 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
911 "withLink": True or False, # Whether the link is required for this permission.
912 "kind": "drive#permission", # This is always drive#permission.
913 "name": "A String", # The name for this permission.
914 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
915 "id": "A String", # The ID of the permission.
916 "authKey": "A String", # The authkey parameter required for this permission.
917 "etag": "A String", # The ETag of the permission.
918 "role": "A String", # The primary role for this user. Allowed values are:
919 # - owner
920 # - reader
921 # - writer
922 "photoLink": "A String", # A link to the profile photo, if available.
923 "type": "A String", # The account type. Allowed values are:
924 # - user
925 # - group
926 # - domain
927 # - anyone
928 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
929 "A String",
930 ],
931 "selfLink": "A String", # A link back to this permission.
932 },
933 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive.
934 "selfLink": "A String", # A link back to this file.
935 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp).
936 }</pre>
937</div>
938
939<div class="method">
940 <code class="details" id="trash">trash(fileId)</code>
941 <pre>Moves a file to the trash.
942
943Args:
944 fileId: string, The ID of the file to trash. (required)
945
946Returns:
947 An object of the form:
948
949 { # The metadata for a file.
950 "mimeType": "A String", # The MIME type of the file.
951 "thumbnailLink": "A String", # A link to the file's thumbnail.
952 "labels": { # A group of labels for the file.
953 "restricted": True or False, # Whether viewers are prevented from downloading this file.
954 "hidden": True or False, # Whether this file is hidden from the user.
955 "viewed": True or False, # Whether this file has been viewed by this user.
956 "starred": True or False, # Whether this file is starred by the user.
957 "trashed": True or False, # Whether this file has been trashed.
958 },
959 "indexableText": { # Indexable text attributes for the file (can only be written)
960 "text": "A String", # The text to be indexed for this file
961 },
962 "etag": "A String", # ETag of the file.
963 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
964 "writersCanShare": True or False, # Whether writers can share the document with other users.
965 "id": "A String", # The id of the file.
966 "title": "A String", # The title of this file.
967 "ownerNames": [ # Name(s) of the owner(s) of this file.
968 "A String",
969 ],
970 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
971 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
972 "parents": [ # Collection of parent folders which contain this file.
973 # On insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.
974 { # A reference to a file's parent.
975 "selfLink": "A String", # A link back to this reference.
976 "kind": "drive#parentReference", # This is always drive#parentReference.
977 "id": "A String", # The ID of the parent.
978 "isRoot": True or False, # Whether or not the parent is the root folder.
979 "parentLink": "A String", # A link to the parent.
980 },
981 ],
982 "exportLinks": { # Links for exporting Google Docs to specific formats.
983 },
984 "originalFilename": "A String", # The filename when uploading this file. This will only be populated on files with content stored in Drive.
985 "description": "A String", # A short description of the file.
986 "editable": True or False, # Whether the file can be edited by the current user.
987 "kind": "drive#file", # The type of file. This is always drive#file.
988 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
989 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
990 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
991 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
992 "embedLink": "A String", # A link for embedding the file.
993 "alternateLink": "A String", # A link for opening the file in a browser.
994 "permissionsLink": "A String", # A link to the permissions collection.
995 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp).
996 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
997 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
998 "withLink": True or False, # Whether the link is required for this permission.
999 "kind": "drive#permission", # This is always drive#permission.
1000 "name": "A String", # The name for this permission.
1001 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
1002 "id": "A String", # The ID of the permission.
1003 "authKey": "A String", # The authkey parameter required for this permission.
1004 "etag": "A String", # The ETag of the permission.
1005 "role": "A String", # The primary role for this user. Allowed values are:
1006 # - owner
1007 # - reader
1008 # - writer
1009 "photoLink": "A String", # A link to the profile photo, if available.
1010 "type": "A String", # The account type. Allowed values are:
1011 # - user
1012 # - group
1013 # - domain
1014 # - anyone
1015 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1016 "A String",
1017 ],
1018 "selfLink": "A String", # A link back to this permission.
1019 },
1020 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive.
1021 "selfLink": "A String", # A link back to this file.
1022 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp).
1023 }</pre>
1024</div>
1025
1026<div class="method">
1027 <code class="details" id="untrash">untrash(fileId)</code>
1028 <pre>Restores a file from the trash.
1029
1030Args:
1031 fileId: string, The ID of the file to untrash. (required)
1032
1033Returns:
1034 An object of the form:
1035
1036 { # The metadata for a file.
1037 "mimeType": "A String", # The MIME type of the file.
1038 "thumbnailLink": "A String", # A link to the file's thumbnail.
1039 "labels": { # A group of labels for the file.
1040 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1041 "hidden": True or False, # Whether this file is hidden from the user.
1042 "viewed": True or False, # Whether this file has been viewed by this user.
1043 "starred": True or False, # Whether this file is starred by the user.
1044 "trashed": True or False, # Whether this file has been trashed.
1045 },
1046 "indexableText": { # Indexable text attributes for the file (can only be written)
1047 "text": "A String", # The text to be indexed for this file
1048 },
1049 "etag": "A String", # ETag of the file.
1050 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
1051 "writersCanShare": True or False, # Whether writers can share the document with other users.
1052 "id": "A String", # The id of the file.
1053 "title": "A String", # The title of this file.
1054 "ownerNames": [ # Name(s) of the owner(s) of this file.
1055 "A String",
1056 ],
1057 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1058 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1059 "parents": [ # Collection of parent folders which contain this file.
1060 # On insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.
1061 { # A reference to a file's parent.
1062 "selfLink": "A String", # A link back to this reference.
1063 "kind": "drive#parentReference", # This is always drive#parentReference.
1064 "id": "A String", # The ID of the parent.
1065 "isRoot": True or False, # Whether or not the parent is the root folder.
1066 "parentLink": "A String", # A link to the parent.
1067 },
1068 ],
1069 "exportLinks": { # Links for exporting Google Docs to specific formats.
1070 },
1071 "originalFilename": "A String", # The filename when uploading this file. This will only be populated on files with content stored in Drive.
1072 "description": "A String", # A short description of the file.
1073 "editable": True or False, # Whether the file can be edited by the current user.
1074 "kind": "drive#file", # The type of file. This is always drive#file.
1075 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1076 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
1077 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1078 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
1079 "embedLink": "A String", # A link for embedding the file.
1080 "alternateLink": "A String", # A link for opening the file in a browser.
1081 "permissionsLink": "A String", # A link to the permissions collection.
1082 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp).
1083 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
1084 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
1085 "withLink": True or False, # Whether the link is required for this permission.
1086 "kind": "drive#permission", # This is always drive#permission.
1087 "name": "A String", # The name for this permission.
1088 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
1089 "id": "A String", # The ID of the permission.
1090 "authKey": "A String", # The authkey parameter required for this permission.
1091 "etag": "A String", # The ETag of the permission.
1092 "role": "A String", # The primary role for this user. Allowed values are:
1093 # - owner
1094 # - reader
1095 # - writer
1096 "photoLink": "A String", # A link to the profile photo, if available.
1097 "type": "A String", # The account type. Allowed values are:
1098 # - user
1099 # - group
1100 # - domain
1101 # - anyone
1102 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1103 "A String",
1104 ],
1105 "selfLink": "A String", # A link back to this permission.
1106 },
1107 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive.
1108 "selfLink": "A String", # A link back to this file.
1109 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp).
1110 }</pre>
1111</div>
1112
1113<div class="method">
1114 <code class="details" id="update">update(fileId, body=None, newRevision=None, media_body=None, targetLanguage=None, ocrLanguage=None, ocr=None, pinned=None, sourceLanguage=None, updateViewedDate=None, timedTextTrackName=None, convert=None, setModifiedDate=None, timedTextLanguage=None)</code>
1115 <pre>Updates file metadata and/or content
1116
1117Args:
1118 fileId: string, The ID of the file to update. (required)
1119 body: object, The request body.
1120 The object takes the form of:
1121
1122{ # The metadata for a file.
1123 "mimeType": "A String", # The MIME type of the file.
1124 "thumbnailLink": "A String", # A link to the file's thumbnail.
1125 "labels": { # A group of labels for the file.
1126 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1127 "hidden": True or False, # Whether this file is hidden from the user.
1128 "viewed": True or False, # Whether this file has been viewed by this user.
1129 "starred": True or False, # Whether this file is starred by the user.
1130 "trashed": True or False, # Whether this file has been trashed.
1131 },
1132 "indexableText": { # Indexable text attributes for the file (can only be written)
1133 "text": "A String", # The text to be indexed for this file
1134 },
1135 "etag": "A String", # ETag of the file.
1136 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
1137 "writersCanShare": True or False, # Whether writers can share the document with other users.
1138 "id": "A String", # The id of the file.
1139 "title": "A String", # The title of this file.
1140 "ownerNames": [ # Name(s) of the owner(s) of this file.
1141 "A String",
1142 ],
1143 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1144 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1145 "parents": [ # Collection of parent folders which contain this file.
1146 # On insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.
1147 { # A reference to a file's parent.
1148 "selfLink": "A String", # A link back to this reference.
1149 "kind": "drive#parentReference", # This is always drive#parentReference.
1150 "id": "A String", # The ID of the parent.
1151 "isRoot": True or False, # Whether or not the parent is the root folder.
1152 "parentLink": "A String", # A link to the parent.
1153 },
1154 ],
1155 "exportLinks": { # Links for exporting Google Docs to specific formats.
1156 },
1157 "originalFilename": "A String", # The filename when uploading this file. This will only be populated on files with content stored in Drive.
1158 "description": "A String", # A short description of the file.
1159 "editable": True or False, # Whether the file can be edited by the current user.
1160 "kind": "drive#file", # The type of file. This is always drive#file.
1161 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1162 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
1163 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1164 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
1165 "embedLink": "A String", # A link for embedding the file.
1166 "alternateLink": "A String", # A link for opening the file in a browser.
1167 "permissionsLink": "A String", # A link to the permissions collection.
1168 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp).
1169 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
1170 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
1171 "withLink": True or False, # Whether the link is required for this permission.
1172 "kind": "drive#permission", # This is always drive#permission.
1173 "name": "A String", # The name for this permission.
1174 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
1175 "id": "A String", # The ID of the permission.
1176 "authKey": "A String", # The authkey parameter required for this permission.
1177 "etag": "A String", # The ETag of the permission.
1178 "role": "A String", # The primary role for this user. Allowed values are:
1179 # - owner
1180 # - reader
1181 # - writer
1182 "photoLink": "A String", # A link to the profile photo, if available.
1183 "type": "A String", # The account type. Allowed values are:
1184 # - user
1185 # - group
1186 # - domain
1187 # - anyone
1188 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1189 "A String",
1190 ],
1191 "selfLink": "A String", # A link back to this permission.
1192 },
1193 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive.
1194 "selfLink": "A String", # A link back to this file.
1195 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp).
1196}
1197
1198 newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision will be replaced.
1199 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
1200 targetLanguage: string, Target language to translate the file to. If no sourceLanguage is provided, the API will attempt to detect the language.
1201 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
1202 ocr: boolean, Whether to attempt OCR on .jpg, .png, or .gif uploads.
1203 pinned: boolean, Whether to pin the new revision.
1204 sourceLanguage: string, The language of the original file to be translated.
1205 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
1206 timedTextTrackName: string, The timed text track name.
1207 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
1208 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
1209 timedTextLanguage: string, The language of the timed text.
1210
1211Returns:
1212 An object of the form:
1213
1214 { # The metadata for a file.
1215 "mimeType": "A String", # The MIME type of the file.
1216 "thumbnailLink": "A String", # A link to the file's thumbnail.
1217 "labels": { # A group of labels for the file.
1218 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1219 "hidden": True or False, # Whether this file is hidden from the user.
1220 "viewed": True or False, # Whether this file has been viewed by this user.
1221 "starred": True or False, # Whether this file is starred by the user.
1222 "trashed": True or False, # Whether this file has been trashed.
1223 },
1224 "indexableText": { # Indexable text attributes for the file (can only be written)
1225 "text": "A String", # The text to be indexed for this file
1226 },
1227 "etag": "A String", # ETag of the file.
1228 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
1229 "writersCanShare": True or False, # Whether writers can share the document with other users.
1230 "id": "A String", # The id of the file.
1231 "title": "A String", # The title of this file.
1232 "ownerNames": [ # Name(s) of the owner(s) of this file.
1233 "A String",
1234 ],
1235 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1236 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1237 "parents": [ # Collection of parent folders which contain this file.
1238 # On insert, setting this field will put the file in all of the provided folders. If no folders are provided, the file will be placed in the default root folder. On update, this field is ignored.
1239 { # A reference to a file's parent.
1240 "selfLink": "A String", # A link back to this reference.
1241 "kind": "drive#parentReference", # This is always drive#parentReference.
1242 "id": "A String", # The ID of the parent.
1243 "isRoot": True or False, # Whether or not the parent is the root folder.
1244 "parentLink": "A String", # A link to the parent.
1245 },
1246 ],
1247 "exportLinks": { # Links for exporting Google Docs to specific formats.
1248 },
1249 "originalFilename": "A String", # The filename when uploading this file. This will only be populated on files with content stored in Drive.
1250 "description": "A String", # A short description of the file.
1251 "editable": True or False, # Whether the file can be edited by the current user.
1252 "kind": "drive#file", # The type of file. This is always drive#file.
1253 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1254 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
1255 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1256 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
1257 "embedLink": "A String", # A link for embedding the file.
1258 "alternateLink": "A String", # A link for opening the file in a browser.
1259 "permissionsLink": "A String", # A link to the permissions collection.
1260 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp).
1261 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
1262 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
1263 "withLink": True or False, # Whether the link is required for this permission.
1264 "kind": "drive#permission", # This is always drive#permission.
1265 "name": "A String", # The name for this permission.
1266 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
1267 "id": "A String", # The ID of the permission.
1268 "authKey": "A String", # The authkey parameter required for this permission.
1269 "etag": "A String", # The ETag of the permission.
1270 "role": "A String", # The primary role for this user. Allowed values are:
1271 # - owner
1272 # - reader
1273 # - writer
1274 "photoLink": "A String", # A link to the profile photo, if available.
1275 "type": "A String", # The account type. Allowed values are:
1276 # - user
1277 # - group
1278 # - domain
1279 # - anyone
1280 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1281 "A String",
1282 ],
1283 "selfLink": "A String", # A link back to this permission.
1284 },
1285 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it on title when creating the file. This will only be populated on files with content stored in Drive.
1286 "selfLink": "A String", # A link back to this file.
1287 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp).
1288 }</pre>
1289</div>
1290
1291</body></html>