blob: 18f27cef858a69c00a2b218946add203b2e69b9d [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.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400121 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio075572b2012-07-09 16:53:09 -0400122 "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 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400133 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio075572b2012-07-09 16:53:09 -0400134 "etag": "A String", # ETag of the file.
135 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
136 "writersCanShare": True or False, # Whether writers can share the document with other users.
137 "id": "A String", # The id of the file.
138 "title": "A String", # The title of this file.
139 "ownerNames": [ # Name(s) of the owner(s) of this file.
140 "A String",
141 ],
142 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
143 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
144 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400145 # 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 -0400146 { # A reference to a file's parent.
147 "selfLink": "A String", # A link back to this reference.
148 "kind": "drive#parentReference", # This is always drive#parentReference.
149 "id": "A String", # The ID of the parent.
150 "isRoot": True or False, # Whether or not the parent is the root folder.
151 "parentLink": "A String", # A link to the parent.
152 },
153 ],
154 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400155 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -0400156 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500157 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
158 "mimeType": "A String", # The MIME type of the thumbnail.
159 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
160 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400161 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400162 "description": "A String", # A short description of the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400163 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Joe Gregorio075572b2012-07-09 16:53:09 -0400164 "editable": True or False, # Whether the file can be edited by the current user.
165 "kind": "drive#file", # The type of file. This is always drive#file.
166 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
167 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
168 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
169 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400170 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500171 "flashUsed": True or False, # Whether a flash was used to create the photo.
172 "exposureTime": 3.14, # The length of the exposure, in seconds.
173 "cameraMake": "A String", # The make of the camera used to create the photo.
174 "isoSpeed": 42, # The ISO speed used to create the photo.
175 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
176 "height": 42, # The height of the image in pixels.
177 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
Joe Gregorioad8013f2012-08-03 08:44:02 -0400178 "location": { # Geographic location information stored in the image.
179 "latitude": 3.14, # The latitude stored in the image.
180 "altitude": 3.14, # The altitude stored in the image.
181 "longitude": 3.14, # The longitude stored in the image.
182 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500183 "aperture": 3.14, # The aperture used to create the photo (f-number).
184 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
185 "width": 42, # The width of the image in pixels.
186 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400187 },
Joe Gregorio075572b2012-07-09 16:53:09 -0400188 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400189 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
190 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio075572b2012-07-09 16:53:09 -0400191 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
192 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
193 "withLink": True or False, # Whether the link is required for this permission.
194 "kind": "drive#permission", # This is always drive#permission.
195 "name": "A String", # The name for this permission.
196 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
197 "id": "A String", # The ID of the permission.
198 "authKey": "A String", # The authkey parameter required for this permission.
199 "etag": "A String", # The ETag of the permission.
200 "role": "A String", # The primary role for this user. Allowed values are:
201 # - owner
202 # - reader
203 # - writer
204 "photoLink": "A String", # A link to the profile photo, if available.
205 "type": "A String", # The account type. Allowed values are:
206 # - user
207 # - group
208 # - domain
209 # - anyone
210 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
211 "A String",
212 ],
213 "selfLink": "A String", # A link back to this permission.
214 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400215 "fileExtension": "A String", # The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400216 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400217 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -0400218}
219
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400220 pinned: boolean, Whether to pin the head revision of the new copy.
Joe Gregorio075572b2012-07-09 16:53:09 -0400221 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500222 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Joe Gregorio075572b2012-07-09 16:53:09 -0400223 sourceLanguage: string, The language of the original file to be translated.
224 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 -0400225 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 -0400226 timedTextTrackName: string, The timed text track name.
227 timedTextLanguage: string, The language of the timed text.
228
229Returns:
230 An object of the form:
231
232 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400233 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio075572b2012-07-09 16:53:09 -0400234 "thumbnailLink": "A String", # A link to the file's thumbnail.
235 "labels": { # A group of labels for the file.
236 "restricted": True or False, # Whether viewers are prevented from downloading this file.
237 "hidden": True or False, # Whether this file is hidden from the user.
238 "viewed": True or False, # Whether this file has been viewed by this user.
239 "starred": True or False, # Whether this file is starred by the user.
240 "trashed": True or False, # Whether this file has been trashed.
241 },
242 "indexableText": { # Indexable text attributes for the file (can only be written)
243 "text": "A String", # The text to be indexed for this file
244 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400245 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio075572b2012-07-09 16:53:09 -0400246 "etag": "A String", # ETag of the file.
247 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
248 "writersCanShare": True or False, # Whether writers can share the document with other users.
249 "id": "A String", # The id of the file.
250 "title": "A String", # The title of this file.
251 "ownerNames": [ # Name(s) of the owner(s) of this file.
252 "A String",
253 ],
254 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
255 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
256 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400257 # 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 -0400258 { # A reference to a file's parent.
259 "selfLink": "A String", # A link back to this reference.
260 "kind": "drive#parentReference", # This is always drive#parentReference.
261 "id": "A String", # The ID of the parent.
262 "isRoot": True or False, # Whether or not the parent is the root folder.
263 "parentLink": "A String", # A link to the parent.
264 },
265 ],
266 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400267 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -0400268 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500269 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
270 "mimeType": "A String", # The MIME type of the thumbnail.
271 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
272 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400273 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400274 "description": "A String", # A short description of the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400275 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Joe Gregorio075572b2012-07-09 16:53:09 -0400276 "editable": True or False, # Whether the file can be edited by the current user.
277 "kind": "drive#file", # The type of file. This is always drive#file.
278 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
279 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
280 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
281 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400282 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500283 "flashUsed": True or False, # Whether a flash was used to create the photo.
284 "exposureTime": 3.14, # The length of the exposure, in seconds.
285 "cameraMake": "A String", # The make of the camera used to create the photo.
286 "isoSpeed": 42, # The ISO speed used to create the photo.
287 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
288 "height": 42, # The height of the image in pixels.
289 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
Joe Gregorioad8013f2012-08-03 08:44:02 -0400290 "location": { # Geographic location information stored in the image.
291 "latitude": 3.14, # The latitude stored in the image.
292 "altitude": 3.14, # The altitude stored in the image.
293 "longitude": 3.14, # The longitude stored in the image.
294 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500295 "aperture": 3.14, # The aperture used to create the photo (f-number).
296 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
297 "width": 42, # The width of the image in pixels.
298 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400299 },
Joe Gregorio075572b2012-07-09 16:53:09 -0400300 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400301 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
302 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio075572b2012-07-09 16:53:09 -0400303 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
304 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
305 "withLink": True or False, # Whether the link is required for this permission.
306 "kind": "drive#permission", # This is always drive#permission.
307 "name": "A String", # The name for this permission.
308 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
309 "id": "A String", # The ID of the permission.
310 "authKey": "A String", # The authkey parameter required for this permission.
311 "etag": "A String", # The ETag of the permission.
312 "role": "A String", # The primary role for this user. Allowed values are:
313 # - owner
314 # - reader
315 # - writer
316 "photoLink": "A String", # A link to the profile photo, if available.
317 "type": "A String", # The account type. Allowed values are:
318 # - user
319 # - group
320 # - domain
321 # - anyone
322 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
323 "A String",
324 ],
325 "selfLink": "A String", # A link back to this permission.
326 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400327 "fileExtension": "A String", # The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400328 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400329 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -0400330 }</pre>
331</div>
332
333<div class="method">
334 <code class="details" id="delete">delete(fileId)</code>
335 <pre>Permanently deletes a file by ID. Skips the trash.
336
337Args:
338 fileId: string, The ID of the file to delete. (required)
339</pre>
340</div>
341
342<div class="method">
343 <code class="details" id="get">get(fileId, projection=None, updateViewedDate=None)</code>
344 <pre>Gets a file's metadata by ID.
345
346Args:
347 fileId: string, The ID for the file in question. (required)
Joe Gregorioad8013f2012-08-03 08:44:02 -0400348 projection: string, This parameter is deprecated and has no function.
Joe Gregorio075572b2012-07-09 16:53:09 -0400349 Allowed values
Joe Gregorioad8013f2012-08-03 08:44:02 -0400350 BASIC - Deprecated
351 FULL - Deprecated
Joe Gregorio075572b2012-07-09 16:53:09 -0400352 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
353
354Returns:
355 An object of the form:
356
357 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400358 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio075572b2012-07-09 16:53:09 -0400359 "thumbnailLink": "A String", # A link to the file's thumbnail.
360 "labels": { # A group of labels for the file.
361 "restricted": True or False, # Whether viewers are prevented from downloading this file.
362 "hidden": True or False, # Whether this file is hidden from the user.
363 "viewed": True or False, # Whether this file has been viewed by this user.
364 "starred": True or False, # Whether this file is starred by the user.
365 "trashed": True or False, # Whether this file has been trashed.
366 },
367 "indexableText": { # Indexable text attributes for the file (can only be written)
368 "text": "A String", # The text to be indexed for this file
369 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400370 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio075572b2012-07-09 16:53:09 -0400371 "etag": "A String", # ETag of the file.
372 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
373 "writersCanShare": True or False, # Whether writers can share the document with other users.
374 "id": "A String", # The id of the file.
375 "title": "A String", # The title of this file.
376 "ownerNames": [ # Name(s) of the owner(s) of this file.
377 "A String",
378 ],
379 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
380 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
381 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400382 # 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 -0400383 { # A reference to a file's parent.
384 "selfLink": "A String", # A link back to this reference.
385 "kind": "drive#parentReference", # This is always drive#parentReference.
386 "id": "A String", # The ID of the parent.
387 "isRoot": True or False, # Whether or not the parent is the root folder.
388 "parentLink": "A String", # A link to the parent.
389 },
390 ],
391 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400392 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -0400393 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500394 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
395 "mimeType": "A String", # The MIME type of the thumbnail.
396 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
397 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400398 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400399 "description": "A String", # A short description of the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400400 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Joe Gregorio075572b2012-07-09 16:53:09 -0400401 "editable": True or False, # Whether the file can be edited by the current user.
402 "kind": "drive#file", # The type of file. This is always drive#file.
403 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
404 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
405 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
406 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400407 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500408 "flashUsed": True or False, # Whether a flash was used to create the photo.
409 "exposureTime": 3.14, # The length of the exposure, in seconds.
410 "cameraMake": "A String", # The make of the camera used to create the photo.
411 "isoSpeed": 42, # The ISO speed used to create the photo.
412 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
413 "height": 42, # The height of the image in pixels.
414 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
Joe Gregorioad8013f2012-08-03 08:44:02 -0400415 "location": { # Geographic location information stored in the image.
416 "latitude": 3.14, # The latitude stored in the image.
417 "altitude": 3.14, # The altitude stored in the image.
418 "longitude": 3.14, # The longitude stored in the image.
419 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500420 "aperture": 3.14, # The aperture used to create the photo (f-number).
421 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
422 "width": 42, # The width of the image in pixels.
423 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400424 },
Joe Gregorio075572b2012-07-09 16:53:09 -0400425 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400426 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
427 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio075572b2012-07-09 16:53:09 -0400428 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
429 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
430 "withLink": True or False, # Whether the link is required for this permission.
431 "kind": "drive#permission", # This is always drive#permission.
432 "name": "A String", # The name for this permission.
433 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
434 "id": "A String", # The ID of the permission.
435 "authKey": "A String", # The authkey parameter required for this permission.
436 "etag": "A String", # The ETag of the permission.
437 "role": "A String", # The primary role for this user. Allowed values are:
438 # - owner
439 # - reader
440 # - writer
441 "photoLink": "A String", # A link to the profile photo, if available.
442 "type": "A String", # The account type. Allowed values are:
443 # - user
444 # - group
445 # - domain
446 # - anyone
447 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
448 "A String",
449 ],
450 "selfLink": "A String", # A link back to this permission.
451 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400452 "fileExtension": "A String", # The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400453 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400454 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -0400455 }</pre>
456</div>
457
458<div class="method">
459 <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>
460 <pre>Insert a new file.
461
462Args:
463 body: object, The request body.
464 The object takes the form of:
465
466{ # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400467 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio075572b2012-07-09 16:53:09 -0400468 "thumbnailLink": "A String", # A link to the file's thumbnail.
469 "labels": { # A group of labels for the file.
470 "restricted": True or False, # Whether viewers are prevented from downloading this file.
471 "hidden": True or False, # Whether this file is hidden from the user.
472 "viewed": True or False, # Whether this file has been viewed by this user.
473 "starred": True or False, # Whether this file is starred by the user.
474 "trashed": True or False, # Whether this file has been trashed.
475 },
476 "indexableText": { # Indexable text attributes for the file (can only be written)
477 "text": "A String", # The text to be indexed for this file
478 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400479 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio075572b2012-07-09 16:53:09 -0400480 "etag": "A String", # ETag of the file.
481 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
482 "writersCanShare": True or False, # Whether writers can share the document with other users.
483 "id": "A String", # The id of the file.
484 "title": "A String", # The title of this file.
485 "ownerNames": [ # Name(s) of the owner(s) of this file.
486 "A String",
487 ],
488 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
489 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
490 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400491 # 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 -0400492 { # A reference to a file's parent.
493 "selfLink": "A String", # A link back to this reference.
494 "kind": "drive#parentReference", # This is always drive#parentReference.
495 "id": "A String", # The ID of the parent.
496 "isRoot": True or False, # Whether or not the parent is the root folder.
497 "parentLink": "A String", # A link to the parent.
498 },
499 ],
500 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400501 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -0400502 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500503 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
504 "mimeType": "A String", # The MIME type of the thumbnail.
505 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
506 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400507 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400508 "description": "A String", # A short description of the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400509 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Joe Gregorio075572b2012-07-09 16:53:09 -0400510 "editable": True or False, # Whether the file can be edited by the current user.
511 "kind": "drive#file", # The type of file. This is always drive#file.
512 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
513 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
514 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
515 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400516 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500517 "flashUsed": True or False, # Whether a flash was used to create the photo.
518 "exposureTime": 3.14, # The length of the exposure, in seconds.
519 "cameraMake": "A String", # The make of the camera used to create the photo.
520 "isoSpeed": 42, # The ISO speed used to create the photo.
521 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
522 "height": 42, # The height of the image in pixels.
523 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
Joe Gregorioad8013f2012-08-03 08:44:02 -0400524 "location": { # Geographic location information stored in the image.
525 "latitude": 3.14, # The latitude stored in the image.
526 "altitude": 3.14, # The altitude stored in the image.
527 "longitude": 3.14, # The longitude stored in the image.
528 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500529 "aperture": 3.14, # The aperture used to create the photo (f-number).
530 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
531 "width": 42, # The width of the image in pixels.
532 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400533 },
Joe Gregorio075572b2012-07-09 16:53:09 -0400534 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400535 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
536 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio075572b2012-07-09 16:53:09 -0400537 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
538 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
539 "withLink": True or False, # Whether the link is required for this permission.
540 "kind": "drive#permission", # This is always drive#permission.
541 "name": "A String", # The name for this permission.
542 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
543 "id": "A String", # The ID of the permission.
544 "authKey": "A String", # The authkey parameter required for this permission.
545 "etag": "A String", # The ETag of the permission.
546 "role": "A String", # The primary role for this user. Allowed values are:
547 # - owner
548 # - reader
549 # - writer
550 "photoLink": "A String", # A link to the profile photo, if available.
551 "type": "A String", # The account type. Allowed values are:
552 # - user
553 # - group
554 # - domain
555 # - anyone
556 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
557 "A String",
558 ],
559 "selfLink": "A String", # A link back to this permission.
560 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400561 "fileExtension": "A String", # The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400562 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400563 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -0400564}
565
566 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
567 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500568 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Joe Gregorio075572b2012-07-09 16:53:09 -0400569 sourceLanguage: string, The language of the original file to be translated.
570 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
571 targetLanguage: string, Target language to translate the file to. If no sourceLanguage is provided, the API will attempt to detect the language.
572 timedTextLanguage: string, The language of the timed text.
573 timedTextTrackName: string, The timed text track name.
574 pinned: boolean, Whether to pin the head revision of the uploaded file.
575
576Returns:
577 An object of the form:
578
579 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400580 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio075572b2012-07-09 16:53:09 -0400581 "thumbnailLink": "A String", # A link to the file's thumbnail.
582 "labels": { # A group of labels for the file.
583 "restricted": True or False, # Whether viewers are prevented from downloading this file.
584 "hidden": True or False, # Whether this file is hidden from the user.
585 "viewed": True or False, # Whether this file has been viewed by this user.
586 "starred": True or False, # Whether this file is starred by the user.
587 "trashed": True or False, # Whether this file has been trashed.
588 },
589 "indexableText": { # Indexable text attributes for the file (can only be written)
590 "text": "A String", # The text to be indexed for this file
591 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400592 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio075572b2012-07-09 16:53:09 -0400593 "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.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400614 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -0400615 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500616 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
617 "mimeType": "A String", # The MIME type of the thumbnail.
618 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
619 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400620 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400621 "description": "A String", # A short description of the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400622 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Joe Gregorio075572b2012-07-09 16:53:09 -0400623 "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.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400629 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500630 "flashUsed": True or False, # Whether a flash was used to create the photo.
631 "exposureTime": 3.14, # The length of the exposure, in seconds.
632 "cameraMake": "A String", # The make of the camera used to create the photo.
633 "isoSpeed": 42, # The ISO speed used to create the photo.
634 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
635 "height": 42, # The height of the image in pixels.
636 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
Joe Gregorioad8013f2012-08-03 08:44:02 -0400637 "location": { # Geographic location information stored in the image.
638 "latitude": 3.14, # The latitude stored in the image.
639 "altitude": 3.14, # The altitude stored in the image.
640 "longitude": 3.14, # The longitude stored in the image.
641 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500642 "aperture": 3.14, # The aperture used to create the photo (f-number).
643 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
644 "width": 42, # The width of the image in pixels.
645 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400646 },
Joe Gregorio075572b2012-07-09 16:53:09 -0400647 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400648 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
649 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio075572b2012-07-09 16:53:09 -0400650 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
651 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
652 "withLink": True or False, # Whether the link is required for this permission.
653 "kind": "drive#permission", # This is always drive#permission.
654 "name": "A String", # The name for this permission.
655 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
656 "id": "A String", # The ID of the permission.
657 "authKey": "A String", # The authkey parameter required for this permission.
658 "etag": "A String", # The ETag of the permission.
659 "role": "A String", # The primary role for this user. Allowed values are:
660 # - owner
661 # - reader
662 # - writer
663 "photoLink": "A String", # A link to the profile photo, if available.
664 "type": "A String", # The account type. Allowed values are:
665 # - user
666 # - group
667 # - domain
668 # - anyone
669 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
670 "A String",
671 ],
672 "selfLink": "A String", # A link back to this permission.
673 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400674 "fileExtension": "A String", # The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400675 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400676 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -0400677 }</pre>
678</div>
679
680<div class="method">
681 <code class="details" id="list">list(q=None, projection=None, pageToken=None, maxResults=None)</code>
682 <pre>Lists the user's files.
683
684Args:
685 q: string, Query string for searching files.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400686 projection: string, This parameter is deprecated and has no function.
Joe Gregorio075572b2012-07-09 16:53:09 -0400687 Allowed values
Joe Gregorioad8013f2012-08-03 08:44:02 -0400688 BASIC - Deprecated
689 FULL - Deprecated
Joe Gregorio075572b2012-07-09 16:53:09 -0400690 pageToken: string, Page token for files.
691 maxResults: integer, Maximum number of files to return.
692
693Returns:
694 An object of the form:
695
696 { # A list of files.
697 "nextPageToken": "A String", # The page token for the next page of files.
698 "kind": "drive#fileList", # This is always drive#fileList.
699 "items": [ # The actual list of files.
700 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400701 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio075572b2012-07-09 16:53:09 -0400702 "thumbnailLink": "A String", # A link to the file's thumbnail.
703 "labels": { # A group of labels for the file.
704 "restricted": True or False, # Whether viewers are prevented from downloading this file.
705 "hidden": True or False, # Whether this file is hidden from the user.
706 "viewed": True or False, # Whether this file has been viewed by this user.
707 "starred": True or False, # Whether this file is starred by the user.
708 "trashed": True or False, # Whether this file has been trashed.
709 },
710 "indexableText": { # Indexable text attributes for the file (can only be written)
711 "text": "A String", # The text to be indexed for this file
712 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400713 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio075572b2012-07-09 16:53:09 -0400714 "etag": "A String", # ETag of the file.
715 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
716 "writersCanShare": True or False, # Whether writers can share the document with other users.
717 "id": "A String", # The id of the file.
718 "title": "A String", # The title of this file.
719 "ownerNames": [ # Name(s) of the owner(s) of this file.
720 "A String",
721 ],
722 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
723 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
724 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400725 # 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 -0400726 { # A reference to a file's parent.
727 "selfLink": "A String", # A link back to this reference.
728 "kind": "drive#parentReference", # This is always drive#parentReference.
729 "id": "A String", # The ID of the parent.
730 "isRoot": True or False, # Whether or not the parent is the root folder.
731 "parentLink": "A String", # A link to the parent.
732 },
733 ],
734 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400735 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -0400736 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500737 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
738 "mimeType": "A String", # The MIME type of the thumbnail.
739 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
740 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400741 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400742 "description": "A String", # A short description of the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400743 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Joe Gregorio075572b2012-07-09 16:53:09 -0400744 "editable": True or False, # Whether the file can be edited by the current user.
745 "kind": "drive#file", # The type of file. This is always drive#file.
746 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
747 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
748 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
749 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400750 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500751 "flashUsed": True or False, # Whether a flash was used to create the photo.
752 "exposureTime": 3.14, # The length of the exposure, in seconds.
753 "cameraMake": "A String", # The make of the camera used to create the photo.
754 "isoSpeed": 42, # The ISO speed used to create the photo.
755 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
756 "height": 42, # The height of the image in pixels.
757 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
Joe Gregorioad8013f2012-08-03 08:44:02 -0400758 "location": { # Geographic location information stored in the image.
759 "latitude": 3.14, # The latitude stored in the image.
760 "altitude": 3.14, # The altitude stored in the image.
761 "longitude": 3.14, # The longitude stored in the image.
762 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500763 "aperture": 3.14, # The aperture used to create the photo (f-number).
764 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
765 "width": 42, # The width of the image in pixels.
766 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400767 },
Joe Gregorio075572b2012-07-09 16:53:09 -0400768 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400769 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
770 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio075572b2012-07-09 16:53:09 -0400771 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
772 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
773 "withLink": True or False, # Whether the link is required for this permission.
774 "kind": "drive#permission", # This is always drive#permission.
775 "name": "A String", # The name for this permission.
776 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
777 "id": "A String", # The ID of the permission.
778 "authKey": "A String", # The authkey parameter required for this permission.
779 "etag": "A String", # The ETag of the permission.
780 "role": "A String", # The primary role for this user. Allowed values are:
781 # - owner
782 # - reader
783 # - writer
784 "photoLink": "A String", # A link to the profile photo, if available.
785 "type": "A String", # The account type. Allowed values are:
786 # - user
787 # - group
788 # - domain
789 # - anyone
790 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
791 "A String",
792 ],
793 "selfLink": "A String", # A link back to this permission.
794 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400795 "fileExtension": "A String", # The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400796 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400797 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -0400798 },
799 ],
800 "nextLink": "A String", # A link to the next page of files.
801 "etag": "A String", # The ETag of the list.
802 "selfLink": "A String", # A link back to this list.
803 }</pre>
804</div>
805
806<div class="method">
807 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
808 <pre>Retrieves the next page of results.
809
810Args:
811 previous_request: The request for the previous page. (required)
812 previous_response: The response from the request for the previous page. (required)
813
814Returns:
815 A request object that you can call 'execute()' on to request the next
816 page. Returns None if there are no more items in the collection.
817 </pre>
818</div>
819
820<div class="method">
821 <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>
822 <pre>Updates file metadata and/or content. This method supports patch semantics.
823
824Args:
825 fileId: string, The ID of the file to update. (required)
826 body: object, The request body. (required)
827 The object takes the form of:
828
829{ # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400830 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio075572b2012-07-09 16:53:09 -0400831 "thumbnailLink": "A String", # A link to the file's thumbnail.
832 "labels": { # A group of labels for the file.
833 "restricted": True or False, # Whether viewers are prevented from downloading this file.
834 "hidden": True or False, # Whether this file is hidden from the user.
835 "viewed": True or False, # Whether this file has been viewed by this user.
836 "starred": True or False, # Whether this file is starred by the user.
837 "trashed": True or False, # Whether this file has been trashed.
838 },
839 "indexableText": { # Indexable text attributes for the file (can only be written)
840 "text": "A String", # The text to be indexed for this file
841 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400842 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio075572b2012-07-09 16:53:09 -0400843 "etag": "A String", # ETag of the file.
844 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
845 "writersCanShare": True or False, # Whether writers can share the document with other users.
846 "id": "A String", # The id of the file.
847 "title": "A String", # The title of this file.
848 "ownerNames": [ # Name(s) of the owner(s) of this file.
849 "A String",
850 ],
851 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
852 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
853 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400854 # 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 -0400855 { # A reference to a file's parent.
856 "selfLink": "A String", # A link back to this reference.
857 "kind": "drive#parentReference", # This is always drive#parentReference.
858 "id": "A String", # The ID of the parent.
859 "isRoot": True or False, # Whether or not the parent is the root folder.
860 "parentLink": "A String", # A link to the parent.
861 },
862 ],
863 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400864 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -0400865 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500866 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
867 "mimeType": "A String", # The MIME type of the thumbnail.
868 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
869 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400870 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400871 "description": "A String", # A short description of the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400872 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Joe Gregorio075572b2012-07-09 16:53:09 -0400873 "editable": True or False, # Whether the file can be edited by the current user.
874 "kind": "drive#file", # The type of file. This is always drive#file.
875 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
876 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
877 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
878 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400879 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500880 "flashUsed": True or False, # Whether a flash was used to create the photo.
881 "exposureTime": 3.14, # The length of the exposure, in seconds.
882 "cameraMake": "A String", # The make of the camera used to create the photo.
883 "isoSpeed": 42, # The ISO speed used to create the photo.
884 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
885 "height": 42, # The height of the image in pixels.
886 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
Joe Gregorioad8013f2012-08-03 08:44:02 -0400887 "location": { # Geographic location information stored in the image.
888 "latitude": 3.14, # The latitude stored in the image.
889 "altitude": 3.14, # The altitude stored in the image.
890 "longitude": 3.14, # The longitude stored in the image.
891 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500892 "aperture": 3.14, # The aperture used to create the photo (f-number).
893 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
894 "width": 42, # The width of the image in pixels.
895 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400896 },
Joe Gregorio075572b2012-07-09 16:53:09 -0400897 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400898 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
899 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio075572b2012-07-09 16:53:09 -0400900 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
901 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
902 "withLink": True or False, # Whether the link is required for this permission.
903 "kind": "drive#permission", # This is always drive#permission.
904 "name": "A String", # The name for this permission.
905 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
906 "id": "A String", # The ID of the permission.
907 "authKey": "A String", # The authkey parameter required for this permission.
908 "etag": "A String", # The ETag of the permission.
909 "role": "A String", # The primary role for this user. Allowed values are:
910 # - owner
911 # - reader
912 # - writer
913 "photoLink": "A String", # A link to the profile photo, if available.
914 "type": "A String", # The account type. Allowed values are:
915 # - user
916 # - group
917 # - domain
918 # - anyone
919 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
920 "A String",
921 ],
922 "selfLink": "A String", # A link back to this permission.
923 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400924 "fileExtension": "A String", # The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400925 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400926 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -0400927}
928
929 newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision will be replaced.
930 pinned: boolean, Whether to pin the new revision.
931 targetLanguage: string, Target language to translate the file to. If no sourceLanguage is provided, the API will attempt to detect the language.
932 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500933 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Joe Gregorio075572b2012-07-09 16:53:09 -0400934 sourceLanguage: string, The language of the original file to be translated.
935 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
936 timedTextTrackName: string, The timed text track name.
937 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
938 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
939 timedTextLanguage: string, The language of the timed text.
940
941Returns:
942 An object of the form:
943
944 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400945 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio075572b2012-07-09 16:53:09 -0400946 "thumbnailLink": "A String", # A link to the file's thumbnail.
947 "labels": { # A group of labels for the file.
948 "restricted": True or False, # Whether viewers are prevented from downloading this file.
949 "hidden": True or False, # Whether this file is hidden from the user.
950 "viewed": True or False, # Whether this file has been viewed by this user.
951 "starred": True or False, # Whether this file is starred by the user.
952 "trashed": True or False, # Whether this file has been trashed.
953 },
954 "indexableText": { # Indexable text attributes for the file (can only be written)
955 "text": "A String", # The text to be indexed for this file
956 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400957 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio075572b2012-07-09 16:53:09 -0400958 "etag": "A String", # ETag of the file.
959 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
960 "writersCanShare": True or False, # Whether writers can share the document with other users.
961 "id": "A String", # The id of the file.
962 "title": "A String", # The title of this file.
963 "ownerNames": [ # Name(s) of the owner(s) of this file.
964 "A String",
965 ],
966 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
967 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
968 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400969 # 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 -0400970 { # A reference to a file's parent.
971 "selfLink": "A String", # A link back to this reference.
972 "kind": "drive#parentReference", # This is always drive#parentReference.
973 "id": "A String", # The ID of the parent.
974 "isRoot": True or False, # Whether or not the parent is the root folder.
975 "parentLink": "A String", # A link to the parent.
976 },
977 ],
978 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400979 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -0400980 },
Joe Gregoriod67010d2012-11-05 08:57:06 -0500981 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
982 "mimeType": "A String", # The MIME type of the thumbnail.
983 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
984 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400985 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400986 "description": "A String", # A short description of the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400987 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Joe Gregorio075572b2012-07-09 16:53:09 -0400988 "editable": True or False, # Whether the file can be edited by the current user.
989 "kind": "drive#file", # The type of file. This is always drive#file.
990 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
991 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
992 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
993 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400994 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500995 "flashUsed": True or False, # Whether a flash was used to create the photo.
996 "exposureTime": 3.14, # The length of the exposure, in seconds.
997 "cameraMake": "A String", # The make of the camera used to create the photo.
998 "isoSpeed": 42, # The ISO speed used to create the photo.
999 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1000 "height": 42, # The height of the image in pixels.
1001 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
Joe Gregorioad8013f2012-08-03 08:44:02 -04001002 "location": { # Geographic location information stored in the image.
1003 "latitude": 3.14, # The latitude stored in the image.
1004 "altitude": 3.14, # The altitude stored in the image.
1005 "longitude": 3.14, # The longitude stored in the image.
1006 },
Joe Gregoriod67010d2012-11-05 08:57:06 -05001007 "aperture": 3.14, # The aperture used to create the photo (f-number).
1008 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1009 "width": 42, # The width of the image in pixels.
1010 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001011 },
Joe Gregorio075572b2012-07-09 16:53:09 -04001012 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001013 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
1014 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio075572b2012-07-09 16:53:09 -04001015 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
1016 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
1017 "withLink": True or False, # Whether the link is required for this permission.
1018 "kind": "drive#permission", # This is always drive#permission.
1019 "name": "A String", # The name for this permission.
1020 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
1021 "id": "A String", # The ID of the permission.
1022 "authKey": "A String", # The authkey parameter required for this permission.
1023 "etag": "A String", # The ETag of the permission.
1024 "role": "A String", # The primary role for this user. Allowed values are:
1025 # - owner
1026 # - reader
1027 # - writer
1028 "photoLink": "A String", # A link to the profile photo, if available.
1029 "type": "A String", # The account type. Allowed values are:
1030 # - user
1031 # - group
1032 # - domain
1033 # - anyone
1034 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1035 "A String",
1036 ],
1037 "selfLink": "A String", # A link back to this permission.
1038 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001039 "fileExtension": "A String", # The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001040 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001041 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04001042 }</pre>
1043</div>
1044
1045<div class="method">
1046 <code class="details" id="touch">touch(fileId)</code>
1047 <pre>Set the file's updated time to the current server time.
1048
1049Args:
1050 fileId: string, The ID of the file to update. (required)
1051
1052Returns:
1053 An object of the form:
1054
1055 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001056 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio075572b2012-07-09 16:53:09 -04001057 "thumbnailLink": "A String", # A link to the file's thumbnail.
1058 "labels": { # A group of labels for the file.
1059 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1060 "hidden": True or False, # Whether this file is hidden from the user.
1061 "viewed": True or False, # Whether this file has been viewed by this user.
1062 "starred": True or False, # Whether this file is starred by the user.
1063 "trashed": True or False, # Whether this file has been trashed.
1064 },
1065 "indexableText": { # Indexable text attributes for the file (can only be written)
1066 "text": "A String", # The text to be indexed for this file
1067 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001068 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio075572b2012-07-09 16:53:09 -04001069 "etag": "A String", # ETag of the file.
1070 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
1071 "writersCanShare": True or False, # Whether writers can share the document with other users.
1072 "id": "A String", # The id of the file.
1073 "title": "A String", # The title of this file.
1074 "ownerNames": [ # Name(s) of the owner(s) of this file.
1075 "A String",
1076 ],
1077 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1078 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1079 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -04001080 # 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 -04001081 { # A reference to a file's parent.
1082 "selfLink": "A String", # A link back to this reference.
1083 "kind": "drive#parentReference", # This is always drive#parentReference.
1084 "id": "A String", # The ID of the parent.
1085 "isRoot": True or False, # Whether or not the parent is the root folder.
1086 "parentLink": "A String", # A link to the parent.
1087 },
1088 ],
1089 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -04001090 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -04001091 },
Joe Gregoriod67010d2012-11-05 08:57:06 -05001092 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1093 "mimeType": "A String", # The MIME type of the thumbnail.
1094 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1095 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001096 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001097 "description": "A String", # A short description of the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001098 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Joe Gregorio075572b2012-07-09 16:53:09 -04001099 "editable": True or False, # Whether the file can be edited by the current user.
1100 "kind": "drive#file", # The type of file. This is always drive#file.
1101 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1102 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
1103 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1104 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001105 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001106 "flashUsed": True or False, # Whether a flash was used to create the photo.
1107 "exposureTime": 3.14, # The length of the exposure, in seconds.
1108 "cameraMake": "A String", # The make of the camera used to create the photo.
1109 "isoSpeed": 42, # The ISO speed used to create the photo.
1110 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1111 "height": 42, # The height of the image in pixels.
1112 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
Joe Gregorioad8013f2012-08-03 08:44:02 -04001113 "location": { # Geographic location information stored in the image.
1114 "latitude": 3.14, # The latitude stored in the image.
1115 "altitude": 3.14, # The altitude stored in the image.
1116 "longitude": 3.14, # The longitude stored in the image.
1117 },
Joe Gregoriod67010d2012-11-05 08:57:06 -05001118 "aperture": 3.14, # The aperture used to create the photo (f-number).
1119 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1120 "width": 42, # The width of the image in pixels.
1121 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001122 },
Joe Gregorio075572b2012-07-09 16:53:09 -04001123 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001124 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
1125 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio075572b2012-07-09 16:53:09 -04001126 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
1127 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
1128 "withLink": True or False, # Whether the link is required for this permission.
1129 "kind": "drive#permission", # This is always drive#permission.
1130 "name": "A String", # The name for this permission.
1131 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
1132 "id": "A String", # The ID of the permission.
1133 "authKey": "A String", # The authkey parameter required for this permission.
1134 "etag": "A String", # The ETag of the permission.
1135 "role": "A String", # The primary role for this user. Allowed values are:
1136 # - owner
1137 # - reader
1138 # - writer
1139 "photoLink": "A String", # A link to the profile photo, if available.
1140 "type": "A String", # The account type. Allowed values are:
1141 # - user
1142 # - group
1143 # - domain
1144 # - anyone
1145 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1146 "A String",
1147 ],
1148 "selfLink": "A String", # A link back to this permission.
1149 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001150 "fileExtension": "A String", # The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001151 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001152 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04001153 }</pre>
1154</div>
1155
1156<div class="method">
1157 <code class="details" id="trash">trash(fileId)</code>
1158 <pre>Moves a file to the trash.
1159
1160Args:
1161 fileId: string, The ID of the file to trash. (required)
1162
1163Returns:
1164 An object of the form:
1165
1166 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001167 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio075572b2012-07-09 16:53:09 -04001168 "thumbnailLink": "A String", # A link to the file's thumbnail.
1169 "labels": { # A group of labels for the file.
1170 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1171 "hidden": True or False, # Whether this file is hidden from the user.
1172 "viewed": True or False, # Whether this file has been viewed by this user.
1173 "starred": True or False, # Whether this file is starred by the user.
1174 "trashed": True or False, # Whether this file has been trashed.
1175 },
1176 "indexableText": { # Indexable text attributes for the file (can only be written)
1177 "text": "A String", # The text to be indexed for this file
1178 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001179 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio075572b2012-07-09 16:53:09 -04001180 "etag": "A String", # ETag of the file.
1181 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
1182 "writersCanShare": True or False, # Whether writers can share the document with other users.
1183 "id": "A String", # The id of the file.
1184 "title": "A String", # The title of this file.
1185 "ownerNames": [ # Name(s) of the owner(s) of this file.
1186 "A String",
1187 ],
1188 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1189 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1190 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -04001191 # 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 -04001192 { # A reference to a file's parent.
1193 "selfLink": "A String", # A link back to this reference.
1194 "kind": "drive#parentReference", # This is always drive#parentReference.
1195 "id": "A String", # The ID of the parent.
1196 "isRoot": True or False, # Whether or not the parent is the root folder.
1197 "parentLink": "A String", # A link to the parent.
1198 },
1199 ],
1200 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -04001201 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -04001202 },
Joe Gregoriod67010d2012-11-05 08:57:06 -05001203 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1204 "mimeType": "A String", # The MIME type of the thumbnail.
1205 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1206 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001207 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001208 "description": "A String", # A short description of the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001209 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Joe Gregorio075572b2012-07-09 16:53:09 -04001210 "editable": True or False, # Whether the file can be edited by the current user.
1211 "kind": "drive#file", # The type of file. This is always drive#file.
1212 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1213 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
1214 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1215 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001216 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001217 "flashUsed": True or False, # Whether a flash was used to create the photo.
1218 "exposureTime": 3.14, # The length of the exposure, in seconds.
1219 "cameraMake": "A String", # The make of the camera used to create the photo.
1220 "isoSpeed": 42, # The ISO speed used to create the photo.
1221 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1222 "height": 42, # The height of the image in pixels.
1223 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
Joe Gregorioad8013f2012-08-03 08:44:02 -04001224 "location": { # Geographic location information stored in the image.
1225 "latitude": 3.14, # The latitude stored in the image.
1226 "altitude": 3.14, # The altitude stored in the image.
1227 "longitude": 3.14, # The longitude stored in the image.
1228 },
Joe Gregoriod67010d2012-11-05 08:57:06 -05001229 "aperture": 3.14, # The aperture used to create the photo (f-number).
1230 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1231 "width": 42, # The width of the image in pixels.
1232 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001233 },
Joe Gregorio075572b2012-07-09 16:53:09 -04001234 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001235 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
1236 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio075572b2012-07-09 16:53:09 -04001237 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
1238 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
1239 "withLink": True or False, # Whether the link is required for this permission.
1240 "kind": "drive#permission", # This is always drive#permission.
1241 "name": "A String", # The name for this permission.
1242 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
1243 "id": "A String", # The ID of the permission.
1244 "authKey": "A String", # The authkey parameter required for this permission.
1245 "etag": "A String", # The ETag of the permission.
1246 "role": "A String", # The primary role for this user. Allowed values are:
1247 # - owner
1248 # - reader
1249 # - writer
1250 "photoLink": "A String", # A link to the profile photo, if available.
1251 "type": "A String", # The account type. Allowed values are:
1252 # - user
1253 # - group
1254 # - domain
1255 # - anyone
1256 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1257 "A String",
1258 ],
1259 "selfLink": "A String", # A link back to this permission.
1260 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001261 "fileExtension": "A String", # The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001262 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001263 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04001264 }</pre>
1265</div>
1266
1267<div class="method">
1268 <code class="details" id="untrash">untrash(fileId)</code>
1269 <pre>Restores a file from the trash.
1270
1271Args:
1272 fileId: string, The ID of the file to untrash. (required)
1273
1274Returns:
1275 An object of the form:
1276
1277 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001278 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio075572b2012-07-09 16:53:09 -04001279 "thumbnailLink": "A String", # A link to the file's thumbnail.
1280 "labels": { # A group of labels for the file.
1281 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1282 "hidden": True or False, # Whether this file is hidden from the user.
1283 "viewed": True or False, # Whether this file has been viewed by this user.
1284 "starred": True or False, # Whether this file is starred by the user.
1285 "trashed": True or False, # Whether this file has been trashed.
1286 },
1287 "indexableText": { # Indexable text attributes for the file (can only be written)
1288 "text": "A String", # The text to be indexed for this file
1289 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001290 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio075572b2012-07-09 16:53:09 -04001291 "etag": "A String", # ETag of the file.
1292 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
1293 "writersCanShare": True or False, # Whether writers can share the document with other users.
1294 "id": "A String", # The id of the file.
1295 "title": "A String", # The title of this file.
1296 "ownerNames": [ # Name(s) of the owner(s) of this file.
1297 "A String",
1298 ],
1299 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1300 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1301 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -04001302 # 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 -04001303 { # A reference to a file's parent.
1304 "selfLink": "A String", # A link back to this reference.
1305 "kind": "drive#parentReference", # This is always drive#parentReference.
1306 "id": "A String", # The ID of the parent.
1307 "isRoot": True or False, # Whether or not the parent is the root folder.
1308 "parentLink": "A String", # A link to the parent.
1309 },
1310 ],
1311 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -04001312 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -04001313 },
Joe Gregoriod67010d2012-11-05 08:57:06 -05001314 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1315 "mimeType": "A String", # The MIME type of the thumbnail.
1316 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1317 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001318 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001319 "description": "A String", # A short description of the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001320 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Joe Gregorio075572b2012-07-09 16:53:09 -04001321 "editable": True or False, # Whether the file can be edited by the current user.
1322 "kind": "drive#file", # The type of file. This is always drive#file.
1323 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1324 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
1325 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1326 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001327 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001328 "flashUsed": True or False, # Whether a flash was used to create the photo.
1329 "exposureTime": 3.14, # The length of the exposure, in seconds.
1330 "cameraMake": "A String", # The make of the camera used to create the photo.
1331 "isoSpeed": 42, # The ISO speed used to create the photo.
1332 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1333 "height": 42, # The height of the image in pixels.
1334 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
Joe Gregorioad8013f2012-08-03 08:44:02 -04001335 "location": { # Geographic location information stored in the image.
1336 "latitude": 3.14, # The latitude stored in the image.
1337 "altitude": 3.14, # The altitude stored in the image.
1338 "longitude": 3.14, # The longitude stored in the image.
1339 },
Joe Gregoriod67010d2012-11-05 08:57:06 -05001340 "aperture": 3.14, # The aperture used to create the photo (f-number).
1341 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1342 "width": 42, # The width of the image in pixels.
1343 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001344 },
Joe Gregorio075572b2012-07-09 16:53:09 -04001345 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001346 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
1347 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio075572b2012-07-09 16:53:09 -04001348 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
1349 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
1350 "withLink": True or False, # Whether the link is required for this permission.
1351 "kind": "drive#permission", # This is always drive#permission.
1352 "name": "A String", # The name for this permission.
1353 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
1354 "id": "A String", # The ID of the permission.
1355 "authKey": "A String", # The authkey parameter required for this permission.
1356 "etag": "A String", # The ETag of the permission.
1357 "role": "A String", # The primary role for this user. Allowed values are:
1358 # - owner
1359 # - reader
1360 # - writer
1361 "photoLink": "A String", # A link to the profile photo, if available.
1362 "type": "A String", # The account type. Allowed values are:
1363 # - user
1364 # - group
1365 # - domain
1366 # - anyone
1367 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1368 "A String",
1369 ],
1370 "selfLink": "A String", # A link back to this permission.
1371 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001372 "fileExtension": "A String", # The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001373 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001374 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04001375 }</pre>
1376</div>
1377
1378<div class="method">
1379 <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>
1380 <pre>Updates file metadata and/or content
1381
1382Args:
1383 fileId: string, The ID of the file to update. (required)
1384 body: object, The request body.
1385 The object takes the form of:
1386
1387{ # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001388 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio075572b2012-07-09 16:53:09 -04001389 "thumbnailLink": "A String", # A link to the file's thumbnail.
1390 "labels": { # A group of labels for the file.
1391 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1392 "hidden": True or False, # Whether this file is hidden from the user.
1393 "viewed": True or False, # Whether this file has been viewed by this user.
1394 "starred": True or False, # Whether this file is starred by the user.
1395 "trashed": True or False, # Whether this file has been trashed.
1396 },
1397 "indexableText": { # Indexable text attributes for the file (can only be written)
1398 "text": "A String", # The text to be indexed for this file
1399 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001400 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio075572b2012-07-09 16:53:09 -04001401 "etag": "A String", # ETag of the file.
1402 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
1403 "writersCanShare": True or False, # Whether writers can share the document with other users.
1404 "id": "A String", # The id of the file.
1405 "title": "A String", # The title of this file.
1406 "ownerNames": [ # Name(s) of the owner(s) of this file.
1407 "A String",
1408 ],
1409 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1410 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1411 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -04001412 # 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 -04001413 { # A reference to a file's parent.
1414 "selfLink": "A String", # A link back to this reference.
1415 "kind": "drive#parentReference", # This is always drive#parentReference.
1416 "id": "A String", # The ID of the parent.
1417 "isRoot": True or False, # Whether or not the parent is the root folder.
1418 "parentLink": "A String", # A link to the parent.
1419 },
1420 ],
1421 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -04001422 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -04001423 },
Joe Gregoriod67010d2012-11-05 08:57:06 -05001424 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1425 "mimeType": "A String", # The MIME type of the thumbnail.
1426 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1427 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001428 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001429 "description": "A String", # A short description of the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001430 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Joe Gregorio075572b2012-07-09 16:53:09 -04001431 "editable": True or False, # Whether the file can be edited by the current user.
1432 "kind": "drive#file", # The type of file. This is always drive#file.
1433 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1434 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
1435 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1436 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001437 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001438 "flashUsed": True or False, # Whether a flash was used to create the photo.
1439 "exposureTime": 3.14, # The length of the exposure, in seconds.
1440 "cameraMake": "A String", # The make of the camera used to create the photo.
1441 "isoSpeed": 42, # The ISO speed used to create the photo.
1442 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1443 "height": 42, # The height of the image in pixels.
1444 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
Joe Gregorioad8013f2012-08-03 08:44:02 -04001445 "location": { # Geographic location information stored in the image.
1446 "latitude": 3.14, # The latitude stored in the image.
1447 "altitude": 3.14, # The altitude stored in the image.
1448 "longitude": 3.14, # The longitude stored in the image.
1449 },
Joe Gregoriod67010d2012-11-05 08:57:06 -05001450 "aperture": 3.14, # The aperture used to create the photo (f-number).
1451 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1452 "width": 42, # The width of the image in pixels.
1453 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001454 },
Joe Gregorio075572b2012-07-09 16:53:09 -04001455 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001456 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
1457 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio075572b2012-07-09 16:53:09 -04001458 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
1459 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
1460 "withLink": True or False, # Whether the link is required for this permission.
1461 "kind": "drive#permission", # This is always drive#permission.
1462 "name": "A String", # The name for this permission.
1463 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
1464 "id": "A String", # The ID of the permission.
1465 "authKey": "A String", # The authkey parameter required for this permission.
1466 "etag": "A String", # The ETag of the permission.
1467 "role": "A String", # The primary role for this user. Allowed values are:
1468 # - owner
1469 # - reader
1470 # - writer
1471 "photoLink": "A String", # A link to the profile photo, if available.
1472 "type": "A String", # The account type. Allowed values are:
1473 # - user
1474 # - group
1475 # - domain
1476 # - anyone
1477 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1478 "A String",
1479 ],
1480 "selfLink": "A String", # A link back to this permission.
1481 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001482 "fileExtension": "A String", # The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001483 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001484 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04001485}
1486
1487 newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision will be replaced.
1488 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
1489 targetLanguage: string, Target language to translate the file to. If no sourceLanguage is provided, the API will attempt to detect the language.
1490 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001491 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Joe Gregorio075572b2012-07-09 16:53:09 -04001492 pinned: boolean, Whether to pin the new revision.
1493 sourceLanguage: string, The language of the original file to be translated.
1494 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
1495 timedTextTrackName: string, The timed text track name.
1496 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
1497 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
1498 timedTextLanguage: string, The language of the timed text.
1499
1500Returns:
1501 An object of the form:
1502
1503 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001504 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio075572b2012-07-09 16:53:09 -04001505 "thumbnailLink": "A String", # A link to the file's thumbnail.
1506 "labels": { # A group of labels for the file.
1507 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1508 "hidden": True or False, # Whether this file is hidden from the user.
1509 "viewed": True or False, # Whether this file has been viewed by this user.
1510 "starred": True or False, # Whether this file is starred by the user.
1511 "trashed": True or False, # Whether this file has been trashed.
1512 },
1513 "indexableText": { # Indexable text attributes for the file (can only be written)
1514 "text": "A String", # The text to be indexed for this file
1515 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001516 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio075572b2012-07-09 16:53:09 -04001517 "etag": "A String", # ETag of the file.
1518 "lastModifyingUserName": "A String", # Name of the last user to modify this file. This will only be populated if a user has edited this file.
1519 "writersCanShare": True or False, # Whether writers can share the document with other users.
1520 "id": "A String", # The id of the file.
1521 "title": "A String", # The title of this file.
1522 "ownerNames": [ # Name(s) of the owner(s) of this file.
1523 "A String",
1524 ],
1525 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1526 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1527 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -04001528 # 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 -04001529 { # A reference to a file's parent.
1530 "selfLink": "A String", # A link back to this reference.
1531 "kind": "drive#parentReference", # This is always drive#parentReference.
1532 "id": "A String", # The ID of the parent.
1533 "isRoot": True or False, # Whether or not the parent is the root folder.
1534 "parentLink": "A String", # A link to the parent.
1535 },
1536 ],
1537 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -04001538 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -04001539 },
Joe Gregoriod67010d2012-11-05 08:57:06 -05001540 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1541 "mimeType": "A String", # The MIME type of the thumbnail.
1542 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1543 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001544 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001545 "description": "A String", # A short description of the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001546 "webContentLink": "A String", # A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
Joe Gregorio075572b2012-07-09 16:53:09 -04001547 "editable": True or False, # Whether the file can be edited by the current user.
1548 "kind": "drive#file", # The type of file. This is always drive#file.
1549 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1550 "fileSize": "A String", # The size of the file in bytes. This will only be populated on files with content stored in Drive.
1551 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1552 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This will only be populated on files with content stored in Drive.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001553 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001554 "flashUsed": True or False, # Whether a flash was used to create the photo.
1555 "exposureTime": 3.14, # The length of the exposure, in seconds.
1556 "cameraMake": "A String", # The make of the camera used to create the photo.
1557 "isoSpeed": 42, # The ISO speed used to create the photo.
1558 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1559 "height": 42, # The height of the image in pixels.
1560 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
Joe Gregorioad8013f2012-08-03 08:44:02 -04001561 "location": { # Geographic location information stored in the image.
1562 "latitude": 3.14, # The latitude stored in the image.
1563 "altitude": 3.14, # The altitude stored in the image.
1564 "longitude": 3.14, # The longitude stored in the image.
1565 },
Joe Gregoriod67010d2012-11-05 08:57:06 -05001566 "aperture": 3.14, # The aperture used to create the photo (f-number).
1567 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1568 "width": 42, # The width of the image in pixels.
1569 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001570 },
Joe Gregorio075572b2012-07-09 16:53:09 -04001571 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001572 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
1573 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio075572b2012-07-09 16:53:09 -04001574 "downloadUrl": "A String", # Short term download URL for the file. This will only be populated on files with content stored in Drive.
1575 "userPermission": { # A single permission for a file. # The permissions for the authenticated user on this file.
1576 "withLink": True or False, # Whether the link is required for this permission.
1577 "kind": "drive#permission", # This is always drive#permission.
1578 "name": "A String", # The name for this permission.
1579 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
1580 "id": "A String", # The ID of the permission.
1581 "authKey": "A String", # The authkey parameter required for this permission.
1582 "etag": "A String", # The ETag of the permission.
1583 "role": "A String", # The primary role for this user. Allowed values are:
1584 # - owner
1585 # - reader
1586 # - writer
1587 "photoLink": "A String", # A link to the profile photo, if available.
1588 "type": "A String", # The account type. Allowed values are:
1589 # - user
1590 # - group
1591 # - domain
1592 # - anyone
1593 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1594 "A String",
1595 ],
1596 "selfLink": "A String", # A link back to this permission.
1597 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001598 "fileExtension": "A String", # The file extension used when downloading this file. This field is set from the title when inserting or uploading new content. This will only be populated on files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001599 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001600 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04001601 }</pre>
1602</div>
1603
1604</body></html>