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