blob: b0e19f676753e60815a8fbeae40bfb0f541741a9 [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="drive_v2.html">Drive API</a> . <a href="drive_v2.files.html">files</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#copy">copy(fileId, body, pinned=None, convert=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None)</a></code></p>
79<p class="firstline">Creates a copy of the specified file.</p>
80<p class="toc_element">
81 <code><a href="#delete">delete(fileId)</a></code></p>
82<p class="firstline">Permanently deletes a file by ID. Skips the trash.</p>
83<p class="toc_element">
Craig Citro065b5302014-08-14 00:47:23 -070084 <code><a href="#emptyTrash">emptyTrash()</a></code></p>
85<p class="firstline">Permanently deletes all of the user's trashed files.</p>
86<p class="toc_element">
John Asmuth614db982014-04-24 15:46:26 -040087 <code><a href="#get">get(fileId, projection=None, updateViewedDate=None)</a></code></p>
88<p class="firstline">Gets a file's metadata by ID.</p>
89<p class="toc_element">
90 <code><a href="#insert">insert(body=None, media_body=None, convert=None, useContentAsIndexableText=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None, pinned=None)</a></code></p>
91<p class="firstline">Insert a new file.</p>
92<p class="toc_element">
Craig Citro065b5302014-08-14 00:47:23 -070093 <code><a href="#list">list(q=None, projection=None, pageToken=None, maxResults=None, corpus=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040094<p class="firstline">Lists the user's files.</p>
95<p class="toc_element">
96 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
97<p class="firstline">Retrieves the next page of results.</p>
98<p class="toc_element">
Craig Citro065b5302014-08-14 00:47:23 -070099 <code><a href="#patch">patch(fileId, body, newRevision=None, pinned=None, ocrLanguage=None, ocr=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400100<p class="firstline">Updates file metadata and/or content. This method supports patch semantics.</p>
101<p class="toc_element">
102 <code><a href="#touch">touch(fileId)</a></code></p>
103<p class="firstline">Set the file's updated time to the current server time.</p>
104<p class="toc_element">
105 <code><a href="#trash">trash(fileId)</a></code></p>
106<p class="firstline">Moves a file to the trash.</p>
107<p class="toc_element">
108 <code><a href="#untrash">untrash(fileId)</a></code></p>
109<p class="firstline">Restores a file from the trash.</p>
110<p class="toc_element">
Craig Citro065b5302014-08-14 00:47:23 -0700111 <code><a href="#update">update(fileId, body=None, newRevision=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400112<p class="firstline">Updates file metadata and/or content.</p>
113<p class="toc_element">
114 <code><a href="#watch">watch(fileId, body, projection=None, updateViewedDate=None)</a></code></p>
115<p class="firstline">Subscribe to changes on a file</p>
116<h3>Method Details</h3>
117<div class="method">
118 <code class="details" id="copy">copy(fileId, body, pinned=None, convert=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None)</code>
119 <pre>Creates a copy of the specified file.
120
121Args:
122 fileId: string, The ID of the file to copy. (required)
123 body: object, The request body. (required)
124 The object takes the form of:
125
126{ # The metadata for a file.
127 "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.
128 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700129 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
130 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400131 "thumbnailLink": "A String", # A link to the file's thumbnail.
132 "labels": { # A group of labels for the file.
133 "restricted": True or False, # Whether viewers are prevented from downloading this file.
134 "hidden": True or False, # Deprecated.
135 "viewed": True or False, # Whether this file has been viewed by this user.
136 "starred": True or False, # Whether this file is starred by the user.
137 "trashed": True or False, # Whether this file has been trashed.
138 },
139 "indexableText": { # Indexable text attributes for the file (can only be written)
140 "text": "A String", # The text to be indexed for this file.
141 },
142 "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.
143 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
144 "writersCanShare": True or False, # Whether writers can share the document with other users.
145 "owners": [ # The owner(s) of this file.
146 { # The JSON template for a user.
147 "picture": { # The user's profile picture.
148 "url": "A String", # A URL that points to a profile picture of this user.
149 },
150 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400151 "displayName": "A String", # A plain text displayable name for this user.
152 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700153 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
154 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400155 },
156 ],
157 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700158 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
159 "picture": { # The user's profile picture.
160 "url": "A String", # A URL that points to a profile picture of this user.
161 },
162 "kind": "drive#user", # This is always drive#user.
163 "displayName": "A String", # A plain text displayable name for this user.
164 "permissionId": "A String", # The user's ID as visible in the permissions collection.
165 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
166 "emailAddress": "A String", # The email address of the user.
167 },
John Asmuth614db982014-04-24 15:46:26 -0400168 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
169 "picture": { # The user's profile picture.
170 "url": "A String", # A URL that points to a profile picture of this user.
171 },
172 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400173 "displayName": "A String", # A plain text displayable name for this user.
174 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700175 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
176 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400177 },
178 "copyable": True or False, # Whether the file can be copied by the current user.
179 "ownerNames": [ # Name(s) of the owner(s) of this file.
180 "A String",
181 ],
182 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
183 "webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
184 "etag": "A String", # ETag of the file.
185 "parents": [ # Collection of parent folders which contain this file.
186 # 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.
187 { # A reference to a file's parent.
188 "selfLink": "A String", # A link back to this reference.
189 "kind": "drive#parentReference", # This is always drive#parentReference.
190 "id": "A String", # The ID of the parent.
191 "isRoot": True or False, # Whether or not the parent is the root folder.
192 "parentLink": "A String", # A link to the parent.
193 },
194 ],
195 "exportLinks": { # Links for exporting Google Docs to specific formats.
196 "a_key": "A String", # A mapping from export format to URL
197 },
198 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700199 "permissions": [ # The list of permissions for users with access to this file.
200 { # A permission for a file.
201 "withLink": True or False, # Whether the link is required for this permission.
202 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
203 "name": "A String", # The name for this permission.
204 "kind": "drive#permission", # This is always drive#permission.
205 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
206 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
207 "authKey": "A String", # The authkey parameter required for this permission.
208 "etag": "A String", # The ETag of the permission.
209 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
210 "photoLink": "A String", # A link to the profile photo, if available.
211 "role": "A String", # The primary role for this user. Allowed values are:
212 # - owner
213 # - reader
214 # - writer
215 "type": "A String", # The account type. Allowed values are:
216 # - user
217 # - group
218 # - domain
219 # - anyone
220 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
221 "A String",
222 ],
223 "selfLink": "A String", # A link back to this permission.
224 },
225 ],
John Asmuth614db982014-04-24 15:46:26 -0400226 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
227 "mimeType": "A String", # The MIME type of the thumbnail.
228 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
229 },
230 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
231 "a_key": "A String",
232 },
233 "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.
234 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
235 "exposureTime": 3.14, # The length of the exposure, in seconds.
236 "cameraMake": "A String", # The make of the camera used to create the photo.
237 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
238 "isoSpeed": 42, # The ISO speed used to create the photo.
239 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
240 "exposureMode": "A String", # The exposure mode used to create the photo.
241 "colorSpace": "A String", # The color space of the photo.
242 "location": { # Geographic location information stored in the image.
243 "latitude": 3.14, # The latitude stored in the image.
244 "altitude": 3.14, # The altitude stored in the image.
245 "longitude": 3.14, # The longitude stored in the image.
246 },
247 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
248 "height": 42, # The height of the image in pixels.
249 "lens": "A String", # The lens used to create the photo.
250 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
251 "width": 42, # The width of the image in pixels.
252 "meteringMode": "A String", # The metering mode used to create the photo.
253 "flashUsed": True or False, # Whether a flash was used to create the photo.
254 "aperture": 3.14, # The aperture used to create the photo (f-number).
255 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
256 "sensor": "A String", # The type of sensor used to create the photo.
257 "whiteBalance": "A String", # The white balance mode used to create the photo.
258 "cameraModel": "A String", # The model of the camera used to create the photo.
259 },
260 "description": "A String", # A short description of the file.
261 "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.
262 "editable": True or False, # Whether the file can be edited by the current user.
263 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700264 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400265 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
266 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
267 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
268 "properties": [ # The list of properties.
269 { # A key-value pair that is either public or private to an application.
270 "kind": "drive#property", # This is always drive#property.
271 "value": "A String", # The value of this property.
272 "etag": "A String", # ETag of the property.
273 "visibility": "A String", # The visibility of this property.
274 "key": "A String", # The key of this property.
275 "selfLink": "A String", # The link back to this property.
276 },
277 ],
278 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
279 "iconLink": "A String", # A link to the file's icon.
280 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
281 "embedLink": "A String", # A link for embedding the file.
282 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
283 "title": "A String", # The title of this file.
284 "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.
285 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
286 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
287 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700288 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400289 "name": "A String", # The name for this permission.
290 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700291 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
292 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -0400293 "authKey": "A String", # The authkey parameter required for this permission.
294 "etag": "A String", # The ETag of the permission.
Craig Citro065b5302014-08-14 00:47:23 -0700295 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
John Asmuth614db982014-04-24 15:46:26 -0400296 "photoLink": "A String", # A link to the profile photo, if available.
297 "role": "A String", # The primary role for this user. Allowed values are:
298 # - owner
299 # - reader
300 # - writer
301 "type": "A String", # The account type. Allowed values are:
302 # - user
303 # - group
304 # - domain
305 # - anyone
306 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
307 "A String",
308 ],
309 "selfLink": "A String", # A link back to this permission.
310 },
311 "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.
312 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive.
313 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
314 "selfLink": "A String", # A link back to this file.
315 "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.
316}
317
318 pinned: boolean, Whether to pin the head revision of the new copy.
319 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
320 visibility: string, The visibility of the new file. This parameter is only relevant when the source is not a native Google Doc and convert=false.
321 Allowed values
322 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
323 PRIVATE - The new file will be visible to only the owner.
324 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
325 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
326 timedTextLanguage: string, The language of the timed text.
327 timedTextTrackName: string, The timed text track name.
328
329Returns:
330 An object of the form:
331
332 { # The metadata for a file.
333 "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.
334 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700335 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
336 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400337 "thumbnailLink": "A String", # A link to the file's thumbnail.
338 "labels": { # A group of labels for the file.
339 "restricted": True or False, # Whether viewers are prevented from downloading this file.
340 "hidden": True or False, # Deprecated.
341 "viewed": True or False, # Whether this file has been viewed by this user.
342 "starred": True or False, # Whether this file is starred by the user.
343 "trashed": True or False, # Whether this file has been trashed.
344 },
345 "indexableText": { # Indexable text attributes for the file (can only be written)
346 "text": "A String", # The text to be indexed for this file.
347 },
348 "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.
349 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
350 "writersCanShare": True or False, # Whether writers can share the document with other users.
351 "owners": [ # The owner(s) of this file.
352 { # The JSON template for a user.
353 "picture": { # The user's profile picture.
354 "url": "A String", # A URL that points to a profile picture of this user.
355 },
356 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400357 "displayName": "A String", # A plain text displayable name for this user.
358 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700359 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
360 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400361 },
362 ],
363 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700364 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
365 "picture": { # The user's profile picture.
366 "url": "A String", # A URL that points to a profile picture of this user.
367 },
368 "kind": "drive#user", # This is always drive#user.
369 "displayName": "A String", # A plain text displayable name for this user.
370 "permissionId": "A String", # The user's ID as visible in the permissions collection.
371 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
372 "emailAddress": "A String", # The email address of the user.
373 },
John Asmuth614db982014-04-24 15:46:26 -0400374 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
375 "picture": { # The user's profile picture.
376 "url": "A String", # A URL that points to a profile picture of this user.
377 },
378 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400379 "displayName": "A String", # A plain text displayable name for this user.
380 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700381 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
382 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400383 },
384 "copyable": True or False, # Whether the file can be copied by the current user.
385 "ownerNames": [ # Name(s) of the owner(s) of this file.
386 "A String",
387 ],
388 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
389 "webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
390 "etag": "A String", # ETag of the file.
391 "parents": [ # Collection of parent folders which contain this file.
392 # 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.
393 { # A reference to a file's parent.
394 "selfLink": "A String", # A link back to this reference.
395 "kind": "drive#parentReference", # This is always drive#parentReference.
396 "id": "A String", # The ID of the parent.
397 "isRoot": True or False, # Whether or not the parent is the root folder.
398 "parentLink": "A String", # A link to the parent.
399 },
400 ],
401 "exportLinks": { # Links for exporting Google Docs to specific formats.
402 "a_key": "A String", # A mapping from export format to URL
403 },
404 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700405 "permissions": [ # The list of permissions for users with access to this file.
406 { # A permission for a file.
407 "withLink": True or False, # Whether the link is required for this permission.
408 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
409 "name": "A String", # The name for this permission.
410 "kind": "drive#permission", # This is always drive#permission.
411 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
412 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
413 "authKey": "A String", # The authkey parameter required for this permission.
414 "etag": "A String", # The ETag of the permission.
415 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
416 "photoLink": "A String", # A link to the profile photo, if available.
417 "role": "A String", # The primary role for this user. Allowed values are:
418 # - owner
419 # - reader
420 # - writer
421 "type": "A String", # The account type. Allowed values are:
422 # - user
423 # - group
424 # - domain
425 # - anyone
426 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
427 "A String",
428 ],
429 "selfLink": "A String", # A link back to this permission.
430 },
431 ],
John Asmuth614db982014-04-24 15:46:26 -0400432 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
433 "mimeType": "A String", # The MIME type of the thumbnail.
434 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
435 },
436 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
437 "a_key": "A String",
438 },
439 "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.
440 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
441 "exposureTime": 3.14, # The length of the exposure, in seconds.
442 "cameraMake": "A String", # The make of the camera used to create the photo.
443 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
444 "isoSpeed": 42, # The ISO speed used to create the photo.
445 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
446 "exposureMode": "A String", # The exposure mode used to create the photo.
447 "colorSpace": "A String", # The color space of the photo.
448 "location": { # Geographic location information stored in the image.
449 "latitude": 3.14, # The latitude stored in the image.
450 "altitude": 3.14, # The altitude stored in the image.
451 "longitude": 3.14, # The longitude stored in the image.
452 },
453 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
454 "height": 42, # The height of the image in pixels.
455 "lens": "A String", # The lens used to create the photo.
456 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
457 "width": 42, # The width of the image in pixels.
458 "meteringMode": "A String", # The metering mode used to create the photo.
459 "flashUsed": True or False, # Whether a flash was used to create the photo.
460 "aperture": 3.14, # The aperture used to create the photo (f-number).
461 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
462 "sensor": "A String", # The type of sensor used to create the photo.
463 "whiteBalance": "A String", # The white balance mode used to create the photo.
464 "cameraModel": "A String", # The model of the camera used to create the photo.
465 },
466 "description": "A String", # A short description of the file.
467 "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.
468 "editable": True or False, # Whether the file can be edited by the current user.
469 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700470 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400471 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
472 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
473 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
474 "properties": [ # The list of properties.
475 { # A key-value pair that is either public or private to an application.
476 "kind": "drive#property", # This is always drive#property.
477 "value": "A String", # The value of this property.
478 "etag": "A String", # ETag of the property.
479 "visibility": "A String", # The visibility of this property.
480 "key": "A String", # The key of this property.
481 "selfLink": "A String", # The link back to this property.
482 },
483 ],
484 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
485 "iconLink": "A String", # A link to the file's icon.
486 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
487 "embedLink": "A String", # A link for embedding the file.
488 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
489 "title": "A String", # The title of this file.
490 "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.
491 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
492 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
493 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700494 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400495 "name": "A String", # The name for this permission.
496 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700497 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
498 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -0400499 "authKey": "A String", # The authkey parameter required for this permission.
500 "etag": "A String", # The ETag of the permission.
Craig Citro065b5302014-08-14 00:47:23 -0700501 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
John Asmuth614db982014-04-24 15:46:26 -0400502 "photoLink": "A String", # A link to the profile photo, if available.
503 "role": "A String", # The primary role for this user. Allowed values are:
504 # - owner
505 # - reader
506 # - writer
507 "type": "A String", # The account type. Allowed values are:
508 # - user
509 # - group
510 # - domain
511 # - anyone
512 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
513 "A String",
514 ],
515 "selfLink": "A String", # A link back to this permission.
516 },
517 "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.
518 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive.
519 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
520 "selfLink": "A String", # A link back to this file.
521 "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.
522 }</pre>
523</div>
524
525<div class="method">
526 <code class="details" id="delete">delete(fileId)</code>
527 <pre>Permanently deletes a file by ID. Skips the trash.
528
529Args:
530 fileId: string, The ID of the file to delete. (required)
531</pre>
532</div>
533
534<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -0700535 <code class="details" id="emptyTrash">emptyTrash()</code>
536 <pre>Permanently deletes all of the user's trashed files.
537
538Args:
539</pre>
540</div>
541
542<div class="method">
John Asmuth614db982014-04-24 15:46:26 -0400543 <code class="details" id="get">get(fileId, projection=None, updateViewedDate=None)</code>
544 <pre>Gets a file's metadata by ID.
545
546Args:
547 fileId: string, The ID for the file in question. (required)
548 projection: string, This parameter is deprecated and has no function.
549 Allowed values
550 BASIC - Deprecated
551 FULL - Deprecated
552 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
553
554Returns:
555 An object of the form:
556
557 { # The metadata for a file.
558 "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.
559 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700560 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
561 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400562 "thumbnailLink": "A String", # A link to the file's thumbnail.
563 "labels": { # A group of labels for the file.
564 "restricted": True or False, # Whether viewers are prevented from downloading this file.
565 "hidden": True or False, # Deprecated.
566 "viewed": True or False, # Whether this file has been viewed by this user.
567 "starred": True or False, # Whether this file is starred by the user.
568 "trashed": True or False, # Whether this file has been trashed.
569 },
570 "indexableText": { # Indexable text attributes for the file (can only be written)
571 "text": "A String", # The text to be indexed for this file.
572 },
573 "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.
574 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
575 "writersCanShare": True or False, # Whether writers can share the document with other users.
576 "owners": [ # The owner(s) of this file.
577 { # The JSON template for a user.
578 "picture": { # The user's profile picture.
579 "url": "A String", # A URL that points to a profile picture of this user.
580 },
581 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400582 "displayName": "A String", # A plain text displayable name for this user.
583 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700584 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
585 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400586 },
587 ],
588 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700589 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
590 "picture": { # The user's profile picture.
591 "url": "A String", # A URL that points to a profile picture of this user.
592 },
593 "kind": "drive#user", # This is always drive#user.
594 "displayName": "A String", # A plain text displayable name for this user.
595 "permissionId": "A String", # The user's ID as visible in the permissions collection.
596 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
597 "emailAddress": "A String", # The email address of the user.
598 },
John Asmuth614db982014-04-24 15:46:26 -0400599 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
600 "picture": { # The user's profile picture.
601 "url": "A String", # A URL that points to a profile picture of this user.
602 },
603 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400604 "displayName": "A String", # A plain text displayable name for this user.
605 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700606 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
607 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400608 },
609 "copyable": True or False, # Whether the file can be copied by the current user.
610 "ownerNames": [ # Name(s) of the owner(s) of this file.
611 "A String",
612 ],
613 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
614 "webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
615 "etag": "A String", # ETag of the file.
616 "parents": [ # Collection of parent folders which contain this file.
617 # 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.
618 { # A reference to a file's parent.
619 "selfLink": "A String", # A link back to this reference.
620 "kind": "drive#parentReference", # This is always drive#parentReference.
621 "id": "A String", # The ID of the parent.
622 "isRoot": True or False, # Whether or not the parent is the root folder.
623 "parentLink": "A String", # A link to the parent.
624 },
625 ],
626 "exportLinks": { # Links for exporting Google Docs to specific formats.
627 "a_key": "A String", # A mapping from export format to URL
628 },
629 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700630 "permissions": [ # The list of permissions for users with access to this file.
631 { # A permission for a file.
632 "withLink": True or False, # Whether the link is required for this permission.
633 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
634 "name": "A String", # The name for this permission.
635 "kind": "drive#permission", # This is always drive#permission.
636 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
637 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
638 "authKey": "A String", # The authkey parameter required for this permission.
639 "etag": "A String", # The ETag of the permission.
640 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
641 "photoLink": "A String", # A link to the profile photo, if available.
642 "role": "A String", # The primary role for this user. Allowed values are:
643 # - owner
644 # - reader
645 # - writer
646 "type": "A String", # The account type. Allowed values are:
647 # - user
648 # - group
649 # - domain
650 # - anyone
651 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
652 "A String",
653 ],
654 "selfLink": "A String", # A link back to this permission.
655 },
656 ],
John Asmuth614db982014-04-24 15:46:26 -0400657 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
658 "mimeType": "A String", # The MIME type of the thumbnail.
659 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
660 },
661 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
662 "a_key": "A String",
663 },
664 "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.
665 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
666 "exposureTime": 3.14, # The length of the exposure, in seconds.
667 "cameraMake": "A String", # The make of the camera used to create the photo.
668 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
669 "isoSpeed": 42, # The ISO speed used to create the photo.
670 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
671 "exposureMode": "A String", # The exposure mode used to create the photo.
672 "colorSpace": "A String", # The color space of the photo.
673 "location": { # Geographic location information stored in the image.
674 "latitude": 3.14, # The latitude stored in the image.
675 "altitude": 3.14, # The altitude stored in the image.
676 "longitude": 3.14, # The longitude stored in the image.
677 },
678 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
679 "height": 42, # The height of the image in pixels.
680 "lens": "A String", # The lens used to create the photo.
681 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
682 "width": 42, # The width of the image in pixels.
683 "meteringMode": "A String", # The metering mode used to create the photo.
684 "flashUsed": True or False, # Whether a flash was used to create the photo.
685 "aperture": 3.14, # The aperture used to create the photo (f-number).
686 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
687 "sensor": "A String", # The type of sensor used to create the photo.
688 "whiteBalance": "A String", # The white balance mode used to create the photo.
689 "cameraModel": "A String", # The model of the camera used to create the photo.
690 },
691 "description": "A String", # A short description of the file.
692 "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.
693 "editable": True or False, # Whether the file can be edited by the current user.
694 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700695 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400696 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
697 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
698 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
699 "properties": [ # The list of properties.
700 { # A key-value pair that is either public or private to an application.
701 "kind": "drive#property", # This is always drive#property.
702 "value": "A String", # The value of this property.
703 "etag": "A String", # ETag of the property.
704 "visibility": "A String", # The visibility of this property.
705 "key": "A String", # The key of this property.
706 "selfLink": "A String", # The link back to this property.
707 },
708 ],
709 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
710 "iconLink": "A String", # A link to the file's icon.
711 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
712 "embedLink": "A String", # A link for embedding the file.
713 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
714 "title": "A String", # The title of this file.
715 "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.
716 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
717 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
718 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700719 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400720 "name": "A String", # The name for this permission.
721 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700722 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
723 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -0400724 "authKey": "A String", # The authkey parameter required for this permission.
725 "etag": "A String", # The ETag of the permission.
Craig Citro065b5302014-08-14 00:47:23 -0700726 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
John Asmuth614db982014-04-24 15:46:26 -0400727 "photoLink": "A String", # A link to the profile photo, if available.
728 "role": "A String", # The primary role for this user. Allowed values are:
729 # - owner
730 # - reader
731 # - writer
732 "type": "A String", # The account type. Allowed values are:
733 # - user
734 # - group
735 # - domain
736 # - anyone
737 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
738 "A String",
739 ],
740 "selfLink": "A String", # A link back to this permission.
741 },
742 "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.
743 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive.
744 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
745 "selfLink": "A String", # A link back to this file.
746 "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.
747 }</pre>
748</div>
749
750<div class="method">
751 <code class="details" id="insert">insert(body=None, media_body=None, convert=None, useContentAsIndexableText=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None, pinned=None)</code>
752 <pre>Insert a new file.
753
754Args:
755 body: object, The request body.
756 The object takes the form of:
757
758{ # The metadata for a file.
759 "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.
760 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700761 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
762 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400763 "thumbnailLink": "A String", # A link to the file's thumbnail.
764 "labels": { # A group of labels for the file.
765 "restricted": True or False, # Whether viewers are prevented from downloading this file.
766 "hidden": True or False, # Deprecated.
767 "viewed": True or False, # Whether this file has been viewed by this user.
768 "starred": True or False, # Whether this file is starred by the user.
769 "trashed": True or False, # Whether this file has been trashed.
770 },
771 "indexableText": { # Indexable text attributes for the file (can only be written)
772 "text": "A String", # The text to be indexed for this file.
773 },
774 "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.
775 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
776 "writersCanShare": True or False, # Whether writers can share the document with other users.
777 "owners": [ # The owner(s) of this file.
778 { # The JSON template for a user.
779 "picture": { # The user's profile picture.
780 "url": "A String", # A URL that points to a profile picture of this user.
781 },
782 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400783 "displayName": "A String", # A plain text displayable name for this user.
784 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700785 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
786 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400787 },
788 ],
789 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700790 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
791 "picture": { # The user's profile picture.
792 "url": "A String", # A URL that points to a profile picture of this user.
793 },
794 "kind": "drive#user", # This is always drive#user.
795 "displayName": "A String", # A plain text displayable name for this user.
796 "permissionId": "A String", # The user's ID as visible in the permissions collection.
797 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
798 "emailAddress": "A String", # The email address of the user.
799 },
John Asmuth614db982014-04-24 15:46:26 -0400800 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
801 "picture": { # The user's profile picture.
802 "url": "A String", # A URL that points to a profile picture of this user.
803 },
804 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400805 "displayName": "A String", # A plain text displayable name for this user.
806 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700807 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
808 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400809 },
810 "copyable": True or False, # Whether the file can be copied by the current user.
811 "ownerNames": [ # Name(s) of the owner(s) of this file.
812 "A String",
813 ],
814 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
815 "webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
816 "etag": "A String", # ETag of the file.
817 "parents": [ # Collection of parent folders which contain this file.
818 # 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.
819 { # A reference to a file's parent.
820 "selfLink": "A String", # A link back to this reference.
821 "kind": "drive#parentReference", # This is always drive#parentReference.
822 "id": "A String", # The ID of the parent.
823 "isRoot": True or False, # Whether or not the parent is the root folder.
824 "parentLink": "A String", # A link to the parent.
825 },
826 ],
827 "exportLinks": { # Links for exporting Google Docs to specific formats.
828 "a_key": "A String", # A mapping from export format to URL
829 },
830 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700831 "permissions": [ # The list of permissions for users with access to this file.
832 { # A permission for a file.
833 "withLink": True or False, # Whether the link is required for this permission.
834 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
835 "name": "A String", # The name for this permission.
836 "kind": "drive#permission", # This is always drive#permission.
837 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
838 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
839 "authKey": "A String", # The authkey parameter required for this permission.
840 "etag": "A String", # The ETag of the permission.
841 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
842 "photoLink": "A String", # A link to the profile photo, if available.
843 "role": "A String", # The primary role for this user. Allowed values are:
844 # - owner
845 # - reader
846 # - writer
847 "type": "A String", # The account type. Allowed values are:
848 # - user
849 # - group
850 # - domain
851 # - anyone
852 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
853 "A String",
854 ],
855 "selfLink": "A String", # A link back to this permission.
856 },
857 ],
John Asmuth614db982014-04-24 15:46:26 -0400858 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
859 "mimeType": "A String", # The MIME type of the thumbnail.
860 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
861 },
862 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
863 "a_key": "A String",
864 },
865 "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.
866 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
867 "exposureTime": 3.14, # The length of the exposure, in seconds.
868 "cameraMake": "A String", # The make of the camera used to create the photo.
869 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
870 "isoSpeed": 42, # The ISO speed used to create the photo.
871 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
872 "exposureMode": "A String", # The exposure mode used to create the photo.
873 "colorSpace": "A String", # The color space of the photo.
874 "location": { # Geographic location information stored in the image.
875 "latitude": 3.14, # The latitude stored in the image.
876 "altitude": 3.14, # The altitude stored in the image.
877 "longitude": 3.14, # The longitude stored in the image.
878 },
879 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
880 "height": 42, # The height of the image in pixels.
881 "lens": "A String", # The lens used to create the photo.
882 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
883 "width": 42, # The width of the image in pixels.
884 "meteringMode": "A String", # The metering mode used to create the photo.
885 "flashUsed": True or False, # Whether a flash was used to create the photo.
886 "aperture": 3.14, # The aperture used to create the photo (f-number).
887 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
888 "sensor": "A String", # The type of sensor used to create the photo.
889 "whiteBalance": "A String", # The white balance mode used to create the photo.
890 "cameraModel": "A String", # The model of the camera used to create the photo.
891 },
892 "description": "A String", # A short description of the file.
893 "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.
894 "editable": True or False, # Whether the file can be edited by the current user.
895 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700896 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400897 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
898 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
899 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
900 "properties": [ # The list of properties.
901 { # A key-value pair that is either public or private to an application.
902 "kind": "drive#property", # This is always drive#property.
903 "value": "A String", # The value of this property.
904 "etag": "A String", # ETag of the property.
905 "visibility": "A String", # The visibility of this property.
906 "key": "A String", # The key of this property.
907 "selfLink": "A String", # The link back to this property.
908 },
909 ],
910 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
911 "iconLink": "A String", # A link to the file's icon.
912 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
913 "embedLink": "A String", # A link for embedding the file.
914 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
915 "title": "A String", # The title of this file.
916 "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.
917 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
918 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
919 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700920 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400921 "name": "A String", # The name for this permission.
922 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700923 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
924 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -0400925 "authKey": "A String", # The authkey parameter required for this permission.
926 "etag": "A String", # The ETag of the permission.
Craig Citro065b5302014-08-14 00:47:23 -0700927 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
John Asmuth614db982014-04-24 15:46:26 -0400928 "photoLink": "A String", # A link to the profile photo, if available.
929 "role": "A String", # The primary role for this user. Allowed values are:
930 # - owner
931 # - reader
932 # - writer
933 "type": "A String", # The account type. Allowed values are:
934 # - user
935 # - group
936 # - domain
937 # - anyone
938 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
939 "A String",
940 ],
941 "selfLink": "A String", # A link back to this permission.
942 },
943 "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.
944 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive.
945 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
946 "selfLink": "A String", # A link back to this file.
947 "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.
948}
949
950 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
951 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
952 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
953 visibility: string, The visibility of the new file. This parameter is only relevant when convert=false.
954 Allowed values
955 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
956 PRIVATE - The new file will be visible to only the owner.
957 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
958 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
959 timedTextLanguage: string, The language of the timed text.
960 timedTextTrackName: string, The timed text track name.
961 pinned: boolean, Whether to pin the head revision of the uploaded file.
962
963Returns:
964 An object of the form:
965
966 { # The metadata for a file.
967 "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.
968 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700969 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
970 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400971 "thumbnailLink": "A String", # A link to the file's thumbnail.
972 "labels": { # A group of labels for the file.
973 "restricted": True or False, # Whether viewers are prevented from downloading this file.
974 "hidden": True or False, # Deprecated.
975 "viewed": True or False, # Whether this file has been viewed by this user.
976 "starred": True or False, # Whether this file is starred by the user.
977 "trashed": True or False, # Whether this file has been trashed.
978 },
979 "indexableText": { # Indexable text attributes for the file (can only be written)
980 "text": "A String", # The text to be indexed for this file.
981 },
982 "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.
983 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
984 "writersCanShare": True or False, # Whether writers can share the document with other users.
985 "owners": [ # The owner(s) of this file.
986 { # The JSON template for a user.
987 "picture": { # The user's profile picture.
988 "url": "A String", # A URL that points to a profile picture of this user.
989 },
990 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400991 "displayName": "A String", # A plain text displayable name for this user.
992 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700993 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
994 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400995 },
996 ],
997 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700998 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
999 "picture": { # The user's profile picture.
1000 "url": "A String", # A URL that points to a profile picture of this user.
1001 },
1002 "kind": "drive#user", # This is always drive#user.
1003 "displayName": "A String", # A plain text displayable name for this user.
1004 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1005 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1006 "emailAddress": "A String", # The email address of the user.
1007 },
John Asmuth614db982014-04-24 15:46:26 -04001008 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1009 "picture": { # The user's profile picture.
1010 "url": "A String", # A URL that points to a profile picture of this user.
1011 },
1012 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001013 "displayName": "A String", # A plain text displayable name for this user.
1014 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001015 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1016 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001017 },
1018 "copyable": True or False, # Whether the file can be copied by the current user.
1019 "ownerNames": [ # Name(s) of the owner(s) of this file.
1020 "A String",
1021 ],
1022 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1023 "webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
1024 "etag": "A String", # ETag of the file.
1025 "parents": [ # Collection of parent folders which contain this file.
1026 # 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.
1027 { # A reference to a file's parent.
1028 "selfLink": "A String", # A link back to this reference.
1029 "kind": "drive#parentReference", # This is always drive#parentReference.
1030 "id": "A String", # The ID of the parent.
1031 "isRoot": True or False, # Whether or not the parent is the root folder.
1032 "parentLink": "A String", # A link to the parent.
1033 },
1034 ],
1035 "exportLinks": { # Links for exporting Google Docs to specific formats.
1036 "a_key": "A String", # A mapping from export format to URL
1037 },
1038 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001039 "permissions": [ # The list of permissions for users with access to this file.
1040 { # A permission for a file.
1041 "withLink": True or False, # Whether the link is required for this permission.
1042 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
1043 "name": "A String", # The name for this permission.
1044 "kind": "drive#permission", # This is always drive#permission.
1045 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1046 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1047 "authKey": "A String", # The authkey parameter required for this permission.
1048 "etag": "A String", # The ETag of the permission.
1049 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
1050 "photoLink": "A String", # A link to the profile photo, if available.
1051 "role": "A String", # The primary role for this user. Allowed values are:
1052 # - owner
1053 # - reader
1054 # - writer
1055 "type": "A String", # The account type. Allowed values are:
1056 # - user
1057 # - group
1058 # - domain
1059 # - anyone
1060 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1061 "A String",
1062 ],
1063 "selfLink": "A String", # A link back to this permission.
1064 },
1065 ],
John Asmuth614db982014-04-24 15:46:26 -04001066 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1067 "mimeType": "A String", # The MIME type of the thumbnail.
1068 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1069 },
1070 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
1071 "a_key": "A String",
1072 },
1073 "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.
1074 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1075 "exposureTime": 3.14, # The length of the exposure, in seconds.
1076 "cameraMake": "A String", # The make of the camera used to create the photo.
1077 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1078 "isoSpeed": 42, # The ISO speed used to create the photo.
1079 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1080 "exposureMode": "A String", # The exposure mode used to create the photo.
1081 "colorSpace": "A String", # The color space of the photo.
1082 "location": { # Geographic location information stored in the image.
1083 "latitude": 3.14, # The latitude stored in the image.
1084 "altitude": 3.14, # The altitude stored in the image.
1085 "longitude": 3.14, # The longitude stored in the image.
1086 },
1087 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1088 "height": 42, # The height of the image in pixels.
1089 "lens": "A String", # The lens used to create the photo.
1090 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1091 "width": 42, # The width of the image in pixels.
1092 "meteringMode": "A String", # The metering mode used to create the photo.
1093 "flashUsed": True or False, # Whether a flash was used to create the photo.
1094 "aperture": 3.14, # The aperture used to create the photo (f-number).
1095 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1096 "sensor": "A String", # The type of sensor used to create the photo.
1097 "whiteBalance": "A String", # The white balance mode used to create the photo.
1098 "cameraModel": "A String", # The model of the camera used to create the photo.
1099 },
1100 "description": "A String", # A short description of the file.
1101 "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.
1102 "editable": True or False, # Whether the file can be edited by the current user.
1103 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001104 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001105 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1106 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
1107 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1108 "properties": [ # The list of properties.
1109 { # A key-value pair that is either public or private to an application.
1110 "kind": "drive#property", # This is always drive#property.
1111 "value": "A String", # The value of this property.
1112 "etag": "A String", # ETag of the property.
1113 "visibility": "A String", # The visibility of this property.
1114 "key": "A String", # The key of this property.
1115 "selfLink": "A String", # The link back to this property.
1116 },
1117 ],
1118 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1119 "iconLink": "A String", # A link to the file's icon.
1120 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
1121 "embedLink": "A String", # A link for embedding the file.
1122 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
1123 "title": "A String", # The title of this file.
1124 "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.
1125 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1126 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1127 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001128 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04001129 "name": "A String", # The name for this permission.
1130 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001131 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1132 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04001133 "authKey": "A String", # The authkey parameter required for this permission.
1134 "etag": "A String", # The ETag of the permission.
Craig Citro065b5302014-08-14 00:47:23 -07001135 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
John Asmuth614db982014-04-24 15:46:26 -04001136 "photoLink": "A String", # A link to the profile photo, if available.
1137 "role": "A String", # The primary role for this user. Allowed values are:
1138 # - owner
1139 # - reader
1140 # - writer
1141 "type": "A String", # The account type. Allowed values are:
1142 # - user
1143 # - group
1144 # - domain
1145 # - anyone
1146 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1147 "A String",
1148 ],
1149 "selfLink": "A String", # A link back to this permission.
1150 },
1151 "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.
1152 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive.
1153 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1154 "selfLink": "A String", # A link back to this file.
1155 "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.
1156 }</pre>
1157</div>
1158
1159<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -07001160 <code class="details" id="list">list(q=None, projection=None, pageToken=None, maxResults=None, corpus=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04001161 <pre>Lists the user's files.
1162
1163Args:
1164 q: string, Query string for searching files.
1165 projection: string, This parameter is deprecated and has no function.
1166 Allowed values
1167 BASIC - Deprecated
1168 FULL - Deprecated
1169 pageToken: string, Page token for files.
1170 maxResults: integer, Maximum number of files to return.
Craig Citro065b5302014-08-14 00:47:23 -07001171 corpus: string, The body of items (files/documents) to which the query applies.
1172 Allowed values
1173 DEFAULT - The items that the user has accessed.
1174 DOMAIN - Items shared to the user's domain.
John Asmuth614db982014-04-24 15:46:26 -04001175
1176Returns:
1177 An object of the form:
1178
1179 { # A list of files.
1180 "nextPageToken": "A String", # The page token for the next page of files.
1181 "kind": "drive#fileList", # This is always drive#fileList.
1182 "items": [ # The actual list of files.
1183 { # The metadata for a file.
1184 "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.
1185 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001186 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
1187 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04001188 "thumbnailLink": "A String", # A link to the file's thumbnail.
1189 "labels": { # A group of labels for the file.
1190 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1191 "hidden": True or False, # Deprecated.
1192 "viewed": True or False, # Whether this file has been viewed by this user.
1193 "starred": True or False, # Whether this file is starred by the user.
1194 "trashed": True or False, # Whether this file has been trashed.
1195 },
1196 "indexableText": { # Indexable text attributes for the file (can only be written)
1197 "text": "A String", # The text to be indexed for this file.
1198 },
1199 "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.
1200 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1201 "writersCanShare": True or False, # Whether writers can share the document with other users.
1202 "owners": [ # The owner(s) of this file.
1203 { # The JSON template for a user.
1204 "picture": { # The user's profile picture.
1205 "url": "A String", # A URL that points to a profile picture of this user.
1206 },
1207 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001208 "displayName": "A String", # A plain text displayable name for this user.
1209 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001210 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1211 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001212 },
1213 ],
1214 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001215 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1216 "picture": { # The user's profile picture.
1217 "url": "A String", # A URL that points to a profile picture of this user.
1218 },
1219 "kind": "drive#user", # This is always drive#user.
1220 "displayName": "A String", # A plain text displayable name for this user.
1221 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1222 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1223 "emailAddress": "A String", # The email address of the user.
1224 },
John Asmuth614db982014-04-24 15:46:26 -04001225 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1226 "picture": { # The user's profile picture.
1227 "url": "A String", # A URL that points to a profile picture of this user.
1228 },
1229 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001230 "displayName": "A String", # A plain text displayable name for this user.
1231 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001232 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1233 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001234 },
1235 "copyable": True or False, # Whether the file can be copied by the current user.
1236 "ownerNames": [ # Name(s) of the owner(s) of this file.
1237 "A String",
1238 ],
1239 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1240 "webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
1241 "etag": "A String", # ETag of the file.
1242 "parents": [ # Collection of parent folders which contain this file.
1243 # 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.
1244 { # A reference to a file's parent.
1245 "selfLink": "A String", # A link back to this reference.
1246 "kind": "drive#parentReference", # This is always drive#parentReference.
1247 "id": "A String", # The ID of the parent.
1248 "isRoot": True or False, # Whether or not the parent is the root folder.
1249 "parentLink": "A String", # A link to the parent.
1250 },
1251 ],
1252 "exportLinks": { # Links for exporting Google Docs to specific formats.
1253 "a_key": "A String", # A mapping from export format to URL
1254 },
1255 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001256 "permissions": [ # The list of permissions for users with access to this file.
1257 { # A permission for a file.
1258 "withLink": True or False, # Whether the link is required for this permission.
1259 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
1260 "name": "A String", # The name for this permission.
1261 "kind": "drive#permission", # This is always drive#permission.
1262 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1263 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1264 "authKey": "A String", # The authkey parameter required for this permission.
1265 "etag": "A String", # The ETag of the permission.
1266 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
1267 "photoLink": "A String", # A link to the profile photo, if available.
1268 "role": "A String", # The primary role for this user. Allowed values are:
1269 # - owner
1270 # - reader
1271 # - writer
1272 "type": "A String", # The account type. Allowed values are:
1273 # - user
1274 # - group
1275 # - domain
1276 # - anyone
1277 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1278 "A String",
1279 ],
1280 "selfLink": "A String", # A link back to this permission.
1281 },
1282 ],
John Asmuth614db982014-04-24 15:46:26 -04001283 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1284 "mimeType": "A String", # The MIME type of the thumbnail.
1285 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1286 },
1287 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
1288 "a_key": "A String",
1289 },
1290 "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.
1291 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1292 "exposureTime": 3.14, # The length of the exposure, in seconds.
1293 "cameraMake": "A String", # The make of the camera used to create the photo.
1294 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1295 "isoSpeed": 42, # The ISO speed used to create the photo.
1296 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1297 "exposureMode": "A String", # The exposure mode used to create the photo.
1298 "colorSpace": "A String", # The color space of the photo.
1299 "location": { # Geographic location information stored in the image.
1300 "latitude": 3.14, # The latitude stored in the image.
1301 "altitude": 3.14, # The altitude stored in the image.
1302 "longitude": 3.14, # The longitude stored in the image.
1303 },
1304 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1305 "height": 42, # The height of the image in pixels.
1306 "lens": "A String", # The lens used to create the photo.
1307 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1308 "width": 42, # The width of the image in pixels.
1309 "meteringMode": "A String", # The metering mode used to create the photo.
1310 "flashUsed": True or False, # Whether a flash was used to create the photo.
1311 "aperture": 3.14, # The aperture used to create the photo (f-number).
1312 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1313 "sensor": "A String", # The type of sensor used to create the photo.
1314 "whiteBalance": "A String", # The white balance mode used to create the photo.
1315 "cameraModel": "A String", # The model of the camera used to create the photo.
1316 },
1317 "description": "A String", # A short description of the file.
1318 "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.
1319 "editable": True or False, # Whether the file can be edited by the current user.
1320 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001321 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001322 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1323 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
1324 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1325 "properties": [ # The list of properties.
1326 { # A key-value pair that is either public or private to an application.
1327 "kind": "drive#property", # This is always drive#property.
1328 "value": "A String", # The value of this property.
1329 "etag": "A String", # ETag of the property.
1330 "visibility": "A String", # The visibility of this property.
1331 "key": "A String", # The key of this property.
1332 "selfLink": "A String", # The link back to this property.
1333 },
1334 ],
1335 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1336 "iconLink": "A String", # A link to the file's icon.
1337 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
1338 "embedLink": "A String", # A link for embedding the file.
1339 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
1340 "title": "A String", # The title of this file.
1341 "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.
1342 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1343 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1344 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001345 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04001346 "name": "A String", # The name for this permission.
1347 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001348 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1349 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04001350 "authKey": "A String", # The authkey parameter required for this permission.
1351 "etag": "A String", # The ETag of the permission.
Craig Citro065b5302014-08-14 00:47:23 -07001352 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
John Asmuth614db982014-04-24 15:46:26 -04001353 "photoLink": "A String", # A link to the profile photo, if available.
1354 "role": "A String", # The primary role for this user. Allowed values are:
1355 # - owner
1356 # - reader
1357 # - writer
1358 "type": "A String", # The account type. Allowed values are:
1359 # - user
1360 # - group
1361 # - domain
1362 # - anyone
1363 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1364 "A String",
1365 ],
1366 "selfLink": "A String", # A link back to this permission.
1367 },
1368 "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.
1369 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive.
1370 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1371 "selfLink": "A String", # A link back to this file.
1372 "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.
1373 },
1374 ],
1375 "nextLink": "A String", # A link to the next page of files.
1376 "etag": "A String", # The ETag of the list.
1377 "selfLink": "A String", # A link back to this list.
1378 }</pre>
1379</div>
1380
1381<div class="method">
1382 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1383 <pre>Retrieves the next page of results.
1384
1385Args:
1386 previous_request: The request for the previous page. (required)
1387 previous_response: The response from the request for the previous page. (required)
1388
1389Returns:
1390 A request object that you can call 'execute()' on to request the next
1391 page. Returns None if there are no more items in the collection.
1392 </pre>
1393</div>
1394
1395<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -07001396 <code class="details" id="patch">patch(fileId, body, newRevision=None, pinned=None, ocrLanguage=None, ocr=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04001397 <pre>Updates file metadata and/or content. This method supports patch semantics.
1398
1399Args:
1400 fileId: string, The ID of the file to update. (required)
1401 body: object, The request body. (required)
1402 The object takes the form of:
1403
1404{ # The metadata for a file.
1405 "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.
1406 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001407 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
1408 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04001409 "thumbnailLink": "A String", # A link to the file's thumbnail.
1410 "labels": { # A group of labels for the file.
1411 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1412 "hidden": True or False, # Deprecated.
1413 "viewed": True or False, # Whether this file has been viewed by this user.
1414 "starred": True or False, # Whether this file is starred by the user.
1415 "trashed": True or False, # Whether this file has been trashed.
1416 },
1417 "indexableText": { # Indexable text attributes for the file (can only be written)
1418 "text": "A String", # The text to be indexed for this file.
1419 },
1420 "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.
1421 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1422 "writersCanShare": True or False, # Whether writers can share the document with other users.
1423 "owners": [ # The owner(s) of this file.
1424 { # The JSON template for a user.
1425 "picture": { # The user's profile picture.
1426 "url": "A String", # A URL that points to a profile picture of this user.
1427 },
1428 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001429 "displayName": "A String", # A plain text displayable name for this user.
1430 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001431 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1432 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001433 },
1434 ],
1435 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001436 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1437 "picture": { # The user's profile picture.
1438 "url": "A String", # A URL that points to a profile picture of this user.
1439 },
1440 "kind": "drive#user", # This is always drive#user.
1441 "displayName": "A String", # A plain text displayable name for this user.
1442 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1443 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1444 "emailAddress": "A String", # The email address of the user.
1445 },
John Asmuth614db982014-04-24 15:46:26 -04001446 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1447 "picture": { # The user's profile picture.
1448 "url": "A String", # A URL that points to a profile picture of this user.
1449 },
1450 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001451 "displayName": "A String", # A plain text displayable name for this user.
1452 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001453 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1454 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001455 },
1456 "copyable": True or False, # Whether the file can be copied by the current user.
1457 "ownerNames": [ # Name(s) of the owner(s) of this file.
1458 "A String",
1459 ],
1460 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1461 "webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
1462 "etag": "A String", # ETag of the file.
1463 "parents": [ # Collection of parent folders which contain this file.
1464 # 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.
1465 { # A reference to a file's parent.
1466 "selfLink": "A String", # A link back to this reference.
1467 "kind": "drive#parentReference", # This is always drive#parentReference.
1468 "id": "A String", # The ID of the parent.
1469 "isRoot": True or False, # Whether or not the parent is the root folder.
1470 "parentLink": "A String", # A link to the parent.
1471 },
1472 ],
1473 "exportLinks": { # Links for exporting Google Docs to specific formats.
1474 "a_key": "A String", # A mapping from export format to URL
1475 },
1476 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001477 "permissions": [ # The list of permissions for users with access to this file.
1478 { # A permission for a file.
1479 "withLink": True or False, # Whether the link is required for this permission.
1480 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
1481 "name": "A String", # The name for this permission.
1482 "kind": "drive#permission", # This is always drive#permission.
1483 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1484 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1485 "authKey": "A String", # The authkey parameter required for this permission.
1486 "etag": "A String", # The ETag of the permission.
1487 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
1488 "photoLink": "A String", # A link to the profile photo, if available.
1489 "role": "A String", # The primary role for this user. Allowed values are:
1490 # - owner
1491 # - reader
1492 # - writer
1493 "type": "A String", # The account type. Allowed values are:
1494 # - user
1495 # - group
1496 # - domain
1497 # - anyone
1498 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1499 "A String",
1500 ],
1501 "selfLink": "A String", # A link back to this permission.
1502 },
1503 ],
John Asmuth614db982014-04-24 15:46:26 -04001504 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1505 "mimeType": "A String", # The MIME type of the thumbnail.
1506 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1507 },
1508 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
1509 "a_key": "A String",
1510 },
1511 "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.
1512 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1513 "exposureTime": 3.14, # The length of the exposure, in seconds.
1514 "cameraMake": "A String", # The make of the camera used to create the photo.
1515 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1516 "isoSpeed": 42, # The ISO speed used to create the photo.
1517 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1518 "exposureMode": "A String", # The exposure mode used to create the photo.
1519 "colorSpace": "A String", # The color space of the photo.
1520 "location": { # Geographic location information stored in the image.
1521 "latitude": 3.14, # The latitude stored in the image.
1522 "altitude": 3.14, # The altitude stored in the image.
1523 "longitude": 3.14, # The longitude stored in the image.
1524 },
1525 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1526 "height": 42, # The height of the image in pixels.
1527 "lens": "A String", # The lens used to create the photo.
1528 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1529 "width": 42, # The width of the image in pixels.
1530 "meteringMode": "A String", # The metering mode used to create the photo.
1531 "flashUsed": True or False, # Whether a flash was used to create the photo.
1532 "aperture": 3.14, # The aperture used to create the photo (f-number).
1533 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1534 "sensor": "A String", # The type of sensor used to create the photo.
1535 "whiteBalance": "A String", # The white balance mode used to create the photo.
1536 "cameraModel": "A String", # The model of the camera used to create the photo.
1537 },
1538 "description": "A String", # A short description of the file.
1539 "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.
1540 "editable": True or False, # Whether the file can be edited by the current user.
1541 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001542 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001543 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1544 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
1545 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1546 "properties": [ # The list of properties.
1547 { # A key-value pair that is either public or private to an application.
1548 "kind": "drive#property", # This is always drive#property.
1549 "value": "A String", # The value of this property.
1550 "etag": "A String", # ETag of the property.
1551 "visibility": "A String", # The visibility of this property.
1552 "key": "A String", # The key of this property.
1553 "selfLink": "A String", # The link back to this property.
1554 },
1555 ],
1556 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1557 "iconLink": "A String", # A link to the file's icon.
1558 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
1559 "embedLink": "A String", # A link for embedding the file.
1560 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
1561 "title": "A String", # The title of this file.
1562 "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.
1563 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1564 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1565 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001566 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04001567 "name": "A String", # The name for this permission.
1568 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001569 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1570 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04001571 "authKey": "A String", # The authkey parameter required for this permission.
1572 "etag": "A String", # The ETag of the permission.
Craig Citro065b5302014-08-14 00:47:23 -07001573 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
John Asmuth614db982014-04-24 15:46:26 -04001574 "photoLink": "A String", # A link to the profile photo, if available.
1575 "role": "A String", # The primary role for this user. Allowed values are:
1576 # - owner
1577 # - reader
1578 # - writer
1579 "type": "A String", # The account type. Allowed values are:
1580 # - user
1581 # - group
1582 # - domain
1583 # - anyone
1584 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1585 "A String",
1586 ],
1587 "selfLink": "A String", # A link back to this permission.
1588 },
1589 "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.
1590 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive.
1591 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1592 "selfLink": "A String", # A link back to this file.
1593 "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.
1594}
1595
1596 newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If not set or true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).
1597 pinned: boolean, Whether to pin the new revision.
1598 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
1599 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Craig Citro065b5302014-08-14 00:47:23 -07001600 addParents: string, Comma-separated list of parent IDs to add.
1601 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04001602 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
1603 timedTextTrackName: string, The timed text track name.
1604 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
1605 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
1606 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
1607 timedTextLanguage: string, The language of the timed text.
1608
1609Returns:
1610 An object of the form:
1611
1612 { # The metadata for a file.
1613 "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.
1614 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001615 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
1616 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04001617 "thumbnailLink": "A String", # A link to the file's thumbnail.
1618 "labels": { # A group of labels for the file.
1619 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1620 "hidden": True or False, # Deprecated.
1621 "viewed": True or False, # Whether this file has been viewed by this user.
1622 "starred": True or False, # Whether this file is starred by the user.
1623 "trashed": True or False, # Whether this file has been trashed.
1624 },
1625 "indexableText": { # Indexable text attributes for the file (can only be written)
1626 "text": "A String", # The text to be indexed for this file.
1627 },
1628 "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.
1629 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1630 "writersCanShare": True or False, # Whether writers can share the document with other users.
1631 "owners": [ # The owner(s) of this file.
1632 { # The JSON template for a user.
1633 "picture": { # The user's profile picture.
1634 "url": "A String", # A URL that points to a profile picture of this user.
1635 },
1636 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001637 "displayName": "A String", # A plain text displayable name for this user.
1638 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001639 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1640 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001641 },
1642 ],
1643 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001644 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1645 "picture": { # The user's profile picture.
1646 "url": "A String", # A URL that points to a profile picture of this user.
1647 },
1648 "kind": "drive#user", # This is always drive#user.
1649 "displayName": "A String", # A plain text displayable name for this user.
1650 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1651 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1652 "emailAddress": "A String", # The email address of the user.
1653 },
John Asmuth614db982014-04-24 15:46:26 -04001654 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1655 "picture": { # The user's profile picture.
1656 "url": "A String", # A URL that points to a profile picture of this user.
1657 },
1658 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001659 "displayName": "A String", # A plain text displayable name for this user.
1660 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001661 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1662 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001663 },
1664 "copyable": True or False, # Whether the file can be copied by the current user.
1665 "ownerNames": [ # Name(s) of the owner(s) of this file.
1666 "A String",
1667 ],
1668 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1669 "webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
1670 "etag": "A String", # ETag of the file.
1671 "parents": [ # Collection of parent folders which contain this file.
1672 # 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.
1673 { # A reference to a file's parent.
1674 "selfLink": "A String", # A link back to this reference.
1675 "kind": "drive#parentReference", # This is always drive#parentReference.
1676 "id": "A String", # The ID of the parent.
1677 "isRoot": True or False, # Whether or not the parent is the root folder.
1678 "parentLink": "A String", # A link to the parent.
1679 },
1680 ],
1681 "exportLinks": { # Links for exporting Google Docs to specific formats.
1682 "a_key": "A String", # A mapping from export format to URL
1683 },
1684 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001685 "permissions": [ # The list of permissions for users with access to this file.
1686 { # A permission for a file.
1687 "withLink": True or False, # Whether the link is required for this permission.
1688 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
1689 "name": "A String", # The name for this permission.
1690 "kind": "drive#permission", # This is always drive#permission.
1691 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1692 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1693 "authKey": "A String", # The authkey parameter required for this permission.
1694 "etag": "A String", # The ETag of the permission.
1695 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
1696 "photoLink": "A String", # A link to the profile photo, if available.
1697 "role": "A String", # The primary role for this user. Allowed values are:
1698 # - owner
1699 # - reader
1700 # - writer
1701 "type": "A String", # The account type. Allowed values are:
1702 # - user
1703 # - group
1704 # - domain
1705 # - anyone
1706 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1707 "A String",
1708 ],
1709 "selfLink": "A String", # A link back to this permission.
1710 },
1711 ],
John Asmuth614db982014-04-24 15:46:26 -04001712 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1713 "mimeType": "A String", # The MIME type of the thumbnail.
1714 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1715 },
1716 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
1717 "a_key": "A String",
1718 },
1719 "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.
1720 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1721 "exposureTime": 3.14, # The length of the exposure, in seconds.
1722 "cameraMake": "A String", # The make of the camera used to create the photo.
1723 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1724 "isoSpeed": 42, # The ISO speed used to create the photo.
1725 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1726 "exposureMode": "A String", # The exposure mode used to create the photo.
1727 "colorSpace": "A String", # The color space of the photo.
1728 "location": { # Geographic location information stored in the image.
1729 "latitude": 3.14, # The latitude stored in the image.
1730 "altitude": 3.14, # The altitude stored in the image.
1731 "longitude": 3.14, # The longitude stored in the image.
1732 },
1733 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1734 "height": 42, # The height of the image in pixels.
1735 "lens": "A String", # The lens used to create the photo.
1736 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1737 "width": 42, # The width of the image in pixels.
1738 "meteringMode": "A String", # The metering mode used to create the photo.
1739 "flashUsed": True or False, # Whether a flash was used to create the photo.
1740 "aperture": 3.14, # The aperture used to create the photo (f-number).
1741 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1742 "sensor": "A String", # The type of sensor used to create the photo.
1743 "whiteBalance": "A String", # The white balance mode used to create the photo.
1744 "cameraModel": "A String", # The model of the camera used to create the photo.
1745 },
1746 "description": "A String", # A short description of the file.
1747 "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.
1748 "editable": True or False, # Whether the file can be edited by the current user.
1749 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001750 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001751 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1752 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
1753 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1754 "properties": [ # The list of properties.
1755 { # A key-value pair that is either public or private to an application.
1756 "kind": "drive#property", # This is always drive#property.
1757 "value": "A String", # The value of this property.
1758 "etag": "A String", # ETag of the property.
1759 "visibility": "A String", # The visibility of this property.
1760 "key": "A String", # The key of this property.
1761 "selfLink": "A String", # The link back to this property.
1762 },
1763 ],
1764 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1765 "iconLink": "A String", # A link to the file's icon.
1766 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
1767 "embedLink": "A String", # A link for embedding the file.
1768 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
1769 "title": "A String", # The title of this file.
1770 "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.
1771 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1772 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1773 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001774 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04001775 "name": "A String", # The name for this permission.
1776 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001777 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1778 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04001779 "authKey": "A String", # The authkey parameter required for this permission.
1780 "etag": "A String", # The ETag of the permission.
Craig Citro065b5302014-08-14 00:47:23 -07001781 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
John Asmuth614db982014-04-24 15:46:26 -04001782 "photoLink": "A String", # A link to the profile photo, if available.
1783 "role": "A String", # The primary role for this user. Allowed values are:
1784 # - owner
1785 # - reader
1786 # - writer
1787 "type": "A String", # The account type. Allowed values are:
1788 # - user
1789 # - group
1790 # - domain
1791 # - anyone
1792 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1793 "A String",
1794 ],
1795 "selfLink": "A String", # A link back to this permission.
1796 },
1797 "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.
1798 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive.
1799 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1800 "selfLink": "A String", # A link back to this file.
1801 "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.
1802 }</pre>
1803</div>
1804
1805<div class="method">
1806 <code class="details" id="touch">touch(fileId)</code>
1807 <pre>Set the file's updated time to the current server time.
1808
1809Args:
1810 fileId: string, The ID of the file to update. (required)
1811
1812Returns:
1813 An object of the form:
1814
1815 { # The metadata for a file.
1816 "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.
1817 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001818 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
1819 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04001820 "thumbnailLink": "A String", # A link to the file's thumbnail.
1821 "labels": { # A group of labels for the file.
1822 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1823 "hidden": True or False, # Deprecated.
1824 "viewed": True or False, # Whether this file has been viewed by this user.
1825 "starred": True or False, # Whether this file is starred by the user.
1826 "trashed": True or False, # Whether this file has been trashed.
1827 },
1828 "indexableText": { # Indexable text attributes for the file (can only be written)
1829 "text": "A String", # The text to be indexed for this file.
1830 },
1831 "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.
1832 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1833 "writersCanShare": True or False, # Whether writers can share the document with other users.
1834 "owners": [ # The owner(s) of this file.
1835 { # The JSON template for a user.
1836 "picture": { # The user's profile picture.
1837 "url": "A String", # A URL that points to a profile picture of this user.
1838 },
1839 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001840 "displayName": "A String", # A plain text displayable name for this user.
1841 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001842 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1843 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001844 },
1845 ],
1846 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001847 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1848 "picture": { # The user's profile picture.
1849 "url": "A String", # A URL that points to a profile picture of this user.
1850 },
1851 "kind": "drive#user", # This is always drive#user.
1852 "displayName": "A String", # A plain text displayable name for this user.
1853 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1854 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1855 "emailAddress": "A String", # The email address of the user.
1856 },
John Asmuth614db982014-04-24 15:46:26 -04001857 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1858 "picture": { # The user's profile picture.
1859 "url": "A String", # A URL that points to a profile picture of this user.
1860 },
1861 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001862 "displayName": "A String", # A plain text displayable name for this user.
1863 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001864 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1865 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001866 },
1867 "copyable": True or False, # Whether the file can be copied by the current user.
1868 "ownerNames": [ # Name(s) of the owner(s) of this file.
1869 "A String",
1870 ],
1871 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1872 "webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
1873 "etag": "A String", # ETag of the file.
1874 "parents": [ # Collection of parent folders which contain this file.
1875 # 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.
1876 { # A reference to a file's parent.
1877 "selfLink": "A String", # A link back to this reference.
1878 "kind": "drive#parentReference", # This is always drive#parentReference.
1879 "id": "A String", # The ID of the parent.
1880 "isRoot": True or False, # Whether or not the parent is the root folder.
1881 "parentLink": "A String", # A link to the parent.
1882 },
1883 ],
1884 "exportLinks": { # Links for exporting Google Docs to specific formats.
1885 "a_key": "A String", # A mapping from export format to URL
1886 },
1887 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001888 "permissions": [ # The list of permissions for users with access to this file.
1889 { # A permission for a file.
1890 "withLink": True or False, # Whether the link is required for this permission.
1891 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
1892 "name": "A String", # The name for this permission.
1893 "kind": "drive#permission", # This is always drive#permission.
1894 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1895 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1896 "authKey": "A String", # The authkey parameter required for this permission.
1897 "etag": "A String", # The ETag of the permission.
1898 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
1899 "photoLink": "A String", # A link to the profile photo, if available.
1900 "role": "A String", # The primary role for this user. Allowed values are:
1901 # - owner
1902 # - reader
1903 # - writer
1904 "type": "A String", # The account type. Allowed values are:
1905 # - user
1906 # - group
1907 # - domain
1908 # - anyone
1909 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1910 "A String",
1911 ],
1912 "selfLink": "A String", # A link back to this permission.
1913 },
1914 ],
John Asmuth614db982014-04-24 15:46:26 -04001915 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1916 "mimeType": "A String", # The MIME type of the thumbnail.
1917 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1918 },
1919 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
1920 "a_key": "A String",
1921 },
1922 "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.
1923 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1924 "exposureTime": 3.14, # The length of the exposure, in seconds.
1925 "cameraMake": "A String", # The make of the camera used to create the photo.
1926 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1927 "isoSpeed": 42, # The ISO speed used to create the photo.
1928 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1929 "exposureMode": "A String", # The exposure mode used to create the photo.
1930 "colorSpace": "A String", # The color space of the photo.
1931 "location": { # Geographic location information stored in the image.
1932 "latitude": 3.14, # The latitude stored in the image.
1933 "altitude": 3.14, # The altitude stored in the image.
1934 "longitude": 3.14, # The longitude stored in the image.
1935 },
1936 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1937 "height": 42, # The height of the image in pixels.
1938 "lens": "A String", # The lens used to create the photo.
1939 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1940 "width": 42, # The width of the image in pixels.
1941 "meteringMode": "A String", # The metering mode used to create the photo.
1942 "flashUsed": True or False, # Whether a flash was used to create the photo.
1943 "aperture": 3.14, # The aperture used to create the photo (f-number).
1944 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1945 "sensor": "A String", # The type of sensor used to create the photo.
1946 "whiteBalance": "A String", # The white balance mode used to create the photo.
1947 "cameraModel": "A String", # The model of the camera used to create the photo.
1948 },
1949 "description": "A String", # A short description of the file.
1950 "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.
1951 "editable": True or False, # Whether the file can be edited by the current user.
1952 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001953 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001954 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1955 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
1956 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1957 "properties": [ # The list of properties.
1958 { # A key-value pair that is either public or private to an application.
1959 "kind": "drive#property", # This is always drive#property.
1960 "value": "A String", # The value of this property.
1961 "etag": "A String", # ETag of the property.
1962 "visibility": "A String", # The visibility of this property.
1963 "key": "A String", # The key of this property.
1964 "selfLink": "A String", # The link back to this property.
1965 },
1966 ],
1967 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1968 "iconLink": "A String", # A link to the file's icon.
1969 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
1970 "embedLink": "A String", # A link for embedding the file.
1971 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
1972 "title": "A String", # The title of this file.
1973 "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.
1974 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1975 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1976 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001977 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04001978 "name": "A String", # The name for this permission.
1979 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001980 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1981 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04001982 "authKey": "A String", # The authkey parameter required for this permission.
1983 "etag": "A String", # The ETag of the permission.
Craig Citro065b5302014-08-14 00:47:23 -07001984 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
John Asmuth614db982014-04-24 15:46:26 -04001985 "photoLink": "A String", # A link to the profile photo, if available.
1986 "role": "A String", # The primary role for this user. Allowed values are:
1987 # - owner
1988 # - reader
1989 # - writer
1990 "type": "A String", # The account type. Allowed values are:
1991 # - user
1992 # - group
1993 # - domain
1994 # - anyone
1995 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1996 "A String",
1997 ],
1998 "selfLink": "A String", # A link back to this permission.
1999 },
2000 "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.
2001 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive.
2002 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2003 "selfLink": "A String", # A link back to this file.
2004 "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.
2005 }</pre>
2006</div>
2007
2008<div class="method">
2009 <code class="details" id="trash">trash(fileId)</code>
2010 <pre>Moves a file to the trash.
2011
2012Args:
2013 fileId: string, The ID of the file to trash. (required)
2014
2015Returns:
2016 An object of the form:
2017
2018 { # The metadata for a file.
2019 "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.
2020 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002021 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
2022 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04002023 "thumbnailLink": "A String", # A link to the file's thumbnail.
2024 "labels": { # A group of labels for the file.
2025 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2026 "hidden": True or False, # Deprecated.
2027 "viewed": True or False, # Whether this file has been viewed by this user.
2028 "starred": True or False, # Whether this file is starred by the user.
2029 "trashed": True or False, # Whether this file has been trashed.
2030 },
2031 "indexableText": { # Indexable text attributes for the file (can only be written)
2032 "text": "A String", # The text to be indexed for this file.
2033 },
2034 "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.
2035 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2036 "writersCanShare": True or False, # Whether writers can share the document with other users.
2037 "owners": [ # The owner(s) of this file.
2038 { # The JSON template for a user.
2039 "picture": { # The user's profile picture.
2040 "url": "A String", # A URL that points to a profile picture of this user.
2041 },
2042 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002043 "displayName": "A String", # A plain text displayable name for this user.
2044 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002045 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2046 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002047 },
2048 ],
2049 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002050 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2051 "picture": { # The user's profile picture.
2052 "url": "A String", # A URL that points to a profile picture of this user.
2053 },
2054 "kind": "drive#user", # This is always drive#user.
2055 "displayName": "A String", # A plain text displayable name for this user.
2056 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2057 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2058 "emailAddress": "A String", # The email address of the user.
2059 },
John Asmuth614db982014-04-24 15:46:26 -04002060 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2061 "picture": { # The user's profile picture.
2062 "url": "A String", # A URL that points to a profile picture of this user.
2063 },
2064 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002065 "displayName": "A String", # A plain text displayable name for this user.
2066 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002067 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2068 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002069 },
2070 "copyable": True or False, # Whether the file can be copied by the current user.
2071 "ownerNames": [ # Name(s) of the owner(s) of this file.
2072 "A String",
2073 ],
2074 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2075 "webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
2076 "etag": "A String", # ETag of the file.
2077 "parents": [ # Collection of parent folders which contain this file.
2078 # 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.
2079 { # A reference to a file's parent.
2080 "selfLink": "A String", # A link back to this reference.
2081 "kind": "drive#parentReference", # This is always drive#parentReference.
2082 "id": "A String", # The ID of the parent.
2083 "isRoot": True or False, # Whether or not the parent is the root folder.
2084 "parentLink": "A String", # A link to the parent.
2085 },
2086 ],
2087 "exportLinks": { # Links for exporting Google Docs to specific formats.
2088 "a_key": "A String", # A mapping from export format to URL
2089 },
2090 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002091 "permissions": [ # The list of permissions for users with access to this file.
2092 { # A permission for a file.
2093 "withLink": True or False, # Whether the link is required for this permission.
2094 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
2095 "name": "A String", # The name for this permission.
2096 "kind": "drive#permission", # This is always drive#permission.
2097 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2098 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2099 "authKey": "A String", # The authkey parameter required for this permission.
2100 "etag": "A String", # The ETag of the permission.
2101 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
2102 "photoLink": "A String", # A link to the profile photo, if available.
2103 "role": "A String", # The primary role for this user. Allowed values are:
2104 # - owner
2105 # - reader
2106 # - writer
2107 "type": "A String", # The account type. Allowed values are:
2108 # - user
2109 # - group
2110 # - domain
2111 # - anyone
2112 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2113 "A String",
2114 ],
2115 "selfLink": "A String", # A link back to this permission.
2116 },
2117 ],
John Asmuth614db982014-04-24 15:46:26 -04002118 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2119 "mimeType": "A String", # The MIME type of the thumbnail.
2120 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2121 },
2122 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
2123 "a_key": "A String",
2124 },
2125 "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.
2126 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2127 "exposureTime": 3.14, # The length of the exposure, in seconds.
2128 "cameraMake": "A String", # The make of the camera used to create the photo.
2129 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2130 "isoSpeed": 42, # The ISO speed used to create the photo.
2131 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2132 "exposureMode": "A String", # The exposure mode used to create the photo.
2133 "colorSpace": "A String", # The color space of the photo.
2134 "location": { # Geographic location information stored in the image.
2135 "latitude": 3.14, # The latitude stored in the image.
2136 "altitude": 3.14, # The altitude stored in the image.
2137 "longitude": 3.14, # The longitude stored in the image.
2138 },
2139 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2140 "height": 42, # The height of the image in pixels.
2141 "lens": "A String", # The lens used to create the photo.
2142 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2143 "width": 42, # The width of the image in pixels.
2144 "meteringMode": "A String", # The metering mode used to create the photo.
2145 "flashUsed": True or False, # Whether a flash was used to create the photo.
2146 "aperture": 3.14, # The aperture used to create the photo (f-number).
2147 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2148 "sensor": "A String", # The type of sensor used to create the photo.
2149 "whiteBalance": "A String", # The white balance mode used to create the photo.
2150 "cameraModel": "A String", # The model of the camera used to create the photo.
2151 },
2152 "description": "A String", # A short description of the file.
2153 "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.
2154 "editable": True or False, # Whether the file can be edited by the current user.
2155 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002156 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002157 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2158 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
2159 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
2160 "properties": [ # The list of properties.
2161 { # A key-value pair that is either public or private to an application.
2162 "kind": "drive#property", # This is always drive#property.
2163 "value": "A String", # The value of this property.
2164 "etag": "A String", # ETag of the property.
2165 "visibility": "A String", # The visibility of this property.
2166 "key": "A String", # The key of this property.
2167 "selfLink": "A String", # The link back to this property.
2168 },
2169 ],
2170 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2171 "iconLink": "A String", # A link to the file's icon.
2172 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
2173 "embedLink": "A String", # A link for embedding the file.
2174 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
2175 "title": "A String", # The title of this file.
2176 "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.
2177 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2178 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2179 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002180 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04002181 "name": "A String", # The name for this permission.
2182 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002183 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2184 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04002185 "authKey": "A String", # The authkey parameter required for this permission.
2186 "etag": "A String", # The ETag of the permission.
Craig Citro065b5302014-08-14 00:47:23 -07002187 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
John Asmuth614db982014-04-24 15:46:26 -04002188 "photoLink": "A String", # A link to the profile photo, if available.
2189 "role": "A String", # The primary role for this user. Allowed values are:
2190 # - owner
2191 # - reader
2192 # - writer
2193 "type": "A String", # The account type. Allowed values are:
2194 # - user
2195 # - group
2196 # - domain
2197 # - anyone
2198 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2199 "A String",
2200 ],
2201 "selfLink": "A String", # A link back to this permission.
2202 },
2203 "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.
2204 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive.
2205 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2206 "selfLink": "A String", # A link back to this file.
2207 "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.
2208 }</pre>
2209</div>
2210
2211<div class="method">
2212 <code class="details" id="untrash">untrash(fileId)</code>
2213 <pre>Restores a file from the trash.
2214
2215Args:
2216 fileId: string, The ID of the file to untrash. (required)
2217
2218Returns:
2219 An object of the form:
2220
2221 { # The metadata for a file.
2222 "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.
2223 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002224 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
2225 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04002226 "thumbnailLink": "A String", # A link to the file's thumbnail.
2227 "labels": { # A group of labels for the file.
2228 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2229 "hidden": True or False, # Deprecated.
2230 "viewed": True or False, # Whether this file has been viewed by this user.
2231 "starred": True or False, # Whether this file is starred by the user.
2232 "trashed": True or False, # Whether this file has been trashed.
2233 },
2234 "indexableText": { # Indexable text attributes for the file (can only be written)
2235 "text": "A String", # The text to be indexed for this file.
2236 },
2237 "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.
2238 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2239 "writersCanShare": True or False, # Whether writers can share the document with other users.
2240 "owners": [ # The owner(s) of this file.
2241 { # The JSON template for a user.
2242 "picture": { # The user's profile picture.
2243 "url": "A String", # A URL that points to a profile picture of this user.
2244 },
2245 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002246 "displayName": "A String", # A plain text displayable name for this user.
2247 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002248 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2249 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002250 },
2251 ],
2252 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002253 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2254 "picture": { # The user's profile picture.
2255 "url": "A String", # A URL that points to a profile picture of this user.
2256 },
2257 "kind": "drive#user", # This is always drive#user.
2258 "displayName": "A String", # A plain text displayable name for this user.
2259 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2260 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2261 "emailAddress": "A String", # The email address of the user.
2262 },
John Asmuth614db982014-04-24 15:46:26 -04002263 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2264 "picture": { # The user's profile picture.
2265 "url": "A String", # A URL that points to a profile picture of this user.
2266 },
2267 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002268 "displayName": "A String", # A plain text displayable name for this user.
2269 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002270 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2271 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002272 },
2273 "copyable": True or False, # Whether the file can be copied by the current user.
2274 "ownerNames": [ # Name(s) of the owner(s) of this file.
2275 "A String",
2276 ],
2277 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2278 "webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
2279 "etag": "A String", # ETag of the file.
2280 "parents": [ # Collection of parent folders which contain this file.
2281 # 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.
2282 { # A reference to a file's parent.
2283 "selfLink": "A String", # A link back to this reference.
2284 "kind": "drive#parentReference", # This is always drive#parentReference.
2285 "id": "A String", # The ID of the parent.
2286 "isRoot": True or False, # Whether or not the parent is the root folder.
2287 "parentLink": "A String", # A link to the parent.
2288 },
2289 ],
2290 "exportLinks": { # Links for exporting Google Docs to specific formats.
2291 "a_key": "A String", # A mapping from export format to URL
2292 },
2293 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002294 "permissions": [ # The list of permissions for users with access to this file.
2295 { # A permission for a file.
2296 "withLink": True or False, # Whether the link is required for this permission.
2297 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
2298 "name": "A String", # The name for this permission.
2299 "kind": "drive#permission", # This is always drive#permission.
2300 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2301 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2302 "authKey": "A String", # The authkey parameter required for this permission.
2303 "etag": "A String", # The ETag of the permission.
2304 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
2305 "photoLink": "A String", # A link to the profile photo, if available.
2306 "role": "A String", # The primary role for this user. Allowed values are:
2307 # - owner
2308 # - reader
2309 # - writer
2310 "type": "A String", # The account type. Allowed values are:
2311 # - user
2312 # - group
2313 # - domain
2314 # - anyone
2315 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2316 "A String",
2317 ],
2318 "selfLink": "A String", # A link back to this permission.
2319 },
2320 ],
John Asmuth614db982014-04-24 15:46:26 -04002321 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2322 "mimeType": "A String", # The MIME type of the thumbnail.
2323 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2324 },
2325 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
2326 "a_key": "A String",
2327 },
2328 "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.
2329 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2330 "exposureTime": 3.14, # The length of the exposure, in seconds.
2331 "cameraMake": "A String", # The make of the camera used to create the photo.
2332 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2333 "isoSpeed": 42, # The ISO speed used to create the photo.
2334 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2335 "exposureMode": "A String", # The exposure mode used to create the photo.
2336 "colorSpace": "A String", # The color space of the photo.
2337 "location": { # Geographic location information stored in the image.
2338 "latitude": 3.14, # The latitude stored in the image.
2339 "altitude": 3.14, # The altitude stored in the image.
2340 "longitude": 3.14, # The longitude stored in the image.
2341 },
2342 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2343 "height": 42, # The height of the image in pixels.
2344 "lens": "A String", # The lens used to create the photo.
2345 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2346 "width": 42, # The width of the image in pixels.
2347 "meteringMode": "A String", # The metering mode used to create the photo.
2348 "flashUsed": True or False, # Whether a flash was used to create the photo.
2349 "aperture": 3.14, # The aperture used to create the photo (f-number).
2350 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2351 "sensor": "A String", # The type of sensor used to create the photo.
2352 "whiteBalance": "A String", # The white balance mode used to create the photo.
2353 "cameraModel": "A String", # The model of the camera used to create the photo.
2354 },
2355 "description": "A String", # A short description of the file.
2356 "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.
2357 "editable": True or False, # Whether the file can be edited by the current user.
2358 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002359 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002360 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2361 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
2362 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
2363 "properties": [ # The list of properties.
2364 { # A key-value pair that is either public or private to an application.
2365 "kind": "drive#property", # This is always drive#property.
2366 "value": "A String", # The value of this property.
2367 "etag": "A String", # ETag of the property.
2368 "visibility": "A String", # The visibility of this property.
2369 "key": "A String", # The key of this property.
2370 "selfLink": "A String", # The link back to this property.
2371 },
2372 ],
2373 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2374 "iconLink": "A String", # A link to the file's icon.
2375 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
2376 "embedLink": "A String", # A link for embedding the file.
2377 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
2378 "title": "A String", # The title of this file.
2379 "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.
2380 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2381 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2382 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002383 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04002384 "name": "A String", # The name for this permission.
2385 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002386 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2387 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04002388 "authKey": "A String", # The authkey parameter required for this permission.
2389 "etag": "A String", # The ETag of the permission.
Craig Citro065b5302014-08-14 00:47:23 -07002390 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
John Asmuth614db982014-04-24 15:46:26 -04002391 "photoLink": "A String", # A link to the profile photo, if available.
2392 "role": "A String", # The primary role for this user. Allowed values are:
2393 # - owner
2394 # - reader
2395 # - writer
2396 "type": "A String", # The account type. Allowed values are:
2397 # - user
2398 # - group
2399 # - domain
2400 # - anyone
2401 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2402 "A String",
2403 ],
2404 "selfLink": "A String", # A link back to this permission.
2405 },
2406 "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.
2407 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive.
2408 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2409 "selfLink": "A String", # A link back to this file.
2410 "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.
2411 }</pre>
2412</div>
2413
2414<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -07002415 <code class="details" id="update">update(fileId, body=None, newRevision=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04002416 <pre>Updates file metadata and/or content.
2417
2418Args:
2419 fileId: string, The ID of the file to update. (required)
2420 body: object, The request body.
2421 The object takes the form of:
2422
2423{ # The metadata for a file.
2424 "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.
2425 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002426 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
2427 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04002428 "thumbnailLink": "A String", # A link to the file's thumbnail.
2429 "labels": { # A group of labels for the file.
2430 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2431 "hidden": True or False, # Deprecated.
2432 "viewed": True or False, # Whether this file has been viewed by this user.
2433 "starred": True or False, # Whether this file is starred by the user.
2434 "trashed": True or False, # Whether this file has been trashed.
2435 },
2436 "indexableText": { # Indexable text attributes for the file (can only be written)
2437 "text": "A String", # The text to be indexed for this file.
2438 },
2439 "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.
2440 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2441 "writersCanShare": True or False, # Whether writers can share the document with other users.
2442 "owners": [ # The owner(s) of this file.
2443 { # The JSON template for a user.
2444 "picture": { # The user's profile picture.
2445 "url": "A String", # A URL that points to a profile picture of this user.
2446 },
2447 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002448 "displayName": "A String", # A plain text displayable name for this user.
2449 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002450 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2451 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002452 },
2453 ],
2454 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002455 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2456 "picture": { # The user's profile picture.
2457 "url": "A String", # A URL that points to a profile picture of this user.
2458 },
2459 "kind": "drive#user", # This is always drive#user.
2460 "displayName": "A String", # A plain text displayable name for this user.
2461 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2462 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2463 "emailAddress": "A String", # The email address of the user.
2464 },
John Asmuth614db982014-04-24 15:46:26 -04002465 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2466 "picture": { # The user's profile picture.
2467 "url": "A String", # A URL that points to a profile picture of this user.
2468 },
2469 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002470 "displayName": "A String", # A plain text displayable name for this user.
2471 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002472 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2473 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002474 },
2475 "copyable": True or False, # Whether the file can be copied by the current user.
2476 "ownerNames": [ # Name(s) of the owner(s) of this file.
2477 "A String",
2478 ],
2479 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2480 "webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
2481 "etag": "A String", # ETag of the file.
2482 "parents": [ # Collection of parent folders which contain this file.
2483 # 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.
2484 { # A reference to a file's parent.
2485 "selfLink": "A String", # A link back to this reference.
2486 "kind": "drive#parentReference", # This is always drive#parentReference.
2487 "id": "A String", # The ID of the parent.
2488 "isRoot": True or False, # Whether or not the parent is the root folder.
2489 "parentLink": "A String", # A link to the parent.
2490 },
2491 ],
2492 "exportLinks": { # Links for exporting Google Docs to specific formats.
2493 "a_key": "A String", # A mapping from export format to URL
2494 },
2495 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002496 "permissions": [ # The list of permissions for users with access to this file.
2497 { # A permission for a file.
2498 "withLink": True or False, # Whether the link is required for this permission.
2499 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
2500 "name": "A String", # The name for this permission.
2501 "kind": "drive#permission", # This is always drive#permission.
2502 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2503 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2504 "authKey": "A String", # The authkey parameter required for this permission.
2505 "etag": "A String", # The ETag of the permission.
2506 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
2507 "photoLink": "A String", # A link to the profile photo, if available.
2508 "role": "A String", # The primary role for this user. Allowed values are:
2509 # - owner
2510 # - reader
2511 # - writer
2512 "type": "A String", # The account type. Allowed values are:
2513 # - user
2514 # - group
2515 # - domain
2516 # - anyone
2517 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2518 "A String",
2519 ],
2520 "selfLink": "A String", # A link back to this permission.
2521 },
2522 ],
John Asmuth614db982014-04-24 15:46:26 -04002523 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2524 "mimeType": "A String", # The MIME type of the thumbnail.
2525 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2526 },
2527 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
2528 "a_key": "A String",
2529 },
2530 "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.
2531 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2532 "exposureTime": 3.14, # The length of the exposure, in seconds.
2533 "cameraMake": "A String", # The make of the camera used to create the photo.
2534 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2535 "isoSpeed": 42, # The ISO speed used to create the photo.
2536 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2537 "exposureMode": "A String", # The exposure mode used to create the photo.
2538 "colorSpace": "A String", # The color space of the photo.
2539 "location": { # Geographic location information stored in the image.
2540 "latitude": 3.14, # The latitude stored in the image.
2541 "altitude": 3.14, # The altitude stored in the image.
2542 "longitude": 3.14, # The longitude stored in the image.
2543 },
2544 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2545 "height": 42, # The height of the image in pixels.
2546 "lens": "A String", # The lens used to create the photo.
2547 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2548 "width": 42, # The width of the image in pixels.
2549 "meteringMode": "A String", # The metering mode used to create the photo.
2550 "flashUsed": True or False, # Whether a flash was used to create the photo.
2551 "aperture": 3.14, # The aperture used to create the photo (f-number).
2552 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2553 "sensor": "A String", # The type of sensor used to create the photo.
2554 "whiteBalance": "A String", # The white balance mode used to create the photo.
2555 "cameraModel": "A String", # The model of the camera used to create the photo.
2556 },
2557 "description": "A String", # A short description of the file.
2558 "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.
2559 "editable": True or False, # Whether the file can be edited by the current user.
2560 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002561 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002562 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2563 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
2564 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
2565 "properties": [ # The list of properties.
2566 { # A key-value pair that is either public or private to an application.
2567 "kind": "drive#property", # This is always drive#property.
2568 "value": "A String", # The value of this property.
2569 "etag": "A String", # ETag of the property.
2570 "visibility": "A String", # The visibility of this property.
2571 "key": "A String", # The key of this property.
2572 "selfLink": "A String", # The link back to this property.
2573 },
2574 ],
2575 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2576 "iconLink": "A String", # A link to the file's icon.
2577 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
2578 "embedLink": "A String", # A link for embedding the file.
2579 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
2580 "title": "A String", # The title of this file.
2581 "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.
2582 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2583 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2584 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002585 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04002586 "name": "A String", # The name for this permission.
2587 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002588 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2589 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04002590 "authKey": "A String", # The authkey parameter required for this permission.
2591 "etag": "A String", # The ETag of the permission.
Craig Citro065b5302014-08-14 00:47:23 -07002592 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
John Asmuth614db982014-04-24 15:46:26 -04002593 "photoLink": "A String", # A link to the profile photo, if available.
2594 "role": "A String", # The primary role for this user. Allowed values are:
2595 # - owner
2596 # - reader
2597 # - writer
2598 "type": "A String", # The account type. Allowed values are:
2599 # - user
2600 # - group
2601 # - domain
2602 # - anyone
2603 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2604 "A String",
2605 ],
2606 "selfLink": "A String", # A link back to this permission.
2607 },
2608 "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.
2609 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive.
2610 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2611 "selfLink": "A String", # A link back to this file.
2612 "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.
2613}
2614
2615 newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If not set or true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).
2616 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
2617 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
2618 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
2619 pinned: boolean, Whether to pin the new revision.
Craig Citro065b5302014-08-14 00:47:23 -07002620 addParents: string, Comma-separated list of parent IDs to add.
2621 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04002622 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
2623 timedTextTrackName: string, The timed text track name.
2624 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
2625 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
2626 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
2627 timedTextLanguage: string, The language of the timed text.
2628
2629Returns:
2630 An object of the form:
2631
2632 { # The metadata for a file.
2633 "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.
2634 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002635 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
2636 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04002637 "thumbnailLink": "A String", # A link to the file's thumbnail.
2638 "labels": { # A group of labels for the file.
2639 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2640 "hidden": True or False, # Deprecated.
2641 "viewed": True or False, # Whether this file has been viewed by this user.
2642 "starred": True or False, # Whether this file is starred by the user.
2643 "trashed": True or False, # Whether this file has been trashed.
2644 },
2645 "indexableText": { # Indexable text attributes for the file (can only be written)
2646 "text": "A String", # The text to be indexed for this file.
2647 },
2648 "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.
2649 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2650 "writersCanShare": True or False, # Whether writers can share the document with other users.
2651 "owners": [ # The owner(s) of this file.
2652 { # The JSON template for a user.
2653 "picture": { # The user's profile picture.
2654 "url": "A String", # A URL that points to a profile picture of this user.
2655 },
2656 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002657 "displayName": "A String", # A plain text displayable name for this user.
2658 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002659 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2660 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002661 },
2662 ],
2663 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002664 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2665 "picture": { # The user's profile picture.
2666 "url": "A String", # A URL that points to a profile picture of this user.
2667 },
2668 "kind": "drive#user", # This is always drive#user.
2669 "displayName": "A String", # A plain text displayable name for this user.
2670 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2671 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2672 "emailAddress": "A String", # The email address of the user.
2673 },
John Asmuth614db982014-04-24 15:46:26 -04002674 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2675 "picture": { # The user's profile picture.
2676 "url": "A String", # A URL that points to a profile picture of this user.
2677 },
2678 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002679 "displayName": "A String", # A plain text displayable name for this user.
2680 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002681 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2682 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002683 },
2684 "copyable": True or False, # Whether the file can be copied by the current user.
2685 "ownerNames": [ # Name(s) of the owner(s) of this file.
2686 "A String",
2687 ],
2688 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2689 "webViewLink": "A String", # A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
2690 "etag": "A String", # ETag of the file.
2691 "parents": [ # Collection of parent folders which contain this file.
2692 # 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.
2693 { # A reference to a file's parent.
2694 "selfLink": "A String", # A link back to this reference.
2695 "kind": "drive#parentReference", # This is always drive#parentReference.
2696 "id": "A String", # The ID of the parent.
2697 "isRoot": True or False, # Whether or not the parent is the root folder.
2698 "parentLink": "A String", # A link to the parent.
2699 },
2700 ],
2701 "exportLinks": { # Links for exporting Google Docs to specific formats.
2702 "a_key": "A String", # A mapping from export format to URL
2703 },
2704 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002705 "permissions": [ # The list of permissions for users with access to this file.
2706 { # A permission for a file.
2707 "withLink": True or False, # Whether the link is required for this permission.
2708 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
2709 "name": "A String", # The name for this permission.
2710 "kind": "drive#permission", # This is always drive#permission.
2711 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2712 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2713 "authKey": "A String", # The authkey parameter required for this permission.
2714 "etag": "A String", # The ETag of the permission.
2715 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
2716 "photoLink": "A String", # A link to the profile photo, if available.
2717 "role": "A String", # The primary role for this user. Allowed values are:
2718 # - owner
2719 # - reader
2720 # - writer
2721 "type": "A String", # The account type. Allowed values are:
2722 # - user
2723 # - group
2724 # - domain
2725 # - anyone
2726 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2727 "A String",
2728 ],
2729 "selfLink": "A String", # A link back to this permission.
2730 },
2731 ],
John Asmuth614db982014-04-24 15:46:26 -04002732 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2733 "mimeType": "A String", # The MIME type of the thumbnail.
2734 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2735 },
2736 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
2737 "a_key": "A String",
2738 },
2739 "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.
2740 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2741 "exposureTime": 3.14, # The length of the exposure, in seconds.
2742 "cameraMake": "A String", # The make of the camera used to create the photo.
2743 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2744 "isoSpeed": 42, # The ISO speed used to create the photo.
2745 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2746 "exposureMode": "A String", # The exposure mode used to create the photo.
2747 "colorSpace": "A String", # The color space of the photo.
2748 "location": { # Geographic location information stored in the image.
2749 "latitude": 3.14, # The latitude stored in the image.
2750 "altitude": 3.14, # The altitude stored in the image.
2751 "longitude": 3.14, # The longitude stored in the image.
2752 },
2753 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2754 "height": 42, # The height of the image in pixels.
2755 "lens": "A String", # The lens used to create the photo.
2756 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2757 "width": 42, # The width of the image in pixels.
2758 "meteringMode": "A String", # The metering mode used to create the photo.
2759 "flashUsed": True or False, # Whether a flash was used to create the photo.
2760 "aperture": 3.14, # The aperture used to create the photo (f-number).
2761 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2762 "sensor": "A String", # The type of sensor used to create the photo.
2763 "whiteBalance": "A String", # The white balance mode used to create the photo.
2764 "cameraModel": "A String", # The model of the camera used to create the photo.
2765 },
2766 "description": "A String", # A short description of the file.
2767 "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.
2768 "editable": True or False, # Whether the file can be edited by the current user.
2769 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002770 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002771 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2772 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
2773 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
2774 "properties": [ # The list of properties.
2775 { # A key-value pair that is either public or private to an application.
2776 "kind": "drive#property", # This is always drive#property.
2777 "value": "A String", # The value of this property.
2778 "etag": "A String", # ETag of the property.
2779 "visibility": "A String", # The visibility of this property.
2780 "key": "A String", # The key of this property.
2781 "selfLink": "A String", # The link back to this property.
2782 },
2783 ],
2784 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2785 "iconLink": "A String", # A link to the file's icon.
2786 "defaultOpenWithLink": "A String", # A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
2787 "embedLink": "A String", # A link for embedding the file.
2788 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
2789 "title": "A String", # The title of this file.
2790 "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.
2791 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2792 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2793 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002794 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04002795 "name": "A String", # The name for this permission.
2796 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002797 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2798 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04002799 "authKey": "A String", # The authkey parameter required for this permission.
2800 "etag": "A String", # The ETag of the permission.
Craig Citro065b5302014-08-14 00:47:23 -07002801 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user and the given user's Google+ profile privacy settings allow exposing their email address.
John Asmuth614db982014-04-24 15:46:26 -04002802 "photoLink": "A String", # A link to the profile photo, if available.
2803 "role": "A String", # The primary role for this user. Allowed values are:
2804 # - owner
2805 # - reader
2806 # - writer
2807 "type": "A String", # The account type. Allowed values are:
2808 # - user
2809 # - group
2810 # - domain
2811 # - anyone
2812 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2813 "A String",
2814 ],
2815 "selfLink": "A String", # A link back to this permission.
2816 },
2817 "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.
2818 "fileExtension": "A String", # The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive.
2819 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2820 "selfLink": "A String", # A link back to this file.
2821 "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.
2822 }</pre>
2823</div>
2824
2825<div class="method">
2826 <code class="details" id="watch">watch(fileId, body, projection=None, updateViewedDate=None)</code>
2827 <pre>Subscribe to changes on a file
2828
2829Args:
2830 fileId: string, The ID for the file in question. (required)
2831 body: object, The request body. (required)
2832 The object takes the form of:
2833
2834{ # An notification channel used to watch for resource changes.
2835 "resourceUri": "A String", # A version-specific identifier for the watched resource.
2836 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
2837 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
2838 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
2839 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
2840 "params": { # Additional parameters controlling delivery channel behavior. Optional.
2841 "a_key": "A String", # Declares a new parameter by name.
2842 },
2843 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
2844 "address": "A String", # The address where notifications are delivered for this channel.
2845 "type": "A String", # The type of delivery mechanism used for this channel.
2846 "id": "A String", # A UUID or similar unique string that identifies this channel.
2847 }
2848
2849 projection: string, This parameter is deprecated and has no function.
2850 Allowed values
2851 BASIC - Deprecated
2852 FULL - Deprecated
2853 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
2854
2855Returns:
2856 An object of the form:
2857
2858 { # An notification channel used to watch for resource changes.
2859 "resourceUri": "A String", # A version-specific identifier for the watched resource.
2860 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
2861 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
2862 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
2863 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
2864 "params": { # Additional parameters controlling delivery channel behavior. Optional.
2865 "a_key": "A String", # Declares a new parameter by name.
2866 },
2867 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
2868 "address": "A String", # The address where notifications are delivered for this channel.
2869 "type": "A String", # The type of delivery mechanism used for this channel.
2870 "id": "A String", # A UUID or similar unique string that identifies this channel.
2871 }</pre>
2872</div>
2873
2874</body></html>