blob: 84af4ee4ca2027ed096e0e399e37caa83f12ce00 [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">
Craig Citroe633be12015-03-02 13:40:36 -080087 <code><a href="#get">get(fileId, projection=None, acknowledgeAbuse=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="#get_media">get_media(fileId, projection=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040091<p class="firstline">Gets a file's metadata by ID.</p>
92<p class="toc_element">
93 <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>
94<p class="firstline">Insert a new file.</p>
95<p class="toc_element">
Craig Citro065b5302014-08-14 00:47:23 -070096 <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 -040097<p class="firstline">Lists the user's files.</p>
98<p class="toc_element">
99 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
100<p class="firstline">Retrieves the next page of results.</p>
101<p class="toc_element">
Craig Citro065b5302014-08-14 00:47:23 -0700102 <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 -0400103<p class="firstline">Updates file metadata and/or content. This method supports patch semantics.</p>
104<p class="toc_element">
105 <code><a href="#touch">touch(fileId)</a></code></p>
106<p class="firstline">Set the file's updated time to the current server time.</p>
107<p class="toc_element">
108 <code><a href="#trash">trash(fileId)</a></code></p>
109<p class="firstline">Moves a file to the trash.</p>
110<p class="toc_element">
111 <code><a href="#untrash">untrash(fileId)</a></code></p>
112<p class="firstline">Restores a file from the trash.</p>
113<p class="toc_element">
Craig Citro065b5302014-08-14 00:47:23 -0700114 <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 -0400115<p class="firstline">Updates file metadata and/or content.</p>
116<p class="toc_element">
Craig Citroe633be12015-03-02 13:40:36 -0800117 <code><a href="#watch">watch(fileId, body, projection=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
118<p class="firstline">Subscribe to changes on a file</p>
119<p class="toc_element">
120 <code><a href="#watch_media">watch_media(fileId, body, projection=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400121<p class="firstline">Subscribe to changes on a file</p>
122<h3>Method Details</h3>
123<div class="method">
124 <code class="details" id="copy">copy(fileId, body, pinned=None, convert=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None)</code>
125 <pre>Creates a copy of the specified file.
126
127Args:
128 fileId: string, The ID of the file to copy. (required)
129 body: object, The request body. (required)
130 The object takes the form of:
131
132{ # The metadata for a file.
133 "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.
134 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700135 "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.
136 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400137 "thumbnailLink": "A String", # A link to the file's thumbnail.
138 "labels": { # A group of labels for the file.
139 "restricted": True or False, # Whether viewers are prevented from downloading this file.
140 "hidden": True or False, # Deprecated.
141 "viewed": True or False, # Whether this file has been viewed by this user.
142 "starred": True or False, # Whether this file is starred by the user.
143 "trashed": True or False, # Whether this file has been trashed.
144 },
145 "indexableText": { # Indexable text attributes for the file (can only be written)
146 "text": "A String", # The text to be indexed for this file.
147 },
148 "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.
149 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
150 "writersCanShare": True or False, # Whether writers can share the document with other users.
151 "owners": [ # The owner(s) of this file.
152 { # The JSON template for a user.
153 "picture": { # The user's profile picture.
154 "url": "A String", # A URL that points to a profile picture of this user.
155 },
156 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400157 "displayName": "A String", # A plain text displayable name for this user.
158 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700159 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
160 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400161 },
162 ],
163 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700164 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
165 "picture": { # The user's profile picture.
166 "url": "A String", # A URL that points to a profile picture of this user.
167 },
168 "kind": "drive#user", # This is always drive#user.
169 "displayName": "A String", # A plain text displayable name for this user.
170 "permissionId": "A String", # The user's ID as visible in the permissions collection.
171 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
172 "emailAddress": "A String", # The email address of the user.
173 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700174 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
175 "width": 42, # The width of the video in pixels.
176 "durationMillis": "A String", # The duration of the video in milliseconds.
177 "height": 42, # The height of the video in pixels.
178 },
John Asmuth614db982014-04-24 15:46:26 -0400179 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
180 "picture": { # The user's profile picture.
181 "url": "A String", # A URL that points to a profile picture of this user.
182 },
183 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400184 "displayName": "A String", # A plain text displayable name for this user.
185 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700186 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
187 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400188 },
189 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800190 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
John Asmuth614db982014-04-24 15:46:26 -0400191 "ownerNames": [ # Name(s) of the owner(s) of this file.
192 "A String",
193 ],
194 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
195 "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.
196 "etag": "A String", # ETag of the file.
197 "parents": [ # Collection of parent folders which contain this file.
198 # 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.
199 { # A reference to a file's parent.
200 "selfLink": "A String", # A link back to this reference.
201 "kind": "drive#parentReference", # This is always drive#parentReference.
202 "id": "A String", # The ID of the parent.
203 "isRoot": True or False, # Whether or not the parent is the root folder.
204 "parentLink": "A String", # A link to the parent.
205 },
206 ],
207 "exportLinks": { # Links for exporting Google Docs to specific formats.
208 "a_key": "A String", # A mapping from export format to URL
209 },
210 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700211 "permissions": [ # The list of permissions for users with access to this file.
212 { # A permission for a file.
213 "withLink": True or False, # Whether the link is required for this permission.
214 "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.
215 "name": "A String", # The name for this permission.
216 "kind": "drive#permission", # This is always drive#permission.
217 "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.
218 "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.
219 "authKey": "A String", # The authkey parameter required for this permission.
220 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800221 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -0700222 "photoLink": "A String", # A link to the profile photo, if available.
223 "role": "A String", # The primary role for this user. Allowed values are:
224 # - owner
225 # - reader
226 # - writer
227 "type": "A String", # The account type. Allowed values are:
228 # - user
229 # - group
230 # - domain
231 # - anyone
232 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
233 "A String",
234 ],
235 "selfLink": "A String", # A link back to this permission.
236 },
237 ],
John Asmuth614db982014-04-24 15:46:26 -0400238 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
239 "mimeType": "A String", # The MIME type of the thumbnail.
240 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
241 },
242 "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.
243 "a_key": "A String",
244 },
245 "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.
246 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
247 "exposureTime": 3.14, # The length of the exposure, in seconds.
248 "cameraMake": "A String", # The make of the camera used to create the photo.
249 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
250 "isoSpeed": 42, # The ISO speed used to create the photo.
251 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
252 "exposureMode": "A String", # The exposure mode used to create the photo.
253 "colorSpace": "A String", # The color space of the photo.
254 "location": { # Geographic location information stored in the image.
255 "latitude": 3.14, # The latitude stored in the image.
256 "altitude": 3.14, # The altitude stored in the image.
257 "longitude": 3.14, # The longitude stored in the image.
258 },
259 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
260 "height": 42, # The height of the image in pixels.
261 "lens": "A String", # The lens used to create the photo.
262 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
263 "width": 42, # The width of the image in pixels.
264 "meteringMode": "A String", # The metering mode used to create the photo.
265 "flashUsed": True or False, # Whether a flash was used to create the photo.
266 "aperture": 3.14, # The aperture used to create the photo (f-number).
267 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
268 "sensor": "A String", # The type of sensor used to create the photo.
269 "whiteBalance": "A String", # The white balance mode used to create the photo.
270 "cameraModel": "A String", # The model of the camera used to create the photo.
271 },
272 "description": "A String", # A short description of the file.
273 "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.
274 "editable": True or False, # Whether the file can be edited by the current user.
275 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700276 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400277 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
278 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700279 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400280 "properties": [ # The list of properties.
281 { # A key-value pair that is either public or private to an application.
282 "kind": "drive#property", # This is always drive#property.
283 "value": "A String", # The value of this property.
284 "etag": "A String", # ETag of the property.
285 "visibility": "A String", # The visibility of this property.
286 "key": "A String", # The key of this property.
287 "selfLink": "A String", # The link back to this property.
288 },
289 ],
290 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
291 "iconLink": "A String", # A link to the file's icon.
292 "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.
293 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700294 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400295 "title": "A String", # The title of this file.
296 "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.
297 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
298 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
299 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700300 "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 -0400301 "name": "A String", # The name for this permission.
302 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700303 "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.
304 "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 -0400305 "authKey": "A String", # The authkey parameter required for this permission.
306 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800307 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -0400308 "photoLink": "A String", # A link to the profile photo, if available.
309 "role": "A String", # The primary role for this user. Allowed values are:
310 # - owner
311 # - reader
312 # - writer
313 "type": "A String", # The account type. Allowed values are:
314 # - user
315 # - group
316 # - domain
317 # - anyone
318 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
319 "A String",
320 ],
321 "selfLink": "A String", # A link back to this permission.
322 },
323 "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.
324 "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.
325 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
326 "selfLink": "A String", # A link back to this file.
327 "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.
328}
329
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700330 pinned: boolean, Whether to pin the head revision of the new copy. A file can have a maximum of 200 pinned revisions.
John Asmuth614db982014-04-24 15:46:26 -0400331 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
332 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.
333 Allowed values
334 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
335 PRIVATE - The new file will be visible to only the owner.
336 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
337 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
338 timedTextLanguage: string, The language of the timed text.
339 timedTextTrackName: string, The timed text track name.
340
341Returns:
342 An object of the form:
343
344 { # The metadata for a file.
345 "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.
346 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700347 "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.
348 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400349 "thumbnailLink": "A String", # A link to the file's thumbnail.
350 "labels": { # A group of labels for the file.
351 "restricted": True or False, # Whether viewers are prevented from downloading this file.
352 "hidden": True or False, # Deprecated.
353 "viewed": True or False, # Whether this file has been viewed by this user.
354 "starred": True or False, # Whether this file is starred by the user.
355 "trashed": True or False, # Whether this file has been trashed.
356 },
357 "indexableText": { # Indexable text attributes for the file (can only be written)
358 "text": "A String", # The text to be indexed for this file.
359 },
360 "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.
361 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
362 "writersCanShare": True or False, # Whether writers can share the document with other users.
363 "owners": [ # The owner(s) of this file.
364 { # The JSON template for a user.
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.
John Asmuth614db982014-04-24 15:46:26 -0400369 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700371 "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.
John Asmuth614db982014-04-24 15:46:26 -0400373 },
374 ],
375 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700376 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
377 "picture": { # The user's profile picture.
378 "url": "A String", # A URL that points to a profile picture of this user.
379 },
380 "kind": "drive#user", # This is always drive#user.
381 "displayName": "A String", # A plain text displayable name for this user.
382 "permissionId": "A String", # The user's ID as visible in the permissions collection.
383 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
384 "emailAddress": "A String", # The email address of the user.
385 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700386 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
387 "width": 42, # The width of the video in pixels.
388 "durationMillis": "A String", # The duration of the video in milliseconds.
389 "height": 42, # The height of the video in pixels.
390 },
John Asmuth614db982014-04-24 15:46:26 -0400391 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
392 "picture": { # The user's profile picture.
393 "url": "A String", # A URL that points to a profile picture of this user.
394 },
395 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400396 "displayName": "A String", # A plain text displayable name for this user.
397 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700398 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
399 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400400 },
401 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800402 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
John Asmuth614db982014-04-24 15:46:26 -0400403 "ownerNames": [ # Name(s) of the owner(s) of this file.
404 "A String",
405 ],
406 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
407 "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.
408 "etag": "A String", # ETag of the file.
409 "parents": [ # Collection of parent folders which contain this file.
410 # 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.
411 { # A reference to a file's parent.
412 "selfLink": "A String", # A link back to this reference.
413 "kind": "drive#parentReference", # This is always drive#parentReference.
414 "id": "A String", # The ID of the parent.
415 "isRoot": True or False, # Whether or not the parent is the root folder.
416 "parentLink": "A String", # A link to the parent.
417 },
418 ],
419 "exportLinks": { # Links for exporting Google Docs to specific formats.
420 "a_key": "A String", # A mapping from export format to URL
421 },
422 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700423 "permissions": [ # The list of permissions for users with access to this file.
424 { # A permission for a file.
425 "withLink": True or False, # Whether the link is required for this permission.
426 "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.
427 "name": "A String", # The name for this permission.
428 "kind": "drive#permission", # This is always drive#permission.
429 "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.
430 "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.
431 "authKey": "A String", # The authkey parameter required for this permission.
432 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800433 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -0700434 "photoLink": "A String", # A link to the profile photo, if available.
435 "role": "A String", # The primary role for this user. Allowed values are:
436 # - owner
437 # - reader
438 # - writer
439 "type": "A String", # The account type. Allowed values are:
440 # - user
441 # - group
442 # - domain
443 # - anyone
444 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
445 "A String",
446 ],
447 "selfLink": "A String", # A link back to this permission.
448 },
449 ],
John Asmuth614db982014-04-24 15:46:26 -0400450 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
451 "mimeType": "A String", # The MIME type of the thumbnail.
452 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
453 },
454 "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.
455 "a_key": "A String",
456 },
457 "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.
458 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
459 "exposureTime": 3.14, # The length of the exposure, in seconds.
460 "cameraMake": "A String", # The make of the camera used to create the photo.
461 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
462 "isoSpeed": 42, # The ISO speed used to create the photo.
463 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
464 "exposureMode": "A String", # The exposure mode used to create the photo.
465 "colorSpace": "A String", # The color space of the photo.
466 "location": { # Geographic location information stored in the image.
467 "latitude": 3.14, # The latitude stored in the image.
468 "altitude": 3.14, # The altitude stored in the image.
469 "longitude": 3.14, # The longitude stored in the image.
470 },
471 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
472 "height": 42, # The height of the image in pixels.
473 "lens": "A String", # The lens used to create the photo.
474 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
475 "width": 42, # The width of the image in pixels.
476 "meteringMode": "A String", # The metering mode used to create the photo.
477 "flashUsed": True or False, # Whether a flash was used to create the photo.
478 "aperture": 3.14, # The aperture used to create the photo (f-number).
479 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
480 "sensor": "A String", # The type of sensor used to create the photo.
481 "whiteBalance": "A String", # The white balance mode used to create the photo.
482 "cameraModel": "A String", # The model of the camera used to create the photo.
483 },
484 "description": "A String", # A short description of the file.
485 "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.
486 "editable": True or False, # Whether the file can be edited by the current user.
487 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700488 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400489 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
490 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700491 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400492 "properties": [ # The list of properties.
493 { # A key-value pair that is either public or private to an application.
494 "kind": "drive#property", # This is always drive#property.
495 "value": "A String", # The value of this property.
496 "etag": "A String", # ETag of the property.
497 "visibility": "A String", # The visibility of this property.
498 "key": "A String", # The key of this property.
499 "selfLink": "A String", # The link back to this property.
500 },
501 ],
502 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
503 "iconLink": "A String", # A link to the file's icon.
504 "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.
505 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700506 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400507 "title": "A String", # The title of this file.
508 "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.
509 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
510 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
511 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700512 "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 -0400513 "name": "A String", # The name for this permission.
514 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700515 "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.
516 "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 -0400517 "authKey": "A String", # The authkey parameter required for this permission.
518 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800519 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -0400520 "photoLink": "A String", # A link to the profile photo, if available.
521 "role": "A String", # The primary role for this user. Allowed values are:
522 # - owner
523 # - reader
524 # - writer
525 "type": "A String", # The account type. Allowed values are:
526 # - user
527 # - group
528 # - domain
529 # - anyone
530 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
531 "A String",
532 ],
533 "selfLink": "A String", # A link back to this permission.
534 },
535 "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.
536 "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.
537 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
538 "selfLink": "A String", # A link back to this file.
539 "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.
540 }</pre>
541</div>
542
543<div class="method">
544 <code class="details" id="delete">delete(fileId)</code>
545 <pre>Permanently deletes a file by ID. Skips the trash.
546
547Args:
548 fileId: string, The ID of the file to delete. (required)
549</pre>
550</div>
551
552<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -0700553 <code class="details" id="emptyTrash">emptyTrash()</code>
554 <pre>Permanently deletes all of the user's trashed files.
555
556Args:
557</pre>
558</div>
559
560<div class="method">
Craig Citroe633be12015-03-02 13:40:36 -0800561 <code class="details" id="get">get(fileId, projection=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400562 <pre>Gets a file's metadata by ID.
563
564Args:
565 fileId: string, The ID for the file in question. (required)
566 projection: string, This parameter is deprecated and has no function.
567 Allowed values
568 BASIC - Deprecated
569 FULL - Deprecated
Craig Citroe633be12015-03-02 13:40:36 -0800570 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
John Asmuth614db982014-04-24 15:46:26 -0400571 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
572
573Returns:
574 An object of the form:
575
576 { # The metadata for a file.
577 "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.
578 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700579 "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.
580 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400581 "thumbnailLink": "A String", # A link to the file's thumbnail.
582 "labels": { # A group of labels for the file.
583 "restricted": True or False, # Whether viewers are prevented from downloading this file.
584 "hidden": True or False, # Deprecated.
585 "viewed": True or False, # Whether this file has been viewed by this user.
586 "starred": True or False, # Whether this file is starred by the user.
587 "trashed": True or False, # Whether this file has been trashed.
588 },
589 "indexableText": { # Indexable text attributes for the file (can only be written)
590 "text": "A String", # The text to be indexed for this file.
591 },
592 "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.
593 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
594 "writersCanShare": True or False, # Whether writers can share the document with other users.
595 "owners": [ # The owner(s) of this file.
596 { # The JSON template for a user.
597 "picture": { # The user's profile picture.
598 "url": "A String", # A URL that points to a profile picture of this user.
599 },
600 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400601 "displayName": "A String", # A plain text displayable name for this user.
602 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700603 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
604 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400605 },
606 ],
607 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700608 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
609 "picture": { # The user's profile picture.
610 "url": "A String", # A URL that points to a profile picture of this user.
611 },
612 "kind": "drive#user", # This is always drive#user.
613 "displayName": "A String", # A plain text displayable name for this user.
614 "permissionId": "A String", # The user's ID as visible in the permissions collection.
615 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
616 "emailAddress": "A String", # The email address of the user.
617 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700618 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
619 "width": 42, # The width of the video in pixels.
620 "durationMillis": "A String", # The duration of the video in milliseconds.
621 "height": 42, # The height of the video in pixels.
622 },
John Asmuth614db982014-04-24 15:46:26 -0400623 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
624 "picture": { # The user's profile picture.
625 "url": "A String", # A URL that points to a profile picture of this user.
626 },
627 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400628 "displayName": "A String", # A plain text displayable name for this user.
629 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700630 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
631 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400632 },
633 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800634 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
John Asmuth614db982014-04-24 15:46:26 -0400635 "ownerNames": [ # Name(s) of the owner(s) of this file.
636 "A String",
637 ],
638 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
639 "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.
640 "etag": "A String", # ETag of the file.
641 "parents": [ # Collection of parent folders which contain this file.
642 # 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.
643 { # A reference to a file's parent.
644 "selfLink": "A String", # A link back to this reference.
645 "kind": "drive#parentReference", # This is always drive#parentReference.
646 "id": "A String", # The ID of the parent.
647 "isRoot": True or False, # Whether or not the parent is the root folder.
648 "parentLink": "A String", # A link to the parent.
649 },
650 ],
651 "exportLinks": { # Links for exporting Google Docs to specific formats.
652 "a_key": "A String", # A mapping from export format to URL
653 },
654 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700655 "permissions": [ # The list of permissions for users with access to this file.
656 { # A permission for a file.
657 "withLink": True or False, # Whether the link is required for this permission.
658 "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.
659 "name": "A String", # The name for this permission.
660 "kind": "drive#permission", # This is always drive#permission.
661 "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.
662 "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.
663 "authKey": "A String", # The authkey parameter required for this permission.
664 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800665 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -0700666 "photoLink": "A String", # A link to the profile photo, if available.
667 "role": "A String", # The primary role for this user. Allowed values are:
668 # - owner
669 # - reader
670 # - writer
671 "type": "A String", # The account type. Allowed values are:
672 # - user
673 # - group
674 # - domain
675 # - anyone
676 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
677 "A String",
678 ],
679 "selfLink": "A String", # A link back to this permission.
680 },
681 ],
John Asmuth614db982014-04-24 15:46:26 -0400682 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
683 "mimeType": "A String", # The MIME type of the thumbnail.
684 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
685 },
686 "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.
687 "a_key": "A String",
688 },
689 "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.
690 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
691 "exposureTime": 3.14, # The length of the exposure, in seconds.
692 "cameraMake": "A String", # The make of the camera used to create the photo.
693 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
694 "isoSpeed": 42, # The ISO speed used to create the photo.
695 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
696 "exposureMode": "A String", # The exposure mode used to create the photo.
697 "colorSpace": "A String", # The color space of the photo.
698 "location": { # Geographic location information stored in the image.
699 "latitude": 3.14, # The latitude stored in the image.
700 "altitude": 3.14, # The altitude stored in the image.
701 "longitude": 3.14, # The longitude stored in the image.
702 },
703 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
704 "height": 42, # The height of the image in pixels.
705 "lens": "A String", # The lens used to create the photo.
706 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
707 "width": 42, # The width of the image in pixels.
708 "meteringMode": "A String", # The metering mode used to create the photo.
709 "flashUsed": True or False, # Whether a flash was used to create the photo.
710 "aperture": 3.14, # The aperture used to create the photo (f-number).
711 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
712 "sensor": "A String", # The type of sensor used to create the photo.
713 "whiteBalance": "A String", # The white balance mode used to create the photo.
714 "cameraModel": "A String", # The model of the camera used to create the photo.
715 },
716 "description": "A String", # A short description of the file.
717 "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.
718 "editable": True or False, # Whether the file can be edited by the current user.
719 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700720 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400721 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
722 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700723 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400724 "properties": [ # The list of properties.
725 { # A key-value pair that is either public or private to an application.
726 "kind": "drive#property", # This is always drive#property.
727 "value": "A String", # The value of this property.
728 "etag": "A String", # ETag of the property.
729 "visibility": "A String", # The visibility of this property.
730 "key": "A String", # The key of this property.
731 "selfLink": "A String", # The link back to this property.
732 },
733 ],
734 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
735 "iconLink": "A String", # A link to the file's icon.
736 "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.
737 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700738 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400739 "title": "A String", # The title of this file.
740 "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.
741 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
742 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
743 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700744 "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 -0400745 "name": "A String", # The name for this permission.
746 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700747 "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.
748 "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 -0400749 "authKey": "A String", # The authkey parameter required for this permission.
750 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800751 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -0400752 "photoLink": "A String", # A link to the profile photo, if available.
753 "role": "A String", # The primary role for this user. Allowed values are:
754 # - owner
755 # - reader
756 # - writer
757 "type": "A String", # The account type. Allowed values are:
758 # - user
759 # - group
760 # - domain
761 # - anyone
762 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
763 "A String",
764 ],
765 "selfLink": "A String", # A link back to this permission.
766 },
767 "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.
768 "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.
769 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
770 "selfLink": "A String", # A link back to this file.
771 "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.
772 }</pre>
773</div>
774
775<div class="method">
Craig Citroe633be12015-03-02 13:40:36 -0800776 <code class="details" id="get_media">get_media(fileId, projection=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
777 <pre>Gets a file's metadata by ID.
778
779Args:
780 fileId: string, The ID for the file in question. (required)
781 projection: string, This parameter is deprecated and has no function.
782 Allowed values
783 BASIC - Deprecated
784 FULL - Deprecated
785 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
786 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
787
788Returns:
789 The media object as a string.
790
791 </pre>
792</div>
793
794<div class="method">
John Asmuth614db982014-04-24 15:46:26 -0400795 <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>
796 <pre>Insert a new file.
797
798Args:
799 body: object, The request body.
800 The object takes the form of:
801
802{ # The metadata for a file.
803 "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.
804 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700805 "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.
806 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400807 "thumbnailLink": "A String", # A link to the file's thumbnail.
808 "labels": { # A group of labels for the file.
809 "restricted": True or False, # Whether viewers are prevented from downloading this file.
810 "hidden": True or False, # Deprecated.
811 "viewed": True or False, # Whether this file has been viewed by this user.
812 "starred": True or False, # Whether this file is starred by the user.
813 "trashed": True or False, # Whether this file has been trashed.
814 },
815 "indexableText": { # Indexable text attributes for the file (can only be written)
816 "text": "A String", # The text to be indexed for this file.
817 },
818 "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.
819 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
820 "writersCanShare": True or False, # Whether writers can share the document with other users.
821 "owners": [ # The owner(s) of this file.
822 { # The JSON template for a user.
823 "picture": { # The user's profile picture.
824 "url": "A String", # A URL that points to a profile picture of this user.
825 },
826 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400827 "displayName": "A String", # A plain text displayable name for this user.
828 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700829 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
830 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400831 },
832 ],
833 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700834 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
835 "picture": { # The user's profile picture.
836 "url": "A String", # A URL that points to a profile picture of this user.
837 },
838 "kind": "drive#user", # This is always drive#user.
839 "displayName": "A String", # A plain text displayable name for this user.
840 "permissionId": "A String", # The user's ID as visible in the permissions collection.
841 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
842 "emailAddress": "A String", # The email address of the user.
843 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700844 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
845 "width": 42, # The width of the video in pixels.
846 "durationMillis": "A String", # The duration of the video in milliseconds.
847 "height": 42, # The height of the video in pixels.
848 },
John Asmuth614db982014-04-24 15:46:26 -0400849 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
850 "picture": { # The user's profile picture.
851 "url": "A String", # A URL that points to a profile picture of this user.
852 },
853 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400854 "displayName": "A String", # A plain text displayable name for this user.
855 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700856 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
857 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400858 },
859 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800860 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
John Asmuth614db982014-04-24 15:46:26 -0400861 "ownerNames": [ # Name(s) of the owner(s) of this file.
862 "A String",
863 ],
864 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
865 "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.
866 "etag": "A String", # ETag of the file.
867 "parents": [ # Collection of parent folders which contain this file.
868 # 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.
869 { # A reference to a file's parent.
870 "selfLink": "A String", # A link back to this reference.
871 "kind": "drive#parentReference", # This is always drive#parentReference.
872 "id": "A String", # The ID of the parent.
873 "isRoot": True or False, # Whether or not the parent is the root folder.
874 "parentLink": "A String", # A link to the parent.
875 },
876 ],
877 "exportLinks": { # Links for exporting Google Docs to specific formats.
878 "a_key": "A String", # A mapping from export format to URL
879 },
880 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700881 "permissions": [ # The list of permissions for users with access to this file.
882 { # A permission for a file.
883 "withLink": True or False, # Whether the link is required for this permission.
884 "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.
885 "name": "A String", # The name for this permission.
886 "kind": "drive#permission", # This is always drive#permission.
887 "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.
888 "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.
889 "authKey": "A String", # The authkey parameter required for this permission.
890 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800891 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -0700892 "photoLink": "A String", # A link to the profile photo, if available.
893 "role": "A String", # The primary role for this user. Allowed values are:
894 # - owner
895 # - reader
896 # - writer
897 "type": "A String", # The account type. Allowed values are:
898 # - user
899 # - group
900 # - domain
901 # - anyone
902 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
903 "A String",
904 ],
905 "selfLink": "A String", # A link back to this permission.
906 },
907 ],
John Asmuth614db982014-04-24 15:46:26 -0400908 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
909 "mimeType": "A String", # The MIME type of the thumbnail.
910 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
911 },
912 "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.
913 "a_key": "A String",
914 },
915 "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.
916 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
917 "exposureTime": 3.14, # The length of the exposure, in seconds.
918 "cameraMake": "A String", # The make of the camera used to create the photo.
919 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
920 "isoSpeed": 42, # The ISO speed used to create the photo.
921 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
922 "exposureMode": "A String", # The exposure mode used to create the photo.
923 "colorSpace": "A String", # The color space of the photo.
924 "location": { # Geographic location information stored in the image.
925 "latitude": 3.14, # The latitude stored in the image.
926 "altitude": 3.14, # The altitude stored in the image.
927 "longitude": 3.14, # The longitude stored in the image.
928 },
929 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
930 "height": 42, # The height of the image in pixels.
931 "lens": "A String", # The lens used to create the photo.
932 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
933 "width": 42, # The width of the image in pixels.
934 "meteringMode": "A String", # The metering mode used to create the photo.
935 "flashUsed": True or False, # Whether a flash was used to create the photo.
936 "aperture": 3.14, # The aperture used to create the photo (f-number).
937 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
938 "sensor": "A String", # The type of sensor used to create the photo.
939 "whiteBalance": "A String", # The white balance mode used to create the photo.
940 "cameraModel": "A String", # The model of the camera used to create the photo.
941 },
942 "description": "A String", # A short description of the file.
943 "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.
944 "editable": True or False, # Whether the file can be edited by the current user.
945 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700946 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400947 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
948 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700949 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400950 "properties": [ # The list of properties.
951 { # A key-value pair that is either public or private to an application.
952 "kind": "drive#property", # This is always drive#property.
953 "value": "A String", # The value of this property.
954 "etag": "A String", # ETag of the property.
955 "visibility": "A String", # The visibility of this property.
956 "key": "A String", # The key of this property.
957 "selfLink": "A String", # The link back to this property.
958 },
959 ],
960 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
961 "iconLink": "A String", # A link to the file's icon.
962 "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.
963 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700964 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400965 "title": "A String", # The title of this file.
966 "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.
967 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
968 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
969 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700970 "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 -0400971 "name": "A String", # The name for this permission.
972 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700973 "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.
974 "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 -0400975 "authKey": "A String", # The authkey parameter required for this permission.
976 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800977 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -0400978 "photoLink": "A String", # A link to the profile photo, if available.
979 "role": "A String", # The primary role for this user. Allowed values are:
980 # - owner
981 # - reader
982 # - writer
983 "type": "A String", # The account type. Allowed values are:
984 # - user
985 # - group
986 # - domain
987 # - anyone
988 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
989 "A String",
990 ],
991 "selfLink": "A String", # A link back to this permission.
992 },
993 "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.
994 "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.
995 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
996 "selfLink": "A String", # A link back to this file.
997 "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.
998}
999
1000 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
1001 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
1002 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
1003 visibility: string, The visibility of the new file. This parameter is only relevant when convert=false.
1004 Allowed values
1005 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
1006 PRIVATE - The new file will be visible to only the owner.
1007 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
1008 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
1009 timedTextLanguage: string, The language of the timed text.
1010 timedTextTrackName: string, The timed text track name.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001011 pinned: boolean, Whether to pin the head revision of the uploaded file. A file can have a maximum of 200 pinned revisions.
John Asmuth614db982014-04-24 15:46:26 -04001012
1013Returns:
1014 An object of the form:
1015
1016 { # The metadata for a file.
1017 "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.
1018 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001019 "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.
1020 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04001021 "thumbnailLink": "A String", # A link to the file's thumbnail.
1022 "labels": { # A group of labels for the file.
1023 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1024 "hidden": True or False, # Deprecated.
1025 "viewed": True or False, # Whether this file has been viewed by this user.
1026 "starred": True or False, # Whether this file is starred by the user.
1027 "trashed": True or False, # Whether this file has been trashed.
1028 },
1029 "indexableText": { # Indexable text attributes for the file (can only be written)
1030 "text": "A String", # The text to be indexed for this file.
1031 },
1032 "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.
1033 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1034 "writersCanShare": True or False, # Whether writers can share the document with other users.
1035 "owners": [ # The owner(s) of this file.
1036 { # The JSON template for a user.
1037 "picture": { # The user's profile picture.
1038 "url": "A String", # A URL that points to a profile picture of this user.
1039 },
1040 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001041 "displayName": "A String", # A plain text displayable name for this user.
1042 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001043 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1044 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001045 },
1046 ],
1047 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001048 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1049 "picture": { # The user's profile picture.
1050 "url": "A String", # A URL that points to a profile picture of this user.
1051 },
1052 "kind": "drive#user", # This is always drive#user.
1053 "displayName": "A String", # A plain text displayable name for this user.
1054 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1055 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1056 "emailAddress": "A String", # The email address of the user.
1057 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001058 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1059 "width": 42, # The width of the video in pixels.
1060 "durationMillis": "A String", # The duration of the video in milliseconds.
1061 "height": 42, # The height of the video in pixels.
1062 },
John Asmuth614db982014-04-24 15:46:26 -04001063 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1064 "picture": { # The user's profile picture.
1065 "url": "A String", # A URL that points to a profile picture of this user.
1066 },
1067 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001068 "displayName": "A String", # A plain text displayable name for this user.
1069 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001070 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1071 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001072 },
1073 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001074 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
John Asmuth614db982014-04-24 15:46:26 -04001075 "ownerNames": [ # Name(s) of the owner(s) of this file.
1076 "A String",
1077 ],
1078 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1079 "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.
1080 "etag": "A String", # ETag of the file.
1081 "parents": [ # Collection of parent folders which contain this file.
1082 # 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.
1083 { # A reference to a file's parent.
1084 "selfLink": "A String", # A link back to this reference.
1085 "kind": "drive#parentReference", # This is always drive#parentReference.
1086 "id": "A String", # The ID of the parent.
1087 "isRoot": True or False, # Whether or not the parent is the root folder.
1088 "parentLink": "A String", # A link to the parent.
1089 },
1090 ],
1091 "exportLinks": { # Links for exporting Google Docs to specific formats.
1092 "a_key": "A String", # A mapping from export format to URL
1093 },
1094 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001095 "permissions": [ # The list of permissions for users with access to this file.
1096 { # A permission for a file.
1097 "withLink": True or False, # Whether the link is required for this permission.
1098 "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.
1099 "name": "A String", # The name for this permission.
1100 "kind": "drive#permission", # This is always drive#permission.
1101 "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.
1102 "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.
1103 "authKey": "A String", # The authkey parameter required for this permission.
1104 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001105 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07001106 "photoLink": "A String", # A link to the profile photo, if available.
1107 "role": "A String", # The primary role for this user. Allowed values are:
1108 # - owner
1109 # - reader
1110 # - writer
1111 "type": "A String", # The account type. Allowed values are:
1112 # - user
1113 # - group
1114 # - domain
1115 # - anyone
1116 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1117 "A String",
1118 ],
1119 "selfLink": "A String", # A link back to this permission.
1120 },
1121 ],
John Asmuth614db982014-04-24 15:46:26 -04001122 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1123 "mimeType": "A String", # The MIME type of the thumbnail.
1124 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1125 },
1126 "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.
1127 "a_key": "A String",
1128 },
1129 "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.
1130 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1131 "exposureTime": 3.14, # The length of the exposure, in seconds.
1132 "cameraMake": "A String", # The make of the camera used to create the photo.
1133 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1134 "isoSpeed": 42, # The ISO speed used to create the photo.
1135 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1136 "exposureMode": "A String", # The exposure mode used to create the photo.
1137 "colorSpace": "A String", # The color space of the photo.
1138 "location": { # Geographic location information stored in the image.
1139 "latitude": 3.14, # The latitude stored in the image.
1140 "altitude": 3.14, # The altitude stored in the image.
1141 "longitude": 3.14, # The longitude stored in the image.
1142 },
1143 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1144 "height": 42, # The height of the image in pixels.
1145 "lens": "A String", # The lens used to create the photo.
1146 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1147 "width": 42, # The width of the image in pixels.
1148 "meteringMode": "A String", # The metering mode used to create the photo.
1149 "flashUsed": True or False, # Whether a flash was used to create the photo.
1150 "aperture": 3.14, # The aperture used to create the photo (f-number).
1151 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1152 "sensor": "A String", # The type of sensor used to create the photo.
1153 "whiteBalance": "A String", # The white balance mode used to create the photo.
1154 "cameraModel": "A String", # The model of the camera used to create the photo.
1155 },
1156 "description": "A String", # A short description of the file.
1157 "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.
1158 "editable": True or False, # Whether the file can be edited by the current user.
1159 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001160 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001161 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1162 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001163 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001164 "properties": [ # The list of properties.
1165 { # A key-value pair that is either public or private to an application.
1166 "kind": "drive#property", # This is always drive#property.
1167 "value": "A String", # The value of this property.
1168 "etag": "A String", # ETag of the property.
1169 "visibility": "A String", # The visibility of this property.
1170 "key": "A String", # The key of this property.
1171 "selfLink": "A String", # The link back to this property.
1172 },
1173 ],
1174 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1175 "iconLink": "A String", # A link to the file's icon.
1176 "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.
1177 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001178 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001179 "title": "A String", # The title of this file.
1180 "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.
1181 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1182 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1183 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001184 "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 -04001185 "name": "A String", # The name for this permission.
1186 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001187 "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.
1188 "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 -04001189 "authKey": "A String", # The authkey parameter required for this permission.
1190 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001191 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04001192 "photoLink": "A String", # A link to the profile photo, if available.
1193 "role": "A String", # The primary role for this user. Allowed values are:
1194 # - owner
1195 # - reader
1196 # - writer
1197 "type": "A String", # The account type. Allowed values are:
1198 # - user
1199 # - group
1200 # - domain
1201 # - anyone
1202 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1203 "A String",
1204 ],
1205 "selfLink": "A String", # A link back to this permission.
1206 },
1207 "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.
1208 "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.
1209 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1210 "selfLink": "A String", # A link back to this file.
1211 "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.
1212 }</pre>
1213</div>
1214
1215<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -07001216 <code class="details" id="list">list(q=None, projection=None, pageToken=None, maxResults=None, corpus=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04001217 <pre>Lists the user's files.
1218
1219Args:
1220 q: string, Query string for searching files.
1221 projection: string, This parameter is deprecated and has no function.
1222 Allowed values
1223 BASIC - Deprecated
1224 FULL - Deprecated
1225 pageToken: string, Page token for files.
1226 maxResults: integer, Maximum number of files to return.
Craig Citro065b5302014-08-14 00:47:23 -07001227 corpus: string, The body of items (files/documents) to which the query applies.
1228 Allowed values
1229 DEFAULT - The items that the user has accessed.
1230 DOMAIN - Items shared to the user's domain.
John Asmuth614db982014-04-24 15:46:26 -04001231
1232Returns:
1233 An object of the form:
1234
1235 { # A list of files.
1236 "nextPageToken": "A String", # The page token for the next page of files.
1237 "kind": "drive#fileList", # This is always drive#fileList.
1238 "items": [ # The actual list of files.
1239 { # The metadata for a file.
1240 "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.
1241 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001242 "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.
1243 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04001244 "thumbnailLink": "A String", # A link to the file's thumbnail.
1245 "labels": { # A group of labels for the file.
1246 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1247 "hidden": True or False, # Deprecated.
1248 "viewed": True or False, # Whether this file has been viewed by this user.
1249 "starred": True or False, # Whether this file is starred by the user.
1250 "trashed": True or False, # Whether this file has been trashed.
1251 },
1252 "indexableText": { # Indexable text attributes for the file (can only be written)
1253 "text": "A String", # The text to be indexed for this file.
1254 },
1255 "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.
1256 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1257 "writersCanShare": True or False, # Whether writers can share the document with other users.
1258 "owners": [ # The owner(s) of this file.
1259 { # The JSON template for a user.
1260 "picture": { # The user's profile picture.
1261 "url": "A String", # A URL that points to a profile picture of this user.
1262 },
1263 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001264 "displayName": "A String", # A plain text displayable name for this user.
1265 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001266 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1267 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001268 },
1269 ],
1270 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001271 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1272 "picture": { # The user's profile picture.
1273 "url": "A String", # A URL that points to a profile picture of this user.
1274 },
1275 "kind": "drive#user", # This is always drive#user.
1276 "displayName": "A String", # A plain text displayable name for this user.
1277 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1278 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1279 "emailAddress": "A String", # The email address of the user.
1280 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001281 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1282 "width": 42, # The width of the video in pixels.
1283 "durationMillis": "A String", # The duration of the video in milliseconds.
1284 "height": 42, # The height of the video in pixels.
1285 },
John Asmuth614db982014-04-24 15:46:26 -04001286 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1287 "picture": { # The user's profile picture.
1288 "url": "A String", # A URL that points to a profile picture of this user.
1289 },
1290 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001291 "displayName": "A String", # A plain text displayable name for this user.
1292 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001293 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1294 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001295 },
1296 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001297 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
John Asmuth614db982014-04-24 15:46:26 -04001298 "ownerNames": [ # Name(s) of the owner(s) of this file.
1299 "A String",
1300 ],
1301 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1302 "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.
1303 "etag": "A String", # ETag of the file.
1304 "parents": [ # Collection of parent folders which contain this file.
1305 # 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.
1306 { # A reference to a file's parent.
1307 "selfLink": "A String", # A link back to this reference.
1308 "kind": "drive#parentReference", # This is always drive#parentReference.
1309 "id": "A String", # The ID of the parent.
1310 "isRoot": True or False, # Whether or not the parent is the root folder.
1311 "parentLink": "A String", # A link to the parent.
1312 },
1313 ],
1314 "exportLinks": { # Links for exporting Google Docs to specific formats.
1315 "a_key": "A String", # A mapping from export format to URL
1316 },
1317 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001318 "permissions": [ # The list of permissions for users with access to this file.
1319 { # A permission for a file.
1320 "withLink": True or False, # Whether the link is required for this permission.
1321 "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.
1322 "name": "A String", # The name for this permission.
1323 "kind": "drive#permission", # This is always drive#permission.
1324 "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.
1325 "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.
1326 "authKey": "A String", # The authkey parameter required for this permission.
1327 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001328 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07001329 "photoLink": "A String", # A link to the profile photo, if available.
1330 "role": "A String", # The primary role for this user. Allowed values are:
1331 # - owner
1332 # - reader
1333 # - writer
1334 "type": "A String", # The account type. Allowed values are:
1335 # - user
1336 # - group
1337 # - domain
1338 # - anyone
1339 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1340 "A String",
1341 ],
1342 "selfLink": "A String", # A link back to this permission.
1343 },
1344 ],
John Asmuth614db982014-04-24 15:46:26 -04001345 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1346 "mimeType": "A String", # The MIME type of the thumbnail.
1347 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1348 },
1349 "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.
1350 "a_key": "A String",
1351 },
1352 "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.
1353 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1354 "exposureTime": 3.14, # The length of the exposure, in seconds.
1355 "cameraMake": "A String", # The make of the camera used to create the photo.
1356 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1357 "isoSpeed": 42, # The ISO speed used to create the photo.
1358 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1359 "exposureMode": "A String", # The exposure mode used to create the photo.
1360 "colorSpace": "A String", # The color space of the photo.
1361 "location": { # Geographic location information stored in the image.
1362 "latitude": 3.14, # The latitude stored in the image.
1363 "altitude": 3.14, # The altitude stored in the image.
1364 "longitude": 3.14, # The longitude stored in the image.
1365 },
1366 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1367 "height": 42, # The height of the image in pixels.
1368 "lens": "A String", # The lens used to create the photo.
1369 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1370 "width": 42, # The width of the image in pixels.
1371 "meteringMode": "A String", # The metering mode used to create the photo.
1372 "flashUsed": True or False, # Whether a flash was used to create the photo.
1373 "aperture": 3.14, # The aperture used to create the photo (f-number).
1374 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1375 "sensor": "A String", # The type of sensor used to create the photo.
1376 "whiteBalance": "A String", # The white balance mode used to create the photo.
1377 "cameraModel": "A String", # The model of the camera used to create the photo.
1378 },
1379 "description": "A String", # A short description of the file.
1380 "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.
1381 "editable": True or False, # Whether the file can be edited by the current user.
1382 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001383 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001384 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1385 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001386 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001387 "properties": [ # The list of properties.
1388 { # A key-value pair that is either public or private to an application.
1389 "kind": "drive#property", # This is always drive#property.
1390 "value": "A String", # The value of this property.
1391 "etag": "A String", # ETag of the property.
1392 "visibility": "A String", # The visibility of this property.
1393 "key": "A String", # The key of this property.
1394 "selfLink": "A String", # The link back to this property.
1395 },
1396 ],
1397 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1398 "iconLink": "A String", # A link to the file's icon.
1399 "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.
1400 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001401 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001402 "title": "A String", # The title of this file.
1403 "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.
1404 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1405 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1406 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001407 "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 -04001408 "name": "A String", # The name for this permission.
1409 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001410 "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.
1411 "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 -04001412 "authKey": "A String", # The authkey parameter required for this permission.
1413 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001414 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04001415 "photoLink": "A String", # A link to the profile photo, if available.
1416 "role": "A String", # The primary role for this user. Allowed values are:
1417 # - owner
1418 # - reader
1419 # - writer
1420 "type": "A String", # The account type. Allowed values are:
1421 # - user
1422 # - group
1423 # - domain
1424 # - anyone
1425 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1426 "A String",
1427 ],
1428 "selfLink": "A String", # A link back to this permission.
1429 },
1430 "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.
1431 "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.
1432 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1433 "selfLink": "A String", # A link back to this file.
1434 "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.
1435 },
1436 ],
1437 "nextLink": "A String", # A link to the next page of files.
1438 "etag": "A String", # The ETag of the list.
1439 "selfLink": "A String", # A link back to this list.
1440 }</pre>
1441</div>
1442
1443<div class="method">
1444 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1445 <pre>Retrieves the next page of results.
1446
1447Args:
1448 previous_request: The request for the previous page. (required)
1449 previous_response: The response from the request for the previous page. (required)
1450
1451Returns:
1452 A request object that you can call 'execute()' on to request the next
1453 page. Returns None if there are no more items in the collection.
1454 </pre>
1455</div>
1456
1457<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -07001458 <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 -04001459 <pre>Updates file metadata and/or content. This method supports patch semantics.
1460
1461Args:
1462 fileId: string, The ID of the file to update. (required)
1463 body: object, The request body. (required)
1464 The object takes the form of:
1465
1466{ # The metadata for a file.
1467 "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.
1468 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001469 "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.
1470 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04001471 "thumbnailLink": "A String", # A link to the file's thumbnail.
1472 "labels": { # A group of labels for the file.
1473 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1474 "hidden": True or False, # Deprecated.
1475 "viewed": True or False, # Whether this file has been viewed by this user.
1476 "starred": True or False, # Whether this file is starred by the user.
1477 "trashed": True or False, # Whether this file has been trashed.
1478 },
1479 "indexableText": { # Indexable text attributes for the file (can only be written)
1480 "text": "A String", # The text to be indexed for this file.
1481 },
1482 "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.
1483 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1484 "writersCanShare": True or False, # Whether writers can share the document with other users.
1485 "owners": [ # The owner(s) of this file.
1486 { # The JSON template for a user.
1487 "picture": { # The user's profile picture.
1488 "url": "A String", # A URL that points to a profile picture of this user.
1489 },
1490 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001491 "displayName": "A String", # A plain text displayable name for this user.
1492 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001493 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1494 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001495 },
1496 ],
1497 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001498 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1499 "picture": { # The user's profile picture.
1500 "url": "A String", # A URL that points to a profile picture of this user.
1501 },
1502 "kind": "drive#user", # This is always drive#user.
1503 "displayName": "A String", # A plain text displayable name for this user.
1504 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1505 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1506 "emailAddress": "A String", # The email address of the user.
1507 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001508 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1509 "width": 42, # The width of the video in pixels.
1510 "durationMillis": "A String", # The duration of the video in milliseconds.
1511 "height": 42, # The height of the video in pixels.
1512 },
John Asmuth614db982014-04-24 15:46:26 -04001513 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1514 "picture": { # The user's profile picture.
1515 "url": "A String", # A URL that points to a profile picture of this user.
1516 },
1517 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001518 "displayName": "A String", # A plain text displayable name for this user.
1519 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001520 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1521 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001522 },
1523 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001524 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
John Asmuth614db982014-04-24 15:46:26 -04001525 "ownerNames": [ # Name(s) of the owner(s) of this file.
1526 "A String",
1527 ],
1528 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1529 "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.
1530 "etag": "A String", # ETag of the file.
1531 "parents": [ # Collection of parent folders which contain this file.
1532 # 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.
1533 { # A reference to a file's parent.
1534 "selfLink": "A String", # A link back to this reference.
1535 "kind": "drive#parentReference", # This is always drive#parentReference.
1536 "id": "A String", # The ID of the parent.
1537 "isRoot": True or False, # Whether or not the parent is the root folder.
1538 "parentLink": "A String", # A link to the parent.
1539 },
1540 ],
1541 "exportLinks": { # Links for exporting Google Docs to specific formats.
1542 "a_key": "A String", # A mapping from export format to URL
1543 },
1544 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001545 "permissions": [ # The list of permissions for users with access to this file.
1546 { # A permission for a file.
1547 "withLink": True or False, # Whether the link is required for this permission.
1548 "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.
1549 "name": "A String", # The name for this permission.
1550 "kind": "drive#permission", # This is always drive#permission.
1551 "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.
1552 "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.
1553 "authKey": "A String", # The authkey parameter required for this permission.
1554 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001555 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07001556 "photoLink": "A String", # A link to the profile photo, if available.
1557 "role": "A String", # The primary role for this user. Allowed values are:
1558 # - owner
1559 # - reader
1560 # - writer
1561 "type": "A String", # The account type. Allowed values are:
1562 # - user
1563 # - group
1564 # - domain
1565 # - anyone
1566 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1567 "A String",
1568 ],
1569 "selfLink": "A String", # A link back to this permission.
1570 },
1571 ],
John Asmuth614db982014-04-24 15:46:26 -04001572 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1573 "mimeType": "A String", # The MIME type of the thumbnail.
1574 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1575 },
1576 "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.
1577 "a_key": "A String",
1578 },
1579 "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.
1580 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1581 "exposureTime": 3.14, # The length of the exposure, in seconds.
1582 "cameraMake": "A String", # The make of the camera used to create the photo.
1583 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1584 "isoSpeed": 42, # The ISO speed used to create the photo.
1585 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1586 "exposureMode": "A String", # The exposure mode used to create the photo.
1587 "colorSpace": "A String", # The color space of the photo.
1588 "location": { # Geographic location information stored in the image.
1589 "latitude": 3.14, # The latitude stored in the image.
1590 "altitude": 3.14, # The altitude stored in the image.
1591 "longitude": 3.14, # The longitude stored in the image.
1592 },
1593 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1594 "height": 42, # The height of the image in pixels.
1595 "lens": "A String", # The lens used to create the photo.
1596 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1597 "width": 42, # The width of the image in pixels.
1598 "meteringMode": "A String", # The metering mode used to create the photo.
1599 "flashUsed": True or False, # Whether a flash was used to create the photo.
1600 "aperture": 3.14, # The aperture used to create the photo (f-number).
1601 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1602 "sensor": "A String", # The type of sensor used to create the photo.
1603 "whiteBalance": "A String", # The white balance mode used to create the photo.
1604 "cameraModel": "A String", # The model of the camera used to create the photo.
1605 },
1606 "description": "A String", # A short description of the file.
1607 "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.
1608 "editable": True or False, # Whether the file can be edited by the current user.
1609 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001610 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001611 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1612 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001613 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001614 "properties": [ # The list of properties.
1615 { # A key-value pair that is either public or private to an application.
1616 "kind": "drive#property", # This is always drive#property.
1617 "value": "A String", # The value of this property.
1618 "etag": "A String", # ETag of the property.
1619 "visibility": "A String", # The visibility of this property.
1620 "key": "A String", # The key of this property.
1621 "selfLink": "A String", # The link back to this property.
1622 },
1623 ],
1624 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1625 "iconLink": "A String", # A link to the file's icon.
1626 "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.
1627 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001628 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001629 "title": "A String", # The title of this file.
1630 "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.
1631 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1632 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1633 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001634 "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 -04001635 "name": "A String", # The name for this permission.
1636 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001637 "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.
1638 "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 -04001639 "authKey": "A String", # The authkey parameter required for this permission.
1640 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001641 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04001642 "photoLink": "A String", # A link to the profile photo, if available.
1643 "role": "A String", # The primary role for this user. Allowed values are:
1644 # - owner
1645 # - reader
1646 # - writer
1647 "type": "A String", # The account type. Allowed values are:
1648 # - user
1649 # - group
1650 # - domain
1651 # - anyone
1652 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1653 "A String",
1654 ],
1655 "selfLink": "A String", # A link back to this permission.
1656 },
1657 "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.
1658 "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.
1659 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1660 "selfLink": "A String", # A link back to this file.
1661 "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.
1662}
1663
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001664 newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).
1665 pinned: boolean, Whether to pin the new revision. A file can have a maximum of 200 pinned revisions.
John Asmuth614db982014-04-24 15:46:26 -04001666 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
1667 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Craig Citro065b5302014-08-14 00:47:23 -07001668 addParents: string, Comma-separated list of parent IDs to add.
1669 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04001670 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
1671 timedTextTrackName: string, The timed text track name.
1672 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
1673 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
1674 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
1675 timedTextLanguage: string, The language of the timed text.
1676
1677Returns:
1678 An object of the form:
1679
1680 { # The metadata for a file.
1681 "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.
1682 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001683 "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.
1684 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04001685 "thumbnailLink": "A String", # A link to the file's thumbnail.
1686 "labels": { # A group of labels for the file.
1687 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1688 "hidden": True or False, # Deprecated.
1689 "viewed": True or False, # Whether this file has been viewed by this user.
1690 "starred": True or False, # Whether this file is starred by the user.
1691 "trashed": True or False, # Whether this file has been trashed.
1692 },
1693 "indexableText": { # Indexable text attributes for the file (can only be written)
1694 "text": "A String", # The text to be indexed for this file.
1695 },
1696 "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.
1697 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1698 "writersCanShare": True or False, # Whether writers can share the document with other users.
1699 "owners": [ # The owner(s) of this file.
1700 { # The JSON template for a user.
1701 "picture": { # The user's profile picture.
1702 "url": "A String", # A URL that points to a profile picture of this user.
1703 },
1704 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001705 "displayName": "A String", # A plain text displayable name for this user.
1706 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001707 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1708 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001709 },
1710 ],
1711 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001712 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1713 "picture": { # The user's profile picture.
1714 "url": "A String", # A URL that points to a profile picture of this user.
1715 },
1716 "kind": "drive#user", # This is always drive#user.
1717 "displayName": "A String", # A plain text displayable name for this user.
1718 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1719 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1720 "emailAddress": "A String", # The email address of the user.
1721 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001722 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1723 "width": 42, # The width of the video in pixels.
1724 "durationMillis": "A String", # The duration of the video in milliseconds.
1725 "height": 42, # The height of the video in pixels.
1726 },
John Asmuth614db982014-04-24 15:46:26 -04001727 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1728 "picture": { # The user's profile picture.
1729 "url": "A String", # A URL that points to a profile picture of this user.
1730 },
1731 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001732 "displayName": "A String", # A plain text displayable name for this user.
1733 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001734 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1735 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001736 },
1737 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001738 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
John Asmuth614db982014-04-24 15:46:26 -04001739 "ownerNames": [ # Name(s) of the owner(s) of this file.
1740 "A String",
1741 ],
1742 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1743 "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.
1744 "etag": "A String", # ETag of the file.
1745 "parents": [ # Collection of parent folders which contain this file.
1746 # 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.
1747 { # A reference to a file's parent.
1748 "selfLink": "A String", # A link back to this reference.
1749 "kind": "drive#parentReference", # This is always drive#parentReference.
1750 "id": "A String", # The ID of the parent.
1751 "isRoot": True or False, # Whether or not the parent is the root folder.
1752 "parentLink": "A String", # A link to the parent.
1753 },
1754 ],
1755 "exportLinks": { # Links for exporting Google Docs to specific formats.
1756 "a_key": "A String", # A mapping from export format to URL
1757 },
1758 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001759 "permissions": [ # The list of permissions for users with access to this file.
1760 { # A permission for a file.
1761 "withLink": True or False, # Whether the link is required for this permission.
1762 "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.
1763 "name": "A String", # The name for this permission.
1764 "kind": "drive#permission", # This is always drive#permission.
1765 "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.
1766 "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.
1767 "authKey": "A String", # The authkey parameter required for this permission.
1768 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001769 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07001770 "photoLink": "A String", # A link to the profile photo, if available.
1771 "role": "A String", # The primary role for this user. Allowed values are:
1772 # - owner
1773 # - reader
1774 # - writer
1775 "type": "A String", # The account type. Allowed values are:
1776 # - user
1777 # - group
1778 # - domain
1779 # - anyone
1780 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1781 "A String",
1782 ],
1783 "selfLink": "A String", # A link back to this permission.
1784 },
1785 ],
John Asmuth614db982014-04-24 15:46:26 -04001786 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1787 "mimeType": "A String", # The MIME type of the thumbnail.
1788 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1789 },
1790 "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.
1791 "a_key": "A String",
1792 },
1793 "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.
1794 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1795 "exposureTime": 3.14, # The length of the exposure, in seconds.
1796 "cameraMake": "A String", # The make of the camera used to create the photo.
1797 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1798 "isoSpeed": 42, # The ISO speed used to create the photo.
1799 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1800 "exposureMode": "A String", # The exposure mode used to create the photo.
1801 "colorSpace": "A String", # The color space of the photo.
1802 "location": { # Geographic location information stored in the image.
1803 "latitude": 3.14, # The latitude stored in the image.
1804 "altitude": 3.14, # The altitude stored in the image.
1805 "longitude": 3.14, # The longitude stored in the image.
1806 },
1807 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1808 "height": 42, # The height of the image in pixels.
1809 "lens": "A String", # The lens used to create the photo.
1810 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1811 "width": 42, # The width of the image in pixels.
1812 "meteringMode": "A String", # The metering mode used to create the photo.
1813 "flashUsed": True or False, # Whether a flash was used to create the photo.
1814 "aperture": 3.14, # The aperture used to create the photo (f-number).
1815 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1816 "sensor": "A String", # The type of sensor used to create the photo.
1817 "whiteBalance": "A String", # The white balance mode used to create the photo.
1818 "cameraModel": "A String", # The model of the camera used to create the photo.
1819 },
1820 "description": "A String", # A short description of the file.
1821 "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.
1822 "editable": True or False, # Whether the file can be edited by the current user.
1823 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001824 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001825 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1826 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001827 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001828 "properties": [ # The list of properties.
1829 { # A key-value pair that is either public or private to an application.
1830 "kind": "drive#property", # This is always drive#property.
1831 "value": "A String", # The value of this property.
1832 "etag": "A String", # ETag of the property.
1833 "visibility": "A String", # The visibility of this property.
1834 "key": "A String", # The key of this property.
1835 "selfLink": "A String", # The link back to this property.
1836 },
1837 ],
1838 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1839 "iconLink": "A String", # A link to the file's icon.
1840 "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.
1841 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001842 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001843 "title": "A String", # The title of this file.
1844 "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.
1845 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1846 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1847 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001848 "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 -04001849 "name": "A String", # The name for this permission.
1850 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001851 "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.
1852 "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 -04001853 "authKey": "A String", # The authkey parameter required for this permission.
1854 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001855 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04001856 "photoLink": "A String", # A link to the profile photo, if available.
1857 "role": "A String", # The primary role for this user. Allowed values are:
1858 # - owner
1859 # - reader
1860 # - writer
1861 "type": "A String", # The account type. Allowed values are:
1862 # - user
1863 # - group
1864 # - domain
1865 # - anyone
1866 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1867 "A String",
1868 ],
1869 "selfLink": "A String", # A link back to this permission.
1870 },
1871 "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.
1872 "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.
1873 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1874 "selfLink": "A String", # A link back to this file.
1875 "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.
1876 }</pre>
1877</div>
1878
1879<div class="method">
1880 <code class="details" id="touch">touch(fileId)</code>
1881 <pre>Set the file's updated time to the current server time.
1882
1883Args:
1884 fileId: string, The ID of the file to update. (required)
1885
1886Returns:
1887 An object of the form:
1888
1889 { # The metadata for a file.
1890 "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.
1891 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001892 "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.
1893 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04001894 "thumbnailLink": "A String", # A link to the file's thumbnail.
1895 "labels": { # A group of labels for the file.
1896 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1897 "hidden": True or False, # Deprecated.
1898 "viewed": True or False, # Whether this file has been viewed by this user.
1899 "starred": True or False, # Whether this file is starred by the user.
1900 "trashed": True or False, # Whether this file has been trashed.
1901 },
1902 "indexableText": { # Indexable text attributes for the file (can only be written)
1903 "text": "A String", # The text to be indexed for this file.
1904 },
1905 "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.
1906 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1907 "writersCanShare": True or False, # Whether writers can share the document with other users.
1908 "owners": [ # The owner(s) of this file.
1909 { # The JSON template for a user.
1910 "picture": { # The user's profile picture.
1911 "url": "A String", # A URL that points to a profile picture of this user.
1912 },
1913 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001914 "displayName": "A String", # A plain text displayable name for this user.
1915 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001916 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1917 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001918 },
1919 ],
1920 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001921 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1922 "picture": { # The user's profile picture.
1923 "url": "A String", # A URL that points to a profile picture of this user.
1924 },
1925 "kind": "drive#user", # This is always drive#user.
1926 "displayName": "A String", # A plain text displayable name for this user.
1927 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1928 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1929 "emailAddress": "A String", # The email address of the user.
1930 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001931 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1932 "width": 42, # The width of the video in pixels.
1933 "durationMillis": "A String", # The duration of the video in milliseconds.
1934 "height": 42, # The height of the video in pixels.
1935 },
John Asmuth614db982014-04-24 15:46:26 -04001936 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1937 "picture": { # The user's profile picture.
1938 "url": "A String", # A URL that points to a profile picture of this user.
1939 },
1940 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001941 "displayName": "A String", # A plain text displayable name for this user.
1942 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001943 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1944 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001945 },
1946 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001947 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
John Asmuth614db982014-04-24 15:46:26 -04001948 "ownerNames": [ # Name(s) of the owner(s) of this file.
1949 "A String",
1950 ],
1951 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1952 "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.
1953 "etag": "A String", # ETag of the file.
1954 "parents": [ # Collection of parent folders which contain this file.
1955 # 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.
1956 { # A reference to a file's parent.
1957 "selfLink": "A String", # A link back to this reference.
1958 "kind": "drive#parentReference", # This is always drive#parentReference.
1959 "id": "A String", # The ID of the parent.
1960 "isRoot": True or False, # Whether or not the parent is the root folder.
1961 "parentLink": "A String", # A link to the parent.
1962 },
1963 ],
1964 "exportLinks": { # Links for exporting Google Docs to specific formats.
1965 "a_key": "A String", # A mapping from export format to URL
1966 },
1967 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001968 "permissions": [ # The list of permissions for users with access to this file.
1969 { # A permission for a file.
1970 "withLink": True or False, # Whether the link is required for this permission.
1971 "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.
1972 "name": "A String", # The name for this permission.
1973 "kind": "drive#permission", # This is always drive#permission.
1974 "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.
1975 "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.
1976 "authKey": "A String", # The authkey parameter required for this permission.
1977 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001978 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07001979 "photoLink": "A String", # A link to the profile photo, if available.
1980 "role": "A String", # The primary role for this user. Allowed values are:
1981 # - owner
1982 # - reader
1983 # - writer
1984 "type": "A String", # The account type. Allowed values are:
1985 # - user
1986 # - group
1987 # - domain
1988 # - anyone
1989 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1990 "A String",
1991 ],
1992 "selfLink": "A String", # A link back to this permission.
1993 },
1994 ],
John Asmuth614db982014-04-24 15:46:26 -04001995 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1996 "mimeType": "A String", # The MIME type of the thumbnail.
1997 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1998 },
1999 "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.
2000 "a_key": "A String",
2001 },
2002 "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.
2003 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2004 "exposureTime": 3.14, # The length of the exposure, in seconds.
2005 "cameraMake": "A String", # The make of the camera used to create the photo.
2006 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2007 "isoSpeed": 42, # The ISO speed used to create the photo.
2008 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2009 "exposureMode": "A String", # The exposure mode used to create the photo.
2010 "colorSpace": "A String", # The color space of the photo.
2011 "location": { # Geographic location information stored in the image.
2012 "latitude": 3.14, # The latitude stored in the image.
2013 "altitude": 3.14, # The altitude stored in the image.
2014 "longitude": 3.14, # The longitude stored in the image.
2015 },
2016 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2017 "height": 42, # The height of the image in pixels.
2018 "lens": "A String", # The lens used to create the photo.
2019 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2020 "width": 42, # The width of the image in pixels.
2021 "meteringMode": "A String", # The metering mode used to create the photo.
2022 "flashUsed": True or False, # Whether a flash was used to create the photo.
2023 "aperture": 3.14, # The aperture used to create the photo (f-number).
2024 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2025 "sensor": "A String", # The type of sensor used to create the photo.
2026 "whiteBalance": "A String", # The white balance mode used to create the photo.
2027 "cameraModel": "A String", # The model of the camera used to create the photo.
2028 },
2029 "description": "A String", # A short description of the file.
2030 "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.
2031 "editable": True or False, # Whether the file can be edited by the current user.
2032 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002033 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002034 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2035 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002036 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002037 "properties": [ # The list of properties.
2038 { # A key-value pair that is either public or private to an application.
2039 "kind": "drive#property", # This is always drive#property.
2040 "value": "A String", # The value of this property.
2041 "etag": "A String", # ETag of the property.
2042 "visibility": "A String", # The visibility of this property.
2043 "key": "A String", # The key of this property.
2044 "selfLink": "A String", # The link back to this property.
2045 },
2046 ],
2047 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2048 "iconLink": "A String", # A link to the file's icon.
2049 "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.
2050 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002051 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002052 "title": "A String", # The title of this file.
2053 "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.
2054 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2055 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2056 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002057 "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 -04002058 "name": "A String", # The name for this permission.
2059 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002060 "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.
2061 "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 -04002062 "authKey": "A String", # The authkey parameter required for this permission.
2063 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002064 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04002065 "photoLink": "A String", # A link to the profile photo, if available.
2066 "role": "A String", # The primary role for this user. Allowed values are:
2067 # - owner
2068 # - reader
2069 # - writer
2070 "type": "A String", # The account type. Allowed values are:
2071 # - user
2072 # - group
2073 # - domain
2074 # - anyone
2075 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2076 "A String",
2077 ],
2078 "selfLink": "A String", # A link back to this permission.
2079 },
2080 "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.
2081 "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.
2082 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2083 "selfLink": "A String", # A link back to this file.
2084 "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.
2085 }</pre>
2086</div>
2087
2088<div class="method">
2089 <code class="details" id="trash">trash(fileId)</code>
2090 <pre>Moves a file to the trash.
2091
2092Args:
2093 fileId: string, The ID of the file to trash. (required)
2094
2095Returns:
2096 An object of the form:
2097
2098 { # The metadata for a file.
2099 "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.
2100 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002101 "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.
2102 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04002103 "thumbnailLink": "A String", # A link to the file's thumbnail.
2104 "labels": { # A group of labels for the file.
2105 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2106 "hidden": True or False, # Deprecated.
2107 "viewed": True or False, # Whether this file has been viewed by this user.
2108 "starred": True or False, # Whether this file is starred by the user.
2109 "trashed": True or False, # Whether this file has been trashed.
2110 },
2111 "indexableText": { # Indexable text attributes for the file (can only be written)
2112 "text": "A String", # The text to be indexed for this file.
2113 },
2114 "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.
2115 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2116 "writersCanShare": True or False, # Whether writers can share the document with other users.
2117 "owners": [ # The owner(s) of this file.
2118 { # The JSON template for a user.
2119 "picture": { # The user's profile picture.
2120 "url": "A String", # A URL that points to a profile picture of this user.
2121 },
2122 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002123 "displayName": "A String", # A plain text displayable name for this user.
2124 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002125 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2126 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002127 },
2128 ],
2129 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002130 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2131 "picture": { # The user's profile picture.
2132 "url": "A String", # A URL that points to a profile picture of this user.
2133 },
2134 "kind": "drive#user", # This is always drive#user.
2135 "displayName": "A String", # A plain text displayable name for this user.
2136 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2137 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2138 "emailAddress": "A String", # The email address of the user.
2139 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002140 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2141 "width": 42, # The width of the video in pixels.
2142 "durationMillis": "A String", # The duration of the video in milliseconds.
2143 "height": 42, # The height of the video in pixels.
2144 },
John Asmuth614db982014-04-24 15:46:26 -04002145 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2146 "picture": { # The user's profile picture.
2147 "url": "A String", # A URL that points to a profile picture of this user.
2148 },
2149 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002150 "displayName": "A String", # A plain text displayable name for this user.
2151 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002152 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2153 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002154 },
2155 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002156 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
John Asmuth614db982014-04-24 15:46:26 -04002157 "ownerNames": [ # Name(s) of the owner(s) of this file.
2158 "A String",
2159 ],
2160 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2161 "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.
2162 "etag": "A String", # ETag of the file.
2163 "parents": [ # Collection of parent folders which contain this file.
2164 # 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.
2165 { # A reference to a file's parent.
2166 "selfLink": "A String", # A link back to this reference.
2167 "kind": "drive#parentReference", # This is always drive#parentReference.
2168 "id": "A String", # The ID of the parent.
2169 "isRoot": True or False, # Whether or not the parent is the root folder.
2170 "parentLink": "A String", # A link to the parent.
2171 },
2172 ],
2173 "exportLinks": { # Links for exporting Google Docs to specific formats.
2174 "a_key": "A String", # A mapping from export format to URL
2175 },
2176 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002177 "permissions": [ # The list of permissions for users with access to this file.
2178 { # A permission for a file.
2179 "withLink": True or False, # Whether the link is required for this permission.
2180 "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.
2181 "name": "A String", # The name for this permission.
2182 "kind": "drive#permission", # This is always drive#permission.
2183 "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.
2185 "authKey": "A String", # The authkey parameter required for this permission.
2186 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002187 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07002188 "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 ],
John Asmuth614db982014-04-24 15:46:26 -04002204 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2205 "mimeType": "A String", # The MIME type of the thumbnail.
2206 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2207 },
2208 "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.
2209 "a_key": "A String",
2210 },
2211 "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.
2212 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2213 "exposureTime": 3.14, # The length of the exposure, in seconds.
2214 "cameraMake": "A String", # The make of the camera used to create the photo.
2215 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2216 "isoSpeed": 42, # The ISO speed used to create the photo.
2217 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2218 "exposureMode": "A String", # The exposure mode used to create the photo.
2219 "colorSpace": "A String", # The color space of the photo.
2220 "location": { # Geographic location information stored in the image.
2221 "latitude": 3.14, # The latitude stored in the image.
2222 "altitude": 3.14, # The altitude stored in the image.
2223 "longitude": 3.14, # The longitude stored in the image.
2224 },
2225 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2226 "height": 42, # The height of the image in pixels.
2227 "lens": "A String", # The lens used to create the photo.
2228 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2229 "width": 42, # The width of the image in pixels.
2230 "meteringMode": "A String", # The metering mode used to create the photo.
2231 "flashUsed": True or False, # Whether a flash was used to create the photo.
2232 "aperture": 3.14, # The aperture used to create the photo (f-number).
2233 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2234 "sensor": "A String", # The type of sensor used to create the photo.
2235 "whiteBalance": "A String", # The white balance mode used to create the photo.
2236 "cameraModel": "A String", # The model of the camera used to create the photo.
2237 },
2238 "description": "A String", # A short description of the file.
2239 "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.
2240 "editable": True or False, # Whether the file can be edited by the current user.
2241 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002242 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002243 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2244 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002245 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002246 "properties": [ # The list of properties.
2247 { # A key-value pair that is either public or private to an application.
2248 "kind": "drive#property", # This is always drive#property.
2249 "value": "A String", # The value of this property.
2250 "etag": "A String", # ETag of the property.
2251 "visibility": "A String", # The visibility of this property.
2252 "key": "A String", # The key of this property.
2253 "selfLink": "A String", # The link back to this property.
2254 },
2255 ],
2256 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2257 "iconLink": "A String", # A link to the file's icon.
2258 "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.
2259 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002260 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002261 "title": "A String", # The title of this file.
2262 "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.
2263 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2264 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2265 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002266 "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 -04002267 "name": "A String", # The name for this permission.
2268 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002269 "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.
2270 "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 -04002271 "authKey": "A String", # The authkey parameter required for this permission.
2272 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002273 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04002274 "photoLink": "A String", # A link to the profile photo, if available.
2275 "role": "A String", # The primary role for this user. Allowed values are:
2276 # - owner
2277 # - reader
2278 # - writer
2279 "type": "A String", # The account type. Allowed values are:
2280 # - user
2281 # - group
2282 # - domain
2283 # - anyone
2284 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2285 "A String",
2286 ],
2287 "selfLink": "A String", # A link back to this permission.
2288 },
2289 "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.
2290 "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.
2291 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2292 "selfLink": "A String", # A link back to this file.
2293 "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.
2294 }</pre>
2295</div>
2296
2297<div class="method">
2298 <code class="details" id="untrash">untrash(fileId)</code>
2299 <pre>Restores a file from the trash.
2300
2301Args:
2302 fileId: string, The ID of the file to untrash. (required)
2303
2304Returns:
2305 An object of the form:
2306
2307 { # The metadata for a file.
2308 "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.
2309 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002310 "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.
2311 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04002312 "thumbnailLink": "A String", # A link to the file's thumbnail.
2313 "labels": { # A group of labels for the file.
2314 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2315 "hidden": True or False, # Deprecated.
2316 "viewed": True or False, # Whether this file has been viewed by this user.
2317 "starred": True or False, # Whether this file is starred by the user.
2318 "trashed": True or False, # Whether this file has been trashed.
2319 },
2320 "indexableText": { # Indexable text attributes for the file (can only be written)
2321 "text": "A String", # The text to be indexed for this file.
2322 },
2323 "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.
2324 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2325 "writersCanShare": True or False, # Whether writers can share the document with other users.
2326 "owners": [ # The owner(s) of this file.
2327 { # The JSON template for a user.
2328 "picture": { # The user's profile picture.
2329 "url": "A String", # A URL that points to a profile picture of this user.
2330 },
2331 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002332 "displayName": "A String", # A plain text displayable name for this user.
2333 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002334 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2335 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002336 },
2337 ],
2338 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002339 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2340 "picture": { # The user's profile picture.
2341 "url": "A String", # A URL that points to a profile picture of this user.
2342 },
2343 "kind": "drive#user", # This is always drive#user.
2344 "displayName": "A String", # A plain text displayable name for this user.
2345 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2346 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2347 "emailAddress": "A String", # The email address of the user.
2348 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002349 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2350 "width": 42, # The width of the video in pixels.
2351 "durationMillis": "A String", # The duration of the video in milliseconds.
2352 "height": 42, # The height of the video in pixels.
2353 },
John Asmuth614db982014-04-24 15:46:26 -04002354 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2355 "picture": { # The user's profile picture.
2356 "url": "A String", # A URL that points to a profile picture of this user.
2357 },
2358 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002359 "displayName": "A String", # A plain text displayable name for this user.
2360 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002361 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2362 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002363 },
2364 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002365 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
John Asmuth614db982014-04-24 15:46:26 -04002366 "ownerNames": [ # Name(s) of the owner(s) of this file.
2367 "A String",
2368 ],
2369 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2370 "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.
2371 "etag": "A String", # ETag of the file.
2372 "parents": [ # Collection of parent folders which contain this file.
2373 # 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.
2374 { # A reference to a file's parent.
2375 "selfLink": "A String", # A link back to this reference.
2376 "kind": "drive#parentReference", # This is always drive#parentReference.
2377 "id": "A String", # The ID of the parent.
2378 "isRoot": True or False, # Whether or not the parent is the root folder.
2379 "parentLink": "A String", # A link to the parent.
2380 },
2381 ],
2382 "exportLinks": { # Links for exporting Google Docs to specific formats.
2383 "a_key": "A String", # A mapping from export format to URL
2384 },
2385 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002386 "permissions": [ # The list of permissions for users with access to this file.
2387 { # A permission for a file.
2388 "withLink": True or False, # Whether the link is required for this permission.
2389 "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.
2390 "name": "A String", # The name for this permission.
2391 "kind": "drive#permission", # This is always drive#permission.
2392 "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.
2393 "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.
2394 "authKey": "A String", # The authkey parameter required for this permission.
2395 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002396 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07002397 "photoLink": "A String", # A link to the profile photo, if available.
2398 "role": "A String", # The primary role for this user. Allowed values are:
2399 # - owner
2400 # - reader
2401 # - writer
2402 "type": "A String", # The account type. Allowed values are:
2403 # - user
2404 # - group
2405 # - domain
2406 # - anyone
2407 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2408 "A String",
2409 ],
2410 "selfLink": "A String", # A link back to this permission.
2411 },
2412 ],
John Asmuth614db982014-04-24 15:46:26 -04002413 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2414 "mimeType": "A String", # The MIME type of the thumbnail.
2415 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2416 },
2417 "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.
2418 "a_key": "A String",
2419 },
2420 "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.
2421 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2422 "exposureTime": 3.14, # The length of the exposure, in seconds.
2423 "cameraMake": "A String", # The make of the camera used to create the photo.
2424 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2425 "isoSpeed": 42, # The ISO speed used to create the photo.
2426 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2427 "exposureMode": "A String", # The exposure mode used to create the photo.
2428 "colorSpace": "A String", # The color space of the photo.
2429 "location": { # Geographic location information stored in the image.
2430 "latitude": 3.14, # The latitude stored in the image.
2431 "altitude": 3.14, # The altitude stored in the image.
2432 "longitude": 3.14, # The longitude stored in the image.
2433 },
2434 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2435 "height": 42, # The height of the image in pixels.
2436 "lens": "A String", # The lens used to create the photo.
2437 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2438 "width": 42, # The width of the image in pixels.
2439 "meteringMode": "A String", # The metering mode used to create the photo.
2440 "flashUsed": True or False, # Whether a flash was used to create the photo.
2441 "aperture": 3.14, # The aperture used to create the photo (f-number).
2442 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2443 "sensor": "A String", # The type of sensor used to create the photo.
2444 "whiteBalance": "A String", # The white balance mode used to create the photo.
2445 "cameraModel": "A String", # The model of the camera used to create the photo.
2446 },
2447 "description": "A String", # A short description of the file.
2448 "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.
2449 "editable": True or False, # Whether the file can be edited by the current user.
2450 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002451 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002452 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2453 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002454 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002455 "properties": [ # The list of properties.
2456 { # A key-value pair that is either public or private to an application.
2457 "kind": "drive#property", # This is always drive#property.
2458 "value": "A String", # The value of this property.
2459 "etag": "A String", # ETag of the property.
2460 "visibility": "A String", # The visibility of this property.
2461 "key": "A String", # The key of this property.
2462 "selfLink": "A String", # The link back to this property.
2463 },
2464 ],
2465 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2466 "iconLink": "A String", # A link to the file's icon.
2467 "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.
2468 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002469 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002470 "title": "A String", # The title of this file.
2471 "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.
2472 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2473 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2474 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002475 "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 -04002476 "name": "A String", # The name for this permission.
2477 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002478 "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.
2479 "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 -04002480 "authKey": "A String", # The authkey parameter required for this permission.
2481 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002482 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04002483 "photoLink": "A String", # A link to the profile photo, if available.
2484 "role": "A String", # The primary role for this user. Allowed values are:
2485 # - owner
2486 # - reader
2487 # - writer
2488 "type": "A String", # The account type. Allowed values are:
2489 # - user
2490 # - group
2491 # - domain
2492 # - anyone
2493 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2494 "A String",
2495 ],
2496 "selfLink": "A String", # A link back to this permission.
2497 },
2498 "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.
2499 "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.
2500 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2501 "selfLink": "A String", # A link back to this file.
2502 "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.
2503 }</pre>
2504</div>
2505
2506<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -07002507 <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 -04002508 <pre>Updates file metadata and/or content.
2509
2510Args:
2511 fileId: string, The ID of the file to update. (required)
2512 body: object, The request body.
2513 The object takes the form of:
2514
2515{ # The metadata for a file.
2516 "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.
2517 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002518 "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.
2519 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04002520 "thumbnailLink": "A String", # A link to the file's thumbnail.
2521 "labels": { # A group of labels for the file.
2522 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2523 "hidden": True or False, # Deprecated.
2524 "viewed": True or False, # Whether this file has been viewed by this user.
2525 "starred": True or False, # Whether this file is starred by the user.
2526 "trashed": True or False, # Whether this file has been trashed.
2527 },
2528 "indexableText": { # Indexable text attributes for the file (can only be written)
2529 "text": "A String", # The text to be indexed for this file.
2530 },
2531 "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.
2532 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2533 "writersCanShare": True or False, # Whether writers can share the document with other users.
2534 "owners": [ # The owner(s) of this file.
2535 { # The JSON template for a user.
2536 "picture": { # The user's profile picture.
2537 "url": "A String", # A URL that points to a profile picture of this user.
2538 },
2539 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002540 "displayName": "A String", # A plain text displayable name for this user.
2541 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002542 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2543 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002544 },
2545 ],
2546 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002547 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2548 "picture": { # The user's profile picture.
2549 "url": "A String", # A URL that points to a profile picture of this user.
2550 },
2551 "kind": "drive#user", # This is always drive#user.
2552 "displayName": "A String", # A plain text displayable name for this user.
2553 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2554 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2555 "emailAddress": "A String", # The email address of the user.
2556 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002557 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2558 "width": 42, # The width of the video in pixels.
2559 "durationMillis": "A String", # The duration of the video in milliseconds.
2560 "height": 42, # The height of the video in pixels.
2561 },
John Asmuth614db982014-04-24 15:46:26 -04002562 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2563 "picture": { # The user's profile picture.
2564 "url": "A String", # A URL that points to a profile picture of this user.
2565 },
2566 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002567 "displayName": "A String", # A plain text displayable name for this user.
2568 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002569 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2570 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002571 },
2572 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002573 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
John Asmuth614db982014-04-24 15:46:26 -04002574 "ownerNames": [ # Name(s) of the owner(s) of this file.
2575 "A String",
2576 ],
2577 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2578 "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.
2579 "etag": "A String", # ETag of the file.
2580 "parents": [ # Collection of parent folders which contain this file.
2581 # 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.
2582 { # A reference to a file's parent.
2583 "selfLink": "A String", # A link back to this reference.
2584 "kind": "drive#parentReference", # This is always drive#parentReference.
2585 "id": "A String", # The ID of the parent.
2586 "isRoot": True or False, # Whether or not the parent is the root folder.
2587 "parentLink": "A String", # A link to the parent.
2588 },
2589 ],
2590 "exportLinks": { # Links for exporting Google Docs to specific formats.
2591 "a_key": "A String", # A mapping from export format to URL
2592 },
2593 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002594 "permissions": [ # The list of permissions for users with access to this file.
2595 { # A permission for a file.
2596 "withLink": True or False, # Whether the link is required for this permission.
2597 "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.
2598 "name": "A String", # The name for this permission.
2599 "kind": "drive#permission", # This is always drive#permission.
2600 "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.
2601 "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.
2602 "authKey": "A String", # The authkey parameter required for this permission.
2603 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002604 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07002605 "photoLink": "A String", # A link to the profile photo, if available.
2606 "role": "A String", # The primary role for this user. Allowed values are:
2607 # - owner
2608 # - reader
2609 # - writer
2610 "type": "A String", # The account type. Allowed values are:
2611 # - user
2612 # - group
2613 # - domain
2614 # - anyone
2615 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2616 "A String",
2617 ],
2618 "selfLink": "A String", # A link back to this permission.
2619 },
2620 ],
John Asmuth614db982014-04-24 15:46:26 -04002621 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2622 "mimeType": "A String", # The MIME type of the thumbnail.
2623 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2624 },
2625 "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.
2626 "a_key": "A String",
2627 },
2628 "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.
2629 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2630 "exposureTime": 3.14, # The length of the exposure, in seconds.
2631 "cameraMake": "A String", # The make of the camera used to create the photo.
2632 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2633 "isoSpeed": 42, # The ISO speed used to create the photo.
2634 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2635 "exposureMode": "A String", # The exposure mode used to create the photo.
2636 "colorSpace": "A String", # The color space of the photo.
2637 "location": { # Geographic location information stored in the image.
2638 "latitude": 3.14, # The latitude stored in the image.
2639 "altitude": 3.14, # The altitude stored in the image.
2640 "longitude": 3.14, # The longitude stored in the image.
2641 },
2642 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2643 "height": 42, # The height of the image in pixels.
2644 "lens": "A String", # The lens used to create the photo.
2645 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2646 "width": 42, # The width of the image in pixels.
2647 "meteringMode": "A String", # The metering mode used to create the photo.
2648 "flashUsed": True or False, # Whether a flash was used to create the photo.
2649 "aperture": 3.14, # The aperture used to create the photo (f-number).
2650 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2651 "sensor": "A String", # The type of sensor used to create the photo.
2652 "whiteBalance": "A String", # The white balance mode used to create the photo.
2653 "cameraModel": "A String", # The model of the camera used to create the photo.
2654 },
2655 "description": "A String", # A short description of the file.
2656 "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.
2657 "editable": True or False, # Whether the file can be edited by the current user.
2658 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002659 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002660 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2661 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002662 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002663 "properties": [ # The list of properties.
2664 { # A key-value pair that is either public or private to an application.
2665 "kind": "drive#property", # This is always drive#property.
2666 "value": "A String", # The value of this property.
2667 "etag": "A String", # ETag of the property.
2668 "visibility": "A String", # The visibility of this property.
2669 "key": "A String", # The key of this property.
2670 "selfLink": "A String", # The link back to this property.
2671 },
2672 ],
2673 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2674 "iconLink": "A String", # A link to the file's icon.
2675 "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.
2676 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002677 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002678 "title": "A String", # The title of this file.
2679 "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.
2680 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2681 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2682 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002683 "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 -04002684 "name": "A String", # The name for this permission.
2685 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002686 "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.
2687 "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 -04002688 "authKey": "A String", # The authkey parameter required for this permission.
2689 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002690 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04002691 "photoLink": "A String", # A link to the profile photo, if available.
2692 "role": "A String", # The primary role for this user. Allowed values are:
2693 # - owner
2694 # - reader
2695 # - writer
2696 "type": "A String", # The account type. Allowed values are:
2697 # - user
2698 # - group
2699 # - domain
2700 # - anyone
2701 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2702 "A String",
2703 ],
2704 "selfLink": "A String", # A link back to this permission.
2705 },
2706 "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.
2707 "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.
2708 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2709 "selfLink": "A String", # A link back to this file.
2710 "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.
2711}
2712
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002713 newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).
John Asmuth614db982014-04-24 15:46:26 -04002714 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
2715 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
2716 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002717 pinned: boolean, Whether to pin the new revision. A file can have a maximum of 200 pinned revisions.
Craig Citro065b5302014-08-14 00:47:23 -07002718 addParents: string, Comma-separated list of parent IDs to add.
2719 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04002720 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
2721 timedTextTrackName: string, The timed text track name.
2722 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
2723 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
2724 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
2725 timedTextLanguage: string, The language of the timed text.
2726
2727Returns:
2728 An object of the form:
2729
2730 { # The metadata for a file.
2731 "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.
2732 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002733 "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.
2734 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04002735 "thumbnailLink": "A String", # A link to the file's thumbnail.
2736 "labels": { # A group of labels for the file.
2737 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2738 "hidden": True or False, # Deprecated.
2739 "viewed": True or False, # Whether this file has been viewed by this user.
2740 "starred": True or False, # Whether this file is starred by the user.
2741 "trashed": True or False, # Whether this file has been trashed.
2742 },
2743 "indexableText": { # Indexable text attributes for the file (can only be written)
2744 "text": "A String", # The text to be indexed for this file.
2745 },
2746 "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.
2747 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2748 "writersCanShare": True or False, # Whether writers can share the document with other users.
2749 "owners": [ # The owner(s) of this file.
2750 { # The JSON template for a user.
2751 "picture": { # The user's profile picture.
2752 "url": "A String", # A URL that points to a profile picture of this user.
2753 },
2754 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002755 "displayName": "A String", # A plain text displayable name for this user.
2756 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002757 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2758 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002759 },
2760 ],
2761 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002762 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2763 "picture": { # The user's profile picture.
2764 "url": "A String", # A URL that points to a profile picture of this user.
2765 },
2766 "kind": "drive#user", # This is always drive#user.
2767 "displayName": "A String", # A plain text displayable name for this user.
2768 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2769 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2770 "emailAddress": "A String", # The email address of the user.
2771 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002772 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2773 "width": 42, # The width of the video in pixels.
2774 "durationMillis": "A String", # The duration of the video in milliseconds.
2775 "height": 42, # The height of the video in pixels.
2776 },
John Asmuth614db982014-04-24 15:46:26 -04002777 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2778 "picture": { # The user's profile picture.
2779 "url": "A String", # A URL that points to a profile picture of this user.
2780 },
2781 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002782 "displayName": "A String", # A plain text displayable name for this user.
2783 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002784 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2785 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002786 },
2787 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002788 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
John Asmuth614db982014-04-24 15:46:26 -04002789 "ownerNames": [ # Name(s) of the owner(s) of this file.
2790 "A String",
2791 ],
2792 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2793 "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.
2794 "etag": "A String", # ETag of the file.
2795 "parents": [ # Collection of parent folders which contain this file.
2796 # 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.
2797 { # A reference to a file's parent.
2798 "selfLink": "A String", # A link back to this reference.
2799 "kind": "drive#parentReference", # This is always drive#parentReference.
2800 "id": "A String", # The ID of the parent.
2801 "isRoot": True or False, # Whether or not the parent is the root folder.
2802 "parentLink": "A String", # A link to the parent.
2803 },
2804 ],
2805 "exportLinks": { # Links for exporting Google Docs to specific formats.
2806 "a_key": "A String", # A mapping from export format to URL
2807 },
2808 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002809 "permissions": [ # The list of permissions for users with access to this file.
2810 { # A permission for a file.
2811 "withLink": True or False, # Whether the link is required for this permission.
2812 "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.
2813 "name": "A String", # The name for this permission.
2814 "kind": "drive#permission", # This is always drive#permission.
2815 "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.
2816 "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.
2817 "authKey": "A String", # The authkey parameter required for this permission.
2818 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002819 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07002820 "photoLink": "A String", # A link to the profile photo, if available.
2821 "role": "A String", # The primary role for this user. Allowed values are:
2822 # - owner
2823 # - reader
2824 # - writer
2825 "type": "A String", # The account type. Allowed values are:
2826 # - user
2827 # - group
2828 # - domain
2829 # - anyone
2830 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2831 "A String",
2832 ],
2833 "selfLink": "A String", # A link back to this permission.
2834 },
2835 ],
John Asmuth614db982014-04-24 15:46:26 -04002836 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2837 "mimeType": "A String", # The MIME type of the thumbnail.
2838 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2839 },
2840 "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.
2841 "a_key": "A String",
2842 },
2843 "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.
2844 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2845 "exposureTime": 3.14, # The length of the exposure, in seconds.
2846 "cameraMake": "A String", # The make of the camera used to create the photo.
2847 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2848 "isoSpeed": 42, # The ISO speed used to create the photo.
2849 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2850 "exposureMode": "A String", # The exposure mode used to create the photo.
2851 "colorSpace": "A String", # The color space of the photo.
2852 "location": { # Geographic location information stored in the image.
2853 "latitude": 3.14, # The latitude stored in the image.
2854 "altitude": 3.14, # The altitude stored in the image.
2855 "longitude": 3.14, # The longitude stored in the image.
2856 },
2857 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2858 "height": 42, # The height of the image in pixels.
2859 "lens": "A String", # The lens used to create the photo.
2860 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2861 "width": 42, # The width of the image in pixels.
2862 "meteringMode": "A String", # The metering mode used to create the photo.
2863 "flashUsed": True or False, # Whether a flash was used to create the photo.
2864 "aperture": 3.14, # The aperture used to create the photo (f-number).
2865 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2866 "sensor": "A String", # The type of sensor used to create the photo.
2867 "whiteBalance": "A String", # The white balance mode used to create the photo.
2868 "cameraModel": "A String", # The model of the camera used to create the photo.
2869 },
2870 "description": "A String", # A short description of the file.
2871 "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.
2872 "editable": True or False, # Whether the file can be edited by the current user.
2873 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002874 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002875 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2876 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002877 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002878 "properties": [ # The list of properties.
2879 { # A key-value pair that is either public or private to an application.
2880 "kind": "drive#property", # This is always drive#property.
2881 "value": "A String", # The value of this property.
2882 "etag": "A String", # ETag of the property.
2883 "visibility": "A String", # The visibility of this property.
2884 "key": "A String", # The key of this property.
2885 "selfLink": "A String", # The link back to this property.
2886 },
2887 ],
2888 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2889 "iconLink": "A String", # A link to the file's icon.
2890 "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.
2891 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002892 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002893 "title": "A String", # The title of this file.
2894 "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.
2895 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2896 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2897 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002898 "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 -04002899 "name": "A String", # The name for this permission.
2900 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002901 "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.
2902 "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 -04002903 "authKey": "A String", # The authkey parameter required for this permission.
2904 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002905 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04002906 "photoLink": "A String", # A link to the profile photo, if available.
2907 "role": "A String", # The primary role for this user. Allowed values are:
2908 # - owner
2909 # - reader
2910 # - writer
2911 "type": "A String", # The account type. Allowed values are:
2912 # - user
2913 # - group
2914 # - domain
2915 # - anyone
2916 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2917 "A String",
2918 ],
2919 "selfLink": "A String", # A link back to this permission.
2920 },
2921 "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.
2922 "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.
2923 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2924 "selfLink": "A String", # A link back to this file.
2925 "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.
2926 }</pre>
2927</div>
2928
2929<div class="method">
Craig Citroe633be12015-03-02 13:40:36 -08002930 <code class="details" id="watch">watch(fileId, body, projection=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04002931 <pre>Subscribe to changes on a file
2932
2933Args:
2934 fileId: string, The ID for the file in question. (required)
2935 body: object, The request body. (required)
2936 The object takes the form of:
2937
2938{ # An notification channel used to watch for resource changes.
2939 "resourceUri": "A String", # A version-specific identifier for the watched resource.
2940 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
2941 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
2942 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
2943 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
2944 "params": { # Additional parameters controlling delivery channel behavior. Optional.
2945 "a_key": "A String", # Declares a new parameter by name.
2946 },
2947 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
2948 "address": "A String", # The address where notifications are delivered for this channel.
2949 "type": "A String", # The type of delivery mechanism used for this channel.
2950 "id": "A String", # A UUID or similar unique string that identifies this channel.
2951 }
2952
2953 projection: string, This parameter is deprecated and has no function.
2954 Allowed values
2955 BASIC - Deprecated
2956 FULL - Deprecated
Craig Citroe633be12015-03-02 13:40:36 -08002957 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
John Asmuth614db982014-04-24 15:46:26 -04002958 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
2959
2960Returns:
2961 An object of the form:
2962
2963 { # An notification channel used to watch for resource changes.
2964 "resourceUri": "A String", # A version-specific identifier for the watched resource.
2965 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
2966 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
2967 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
2968 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
2969 "params": { # Additional parameters controlling delivery channel behavior. Optional.
2970 "a_key": "A String", # Declares a new parameter by name.
2971 },
2972 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
2973 "address": "A String", # The address where notifications are delivered for this channel.
2974 "type": "A String", # The type of delivery mechanism used for this channel.
2975 "id": "A String", # A UUID or similar unique string that identifies this channel.
2976 }</pre>
2977</div>
2978
Craig Citroe633be12015-03-02 13:40:36 -08002979<div class="method">
2980 <code class="details" id="watch_media">watch_media(fileId, body, projection=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
2981 <pre>Subscribe to changes on a file
2982
2983Args:
2984 fileId: string, The ID for the file in question. (required)
2985 body: object, The request body. (required)
2986 The object takes the form of:
2987
2988{ # An notification channel used to watch for resource changes.
2989 "resourceUri": "A String", # A version-specific identifier for the watched resource.
2990 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
2991 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
2992 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
2993 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
2994 "params": { # Additional parameters controlling delivery channel behavior. Optional.
2995 "a_key": "A String", # Declares a new parameter by name.
2996 },
2997 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
2998 "address": "A String", # The address where notifications are delivered for this channel.
2999 "type": "A String", # The type of delivery mechanism used for this channel.
3000 "id": "A String", # A UUID or similar unique string that identifies this channel.
3001 }
3002
3003 projection: string, This parameter is deprecated and has no function.
3004 Allowed values
3005 BASIC - Deprecated
3006 FULL - Deprecated
3007 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
3008 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
3009
3010Returns:
3011 The media object as a string.
3012
3013 </pre>
3014</div>
3015
John Asmuth614db982014-04-24 15:46:26 -04003016</body></html>