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