blob: a931d376f2638653582a6311e5b94e3cce860805 [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>
Nathaniel Manista4f877e52015-06-15 16:44:50 +000082<p class="firstline">Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file.</p>
John Asmuth614db982014-04-24 15:46:26 -040083<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">
Nathaniel Manista4f877e52015-06-15 16:44:50 +000087 <code><a href="#get">get(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
Craig Citroe633be12015-03-02 13:40:36 -080088<p class="firstline">Gets a file's metadata by ID.</p>
89<p class="toc_element">
Nathaniel Manista4f877e52015-06-15 16:44:50 +000090 <code><a href="#get_media">get_media(fileId, projection=None, revisionId=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">
Nathaniel Manista4f877e52015-06-15 16:44:50 +000096 <code><a href="#list">list(q=None, projection=None, pageToken=None, maxResults=None, spaces=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">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000117 <code><a href="#watch">watch(fileId, body, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
Craig Citroe633be12015-03-02 13:40:36 -0800118<p class="firstline">Subscribe to changes on a file</p>
119<p class="toc_element">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000120 <code><a href="#watch_media">watch_media(fileId, body, projection=None, revisionId=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.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000137 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -0400138 "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.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000143 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -0400144 },
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.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000240 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
John Asmuth614db982014-04-24 15:46:26 -0400241 },
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.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000281 { # A key-value pair attached to a file that is either public or private to an application.
282 # The following limits apply to file properties:
283 # - Maximum of 100 properties total per file
284 # - Maximum of 30 private properties per app
285 # - Maximum of 30 public properties
286 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -0400287 "kind": "drive#property", # This is always drive#property.
288 "value": "A String", # The value of this property.
289 "etag": "A String", # ETag of the property.
290 "visibility": "A String", # The visibility of this property.
291 "key": "A String", # The key of this property.
292 "selfLink": "A String", # The link back to this property.
293 },
294 ],
295 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
296 "iconLink": "A String", # A link to the file's icon.
297 "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.
298 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700299 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400300 "title": "A String", # The title of this file.
301 "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.
302 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
303 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
304 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700305 "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 -0400306 "name": "A String", # The name for this permission.
307 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700308 "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.
309 "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 -0400310 "authKey": "A String", # The authkey parameter required for this permission.
311 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800312 "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 -0400313 "photoLink": "A String", # A link to the profile photo, if available.
314 "role": "A String", # The primary role for this user. Allowed values are:
315 # - owner
316 # - reader
317 # - writer
318 "type": "A String", # The account type. Allowed values are:
319 # - user
320 # - group
321 # - domain
322 # - anyone
323 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
324 "A String",
325 ],
326 "selfLink": "A String", # A link back to this permission.
327 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000328 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.
329 "A String",
330 ],
John Asmuth614db982014-04-24 15:46:26 -0400331 "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.
332 "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.
333 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
334 "selfLink": "A String", # A link back to this file.
335 "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.
336}
337
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700338 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 -0400339 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
340 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.
341 Allowed values
342 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
343 PRIVATE - The new file will be visible to only the owner.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000344 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
John Asmuth614db982014-04-24 15:46:26 -0400345 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
346 timedTextLanguage: string, The language of the timed text.
347 timedTextTrackName: string, The timed text track name.
348
349Returns:
350 An object of the form:
351
352 { # The metadata for a file.
353 "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.
354 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700355 "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.
356 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000357 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -0400358 "labels": { # A group of labels for the file.
359 "restricted": True or False, # Whether viewers are prevented from downloading this file.
360 "hidden": True or False, # Deprecated.
361 "viewed": True or False, # Whether this file has been viewed by this user.
362 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000363 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -0400364 },
365 "indexableText": { # Indexable text attributes for the file (can only be written)
366 "text": "A String", # The text to be indexed for this file.
367 },
368 "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.
369 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
370 "writersCanShare": True or False, # Whether writers can share the document with other users.
371 "owners": [ # The owner(s) of this file.
372 { # The JSON template for a user.
373 "picture": { # The user's profile picture.
374 "url": "A String", # A URL that points to a profile picture of this user.
375 },
376 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400377 "displayName": "A String", # A plain text displayable name for this user.
378 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700379 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
380 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400381 },
382 ],
383 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700384 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
385 "picture": { # The user's profile picture.
386 "url": "A String", # A URL that points to a profile picture of this user.
387 },
388 "kind": "drive#user", # This is always drive#user.
389 "displayName": "A String", # A plain text displayable name for this user.
390 "permissionId": "A String", # The user's ID as visible in the permissions collection.
391 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
392 "emailAddress": "A String", # The email address of the user.
393 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700394 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
395 "width": 42, # The width of the video in pixels.
396 "durationMillis": "A String", # The duration of the video in milliseconds.
397 "height": 42, # The height of the video in pixels.
398 },
John Asmuth614db982014-04-24 15:46:26 -0400399 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
400 "picture": { # The user's profile picture.
401 "url": "A String", # A URL that points to a profile picture of this user.
402 },
403 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400404 "displayName": "A String", # A plain text displayable name for this user.
405 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700406 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
407 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400408 },
409 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800410 "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 -0400411 "ownerNames": [ # Name(s) of the owner(s) of this file.
412 "A String",
413 ],
414 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
415 "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.
416 "etag": "A String", # ETag of the file.
417 "parents": [ # Collection of parent folders which contain this file.
418 # 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.
419 { # A reference to a file's parent.
420 "selfLink": "A String", # A link back to this reference.
421 "kind": "drive#parentReference", # This is always drive#parentReference.
422 "id": "A String", # The ID of the parent.
423 "isRoot": True or False, # Whether or not the parent is the root folder.
424 "parentLink": "A String", # A link to the parent.
425 },
426 ],
427 "exportLinks": { # Links for exporting Google Docs to specific formats.
428 "a_key": "A String", # A mapping from export format to URL
429 },
430 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700431 "permissions": [ # The list of permissions for users with access to this file.
432 { # A permission for a file.
433 "withLink": True or False, # Whether the link is required for this permission.
434 "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.
435 "name": "A String", # The name for this permission.
436 "kind": "drive#permission", # This is always drive#permission.
437 "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.
438 "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.
439 "authKey": "A String", # The authkey parameter required for this permission.
440 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800441 "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 -0700442 "photoLink": "A String", # A link to the profile photo, if available.
443 "role": "A String", # The primary role for this user. Allowed values are:
444 # - owner
445 # - reader
446 # - writer
447 "type": "A String", # The account type. Allowed values are:
448 # - user
449 # - group
450 # - domain
451 # - anyone
452 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
453 "A String",
454 ],
455 "selfLink": "A String", # A link back to this permission.
456 },
457 ],
John Asmuth614db982014-04-24 15:46:26 -0400458 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
459 "mimeType": "A String", # The MIME type of the thumbnail.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000460 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
John Asmuth614db982014-04-24 15:46:26 -0400461 },
462 "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.
463 "a_key": "A String",
464 },
465 "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.
466 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
467 "exposureTime": 3.14, # The length of the exposure, in seconds.
468 "cameraMake": "A String", # The make of the camera used to create the photo.
469 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
470 "isoSpeed": 42, # The ISO speed used to create the photo.
471 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
472 "exposureMode": "A String", # The exposure mode used to create the photo.
473 "colorSpace": "A String", # The color space of the photo.
474 "location": { # Geographic location information stored in the image.
475 "latitude": 3.14, # The latitude stored in the image.
476 "altitude": 3.14, # The altitude stored in the image.
477 "longitude": 3.14, # The longitude stored in the image.
478 },
479 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
480 "height": 42, # The height of the image in pixels.
481 "lens": "A String", # The lens used to create the photo.
482 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
483 "width": 42, # The width of the image in pixels.
484 "meteringMode": "A String", # The metering mode used to create the photo.
485 "flashUsed": True or False, # Whether a flash was used to create the photo.
486 "aperture": 3.14, # The aperture used to create the photo (f-number).
487 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
488 "sensor": "A String", # The type of sensor used to create the photo.
489 "whiteBalance": "A String", # The white balance mode used to create the photo.
490 "cameraModel": "A String", # The model of the camera used to create the photo.
491 },
492 "description": "A String", # A short description of the file.
493 "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.
494 "editable": True or False, # Whether the file can be edited by the current user.
495 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700496 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400497 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
498 "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 -0700499 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400500 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000501 { # A key-value pair attached to a file that is either public or private to an application.
502 # The following limits apply to file properties:
503 # - Maximum of 100 properties total per file
504 # - Maximum of 30 private properties per app
505 # - Maximum of 30 public properties
506 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -0400507 "kind": "drive#property", # This is always drive#property.
508 "value": "A String", # The value of this property.
509 "etag": "A String", # ETag of the property.
510 "visibility": "A String", # The visibility of this property.
511 "key": "A String", # The key of this property.
512 "selfLink": "A String", # The link back to this property.
513 },
514 ],
515 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
516 "iconLink": "A String", # A link to the file's icon.
517 "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.
518 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700519 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400520 "title": "A String", # The title of this file.
521 "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.
522 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
523 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
524 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700525 "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 -0400526 "name": "A String", # The name for this permission.
527 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700528 "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.
529 "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 -0400530 "authKey": "A String", # The authkey parameter required for this permission.
531 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800532 "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 -0400533 "photoLink": "A String", # A link to the profile photo, if available.
534 "role": "A String", # The primary role for this user. Allowed values are:
535 # - owner
536 # - reader
537 # - writer
538 "type": "A String", # The account type. Allowed values are:
539 # - user
540 # - group
541 # - domain
542 # - anyone
543 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
544 "A String",
545 ],
546 "selfLink": "A String", # A link back to this permission.
547 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000548 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.
549 "A String",
550 ],
John Asmuth614db982014-04-24 15:46:26 -0400551 "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.
552 "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.
553 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
554 "selfLink": "A String", # A link back to this file.
555 "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.
556 }</pre>
557</div>
558
559<div class="method">
560 <code class="details" id="delete">delete(fileId)</code>
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000561 <pre>Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file.
John Asmuth614db982014-04-24 15:46:26 -0400562
563Args:
564 fileId: string, The ID of the file to delete. (required)
565</pre>
566</div>
567
568<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -0700569 <code class="details" id="emptyTrash">emptyTrash()</code>
570 <pre>Permanently deletes all of the user's trashed files.
571
572Args:
573</pre>
574</div>
575
576<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000577 <code class="details" id="get">get(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400578 <pre>Gets a file's metadata by ID.
579
580Args:
581 fileId: string, The ID for the file in question. (required)
582 projection: string, This parameter is deprecated and has no function.
583 Allowed values
584 BASIC - Deprecated
585 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000586 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -0800587 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
John Asmuth614db982014-04-24 15:46:26 -0400588 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
589
590Returns:
591 An object of the form:
592
593 { # The metadata for a file.
594 "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.
595 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700596 "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.
597 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000598 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -0400599 "labels": { # A group of labels for the file.
600 "restricted": True or False, # Whether viewers are prevented from downloading this file.
601 "hidden": True or False, # Deprecated.
602 "viewed": True or False, # Whether this file has been viewed by this user.
603 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000604 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -0400605 },
606 "indexableText": { # Indexable text attributes for the file (can only be written)
607 "text": "A String", # The text to be indexed for this file.
608 },
609 "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.
610 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
611 "writersCanShare": True or False, # Whether writers can share the document with other users.
612 "owners": [ # The owner(s) of this file.
613 { # The JSON template for a user.
614 "picture": { # The user's profile picture.
615 "url": "A String", # A URL that points to a profile picture of this user.
616 },
617 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400618 "displayName": "A String", # A plain text displayable name for this user.
619 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700620 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
621 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400622 },
623 ],
624 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700625 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
626 "picture": { # The user's profile picture.
627 "url": "A String", # A URL that points to a profile picture of this user.
628 },
629 "kind": "drive#user", # This is always drive#user.
630 "displayName": "A String", # A plain text displayable name for this user.
631 "permissionId": "A String", # The user's ID as visible in the permissions collection.
632 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
633 "emailAddress": "A String", # The email address of the user.
634 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700635 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
636 "width": 42, # The width of the video in pixels.
637 "durationMillis": "A String", # The duration of the video in milliseconds.
638 "height": 42, # The height of the video in pixels.
639 },
John Asmuth614db982014-04-24 15:46:26 -0400640 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
641 "picture": { # The user's profile picture.
642 "url": "A String", # A URL that points to a profile picture of this user.
643 },
644 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400645 "displayName": "A String", # A plain text displayable name for this user.
646 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700647 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
648 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400649 },
650 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800651 "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 -0400652 "ownerNames": [ # Name(s) of the owner(s) of this file.
653 "A String",
654 ],
655 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
656 "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.
657 "etag": "A String", # ETag of the file.
658 "parents": [ # Collection of parent folders which contain this file.
659 # 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.
660 { # A reference to a file's parent.
661 "selfLink": "A String", # A link back to this reference.
662 "kind": "drive#parentReference", # This is always drive#parentReference.
663 "id": "A String", # The ID of the parent.
664 "isRoot": True or False, # Whether or not the parent is the root folder.
665 "parentLink": "A String", # A link to the parent.
666 },
667 ],
668 "exportLinks": { # Links for exporting Google Docs to specific formats.
669 "a_key": "A String", # A mapping from export format to URL
670 },
671 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700672 "permissions": [ # The list of permissions for users with access to this file.
673 { # A permission for a file.
674 "withLink": True or False, # Whether the link is required for this permission.
675 "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.
676 "name": "A String", # The name for this permission.
677 "kind": "drive#permission", # This is always drive#permission.
678 "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.
679 "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.
680 "authKey": "A String", # The authkey parameter required for this permission.
681 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800682 "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 -0700683 "photoLink": "A String", # A link to the profile photo, if available.
684 "role": "A String", # The primary role for this user. Allowed values are:
685 # - owner
686 # - reader
687 # - writer
688 "type": "A String", # The account type. Allowed values are:
689 # - user
690 # - group
691 # - domain
692 # - anyone
693 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
694 "A String",
695 ],
696 "selfLink": "A String", # A link back to this permission.
697 },
698 ],
John Asmuth614db982014-04-24 15:46:26 -0400699 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
700 "mimeType": "A String", # The MIME type of the thumbnail.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000701 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
John Asmuth614db982014-04-24 15:46:26 -0400702 },
703 "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.
704 "a_key": "A String",
705 },
706 "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.
707 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
708 "exposureTime": 3.14, # The length of the exposure, in seconds.
709 "cameraMake": "A String", # The make of the camera used to create the photo.
710 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
711 "isoSpeed": 42, # The ISO speed used to create the photo.
712 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
713 "exposureMode": "A String", # The exposure mode used to create the photo.
714 "colorSpace": "A String", # The color space of the photo.
715 "location": { # Geographic location information stored in the image.
716 "latitude": 3.14, # The latitude stored in the image.
717 "altitude": 3.14, # The altitude stored in the image.
718 "longitude": 3.14, # The longitude stored in the image.
719 },
720 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
721 "height": 42, # The height of the image in pixels.
722 "lens": "A String", # The lens used to create the photo.
723 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
724 "width": 42, # The width of the image in pixels.
725 "meteringMode": "A String", # The metering mode used to create the photo.
726 "flashUsed": True or False, # Whether a flash was used to create the photo.
727 "aperture": 3.14, # The aperture used to create the photo (f-number).
728 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
729 "sensor": "A String", # The type of sensor used to create the photo.
730 "whiteBalance": "A String", # The white balance mode used to create the photo.
731 "cameraModel": "A String", # The model of the camera used to create the photo.
732 },
733 "description": "A String", # A short description of the file.
734 "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.
735 "editable": True or False, # Whether the file can be edited by the current user.
736 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700737 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400738 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
739 "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 -0700740 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400741 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000742 { # A key-value pair attached to a file that is either public or private to an application.
743 # The following limits apply to file properties:
744 # - Maximum of 100 properties total per file
745 # - Maximum of 30 private properties per app
746 # - Maximum of 30 public properties
747 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -0400748 "kind": "drive#property", # This is always drive#property.
749 "value": "A String", # The value of this property.
750 "etag": "A String", # ETag of the property.
751 "visibility": "A String", # The visibility of this property.
752 "key": "A String", # The key of this property.
753 "selfLink": "A String", # The link back to this property.
754 },
755 ],
756 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
757 "iconLink": "A String", # A link to the file's icon.
758 "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.
759 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700760 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400761 "title": "A String", # The title of this file.
762 "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.
763 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
764 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
765 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700766 "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 -0400767 "name": "A String", # The name for this permission.
768 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700769 "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.
770 "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 -0400771 "authKey": "A String", # The authkey parameter required for this permission.
772 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800773 "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 -0400774 "photoLink": "A String", # A link to the profile photo, if available.
775 "role": "A String", # The primary role for this user. Allowed values are:
776 # - owner
777 # - reader
778 # - writer
779 "type": "A String", # The account type. Allowed values are:
780 # - user
781 # - group
782 # - domain
783 # - anyone
784 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
785 "A String",
786 ],
787 "selfLink": "A String", # A link back to this permission.
788 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000789 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.
790 "A String",
791 ],
John Asmuth614db982014-04-24 15:46:26 -0400792 "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.
793 "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.
794 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
795 "selfLink": "A String", # A link back to this file.
796 "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.
797 }</pre>
798</div>
799
800<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000801 <code class="details" id="get_media">get_media(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
Craig Citroe633be12015-03-02 13:40:36 -0800802 <pre>Gets a file's metadata by ID.
803
804Args:
805 fileId: string, The ID for the file in question. (required)
806 projection: string, This parameter is deprecated and has no function.
807 Allowed values
808 BASIC - Deprecated
809 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000810 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -0800811 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
812 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
813
814Returns:
815 The media object as a string.
816
817 </pre>
818</div>
819
820<div class="method">
John Asmuth614db982014-04-24 15:46:26 -0400821 <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>
822 <pre>Insert a new file.
823
824Args:
825 body: object, The request body.
826 The object takes the form of:
827
828{ # The metadata for a file.
829 "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.
830 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700831 "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.
832 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000833 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -0400834 "labels": { # A group of labels for the file.
835 "restricted": True or False, # Whether viewers are prevented from downloading this file.
836 "hidden": True or False, # Deprecated.
837 "viewed": True or False, # Whether this file has been viewed by this user.
838 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000839 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -0400840 },
841 "indexableText": { # Indexable text attributes for the file (can only be written)
842 "text": "A String", # The text to be indexed for this file.
843 },
844 "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.
845 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
846 "writersCanShare": True or False, # Whether writers can share the document with other users.
847 "owners": [ # The owner(s) of this file.
848 { # The JSON template for a user.
849 "picture": { # The user's profile picture.
850 "url": "A String", # A URL that points to a profile picture of this user.
851 },
852 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400853 "displayName": "A String", # A plain text displayable name for this user.
854 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700855 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
856 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400857 },
858 ],
859 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700860 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
861 "picture": { # The user's profile picture.
862 "url": "A String", # A URL that points to a profile picture of this user.
863 },
864 "kind": "drive#user", # This is always drive#user.
865 "displayName": "A String", # A plain text displayable name for this user.
866 "permissionId": "A String", # The user's ID as visible in the permissions collection.
867 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
868 "emailAddress": "A String", # The email address of the user.
869 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700870 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
871 "width": 42, # The width of the video in pixels.
872 "durationMillis": "A String", # The duration of the video in milliseconds.
873 "height": 42, # The height of the video in pixels.
874 },
John Asmuth614db982014-04-24 15:46:26 -0400875 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
876 "picture": { # The user's profile picture.
877 "url": "A String", # A URL that points to a profile picture of this user.
878 },
879 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400880 "displayName": "A String", # A plain text displayable name for this user.
881 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700882 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
883 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400884 },
885 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800886 "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 -0400887 "ownerNames": [ # Name(s) of the owner(s) of this file.
888 "A String",
889 ],
890 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
891 "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.
892 "etag": "A String", # ETag of the file.
893 "parents": [ # Collection of parent folders which contain this file.
894 # 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.
895 { # A reference to a file's parent.
896 "selfLink": "A String", # A link back to this reference.
897 "kind": "drive#parentReference", # This is always drive#parentReference.
898 "id": "A String", # The ID of the parent.
899 "isRoot": True or False, # Whether or not the parent is the root folder.
900 "parentLink": "A String", # A link to the parent.
901 },
902 ],
903 "exportLinks": { # Links for exporting Google Docs to specific formats.
904 "a_key": "A String", # A mapping from export format to URL
905 },
906 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700907 "permissions": [ # The list of permissions for users with access to this file.
908 { # A permission for a file.
909 "withLink": True or False, # Whether the link is required for this permission.
910 "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.
911 "name": "A String", # The name for this permission.
912 "kind": "drive#permission", # This is always drive#permission.
913 "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.
914 "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.
915 "authKey": "A String", # The authkey parameter required for this permission.
916 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800917 "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 -0700918 "photoLink": "A String", # A link to the profile photo, if available.
919 "role": "A String", # The primary role for this user. Allowed values are:
920 # - owner
921 # - reader
922 # - writer
923 "type": "A String", # The account type. Allowed values are:
924 # - user
925 # - group
926 # - domain
927 # - anyone
928 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
929 "A String",
930 ],
931 "selfLink": "A String", # A link back to this permission.
932 },
933 ],
John Asmuth614db982014-04-24 15:46:26 -0400934 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
935 "mimeType": "A String", # The MIME type of the thumbnail.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000936 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
John Asmuth614db982014-04-24 15:46:26 -0400937 },
938 "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.
939 "a_key": "A String",
940 },
941 "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.
942 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
943 "exposureTime": 3.14, # The length of the exposure, in seconds.
944 "cameraMake": "A String", # The make of the camera used to create the photo.
945 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
946 "isoSpeed": 42, # The ISO speed used to create the photo.
947 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
948 "exposureMode": "A String", # The exposure mode used to create the photo.
949 "colorSpace": "A String", # The color space of the photo.
950 "location": { # Geographic location information stored in the image.
951 "latitude": 3.14, # The latitude stored in the image.
952 "altitude": 3.14, # The altitude stored in the image.
953 "longitude": 3.14, # The longitude stored in the image.
954 },
955 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
956 "height": 42, # The height of the image in pixels.
957 "lens": "A String", # The lens used to create the photo.
958 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
959 "width": 42, # The width of the image in pixels.
960 "meteringMode": "A String", # The metering mode used to create the photo.
961 "flashUsed": True or False, # Whether a flash was used to create the photo.
962 "aperture": 3.14, # The aperture used to create the photo (f-number).
963 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
964 "sensor": "A String", # The type of sensor used to create the photo.
965 "whiteBalance": "A String", # The white balance mode used to create the photo.
966 "cameraModel": "A String", # The model of the camera used to create the photo.
967 },
968 "description": "A String", # A short description of the file.
969 "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.
970 "editable": True or False, # Whether the file can be edited by the current user.
971 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700972 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400973 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
974 "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 -0700975 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400976 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000977 { # A key-value pair attached to a file that is either public or private to an application.
978 # The following limits apply to file properties:
979 # - Maximum of 100 properties total per file
980 # - Maximum of 30 private properties per app
981 # - Maximum of 30 public properties
982 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -0400983 "kind": "drive#property", # This is always drive#property.
984 "value": "A String", # The value of this property.
985 "etag": "A String", # ETag of the property.
986 "visibility": "A String", # The visibility of this property.
987 "key": "A String", # The key of this property.
988 "selfLink": "A String", # The link back to this property.
989 },
990 ],
991 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
992 "iconLink": "A String", # A link to the file's icon.
993 "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.
994 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700995 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400996 "title": "A String", # The title of this file.
997 "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.
998 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
999 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1000 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001001 "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 -04001002 "name": "A String", # The name for this permission.
1003 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001004 "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.
1005 "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 -04001006 "authKey": "A String", # The authkey parameter required for this permission.
1007 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001008 "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 -04001009 "photoLink": "A String", # A link to the profile photo, if available.
1010 "role": "A String", # The primary role for this user. Allowed values are:
1011 # - owner
1012 # - reader
1013 # - writer
1014 "type": "A String", # The account type. Allowed values are:
1015 # - user
1016 # - group
1017 # - domain
1018 # - anyone
1019 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1020 "A String",
1021 ],
1022 "selfLink": "A String", # A link back to this permission.
1023 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001024 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.
1025 "A String",
1026 ],
John Asmuth614db982014-04-24 15:46:26 -04001027 "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.
1028 "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.
1029 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1030 "selfLink": "A String", # A link back to this file.
1031 "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.
1032}
1033
1034 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
1035 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
1036 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
1037 visibility: string, The visibility of the new file. This parameter is only relevant when convert=false.
1038 Allowed values
1039 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
1040 PRIVATE - The new file will be visible to only the owner.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001041 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
John Asmuth614db982014-04-24 15:46:26 -04001042 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
1043 timedTextLanguage: string, The language of the timed text.
1044 timedTextTrackName: string, The timed text track name.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001045 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 -04001046
1047Returns:
1048 An object of the form:
1049
1050 { # The metadata for a file.
1051 "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.
1052 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001053 "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.
1054 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001055 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04001056 "labels": { # A group of labels for the file.
1057 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1058 "hidden": True or False, # Deprecated.
1059 "viewed": True or False, # Whether this file has been viewed by this user.
1060 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001061 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04001062 },
1063 "indexableText": { # Indexable text attributes for the file (can only be written)
1064 "text": "A String", # The text to be indexed for this file.
1065 },
1066 "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.
1067 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1068 "writersCanShare": True or False, # Whether writers can share the document with other users.
1069 "owners": [ # The owner(s) of this file.
1070 { # The JSON template for a user.
1071 "picture": { # The user's profile picture.
1072 "url": "A String", # A URL that points to a profile picture of this user.
1073 },
1074 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001075 "displayName": "A String", # A plain text displayable name for this user.
1076 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001077 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1078 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001079 },
1080 ],
1081 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001082 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1083 "picture": { # The user's profile picture.
1084 "url": "A String", # A URL that points to a profile picture of this user.
1085 },
1086 "kind": "drive#user", # This is always drive#user.
1087 "displayName": "A String", # A plain text displayable name for this user.
1088 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1089 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1090 "emailAddress": "A String", # The email address of the user.
1091 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001092 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1093 "width": 42, # The width of the video in pixels.
1094 "durationMillis": "A String", # The duration of the video in milliseconds.
1095 "height": 42, # The height of the video in pixels.
1096 },
John Asmuth614db982014-04-24 15:46:26 -04001097 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1098 "picture": { # The user's profile picture.
1099 "url": "A String", # A URL that points to a profile picture of this user.
1100 },
1101 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001102 "displayName": "A String", # A plain text displayable name for this user.
1103 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001104 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1105 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001106 },
1107 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001108 "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 -04001109 "ownerNames": [ # Name(s) of the owner(s) of this file.
1110 "A String",
1111 ],
1112 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1113 "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.
1114 "etag": "A String", # ETag of the file.
1115 "parents": [ # Collection of parent folders which contain this file.
1116 # 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.
1117 { # A reference to a file's parent.
1118 "selfLink": "A String", # A link back to this reference.
1119 "kind": "drive#parentReference", # This is always drive#parentReference.
1120 "id": "A String", # The ID of the parent.
1121 "isRoot": True or False, # Whether or not the parent is the root folder.
1122 "parentLink": "A String", # A link to the parent.
1123 },
1124 ],
1125 "exportLinks": { # Links for exporting Google Docs to specific formats.
1126 "a_key": "A String", # A mapping from export format to URL
1127 },
1128 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001129 "permissions": [ # The list of permissions for users with access to this file.
1130 { # A permission for a file.
1131 "withLink": True or False, # Whether the link is required for this permission.
1132 "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.
1133 "name": "A String", # The name for this permission.
1134 "kind": "drive#permission", # This is always drive#permission.
1135 "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.
1136 "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.
1137 "authKey": "A String", # The authkey parameter required for this permission.
1138 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001139 "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 -07001140 "photoLink": "A String", # A link to the profile photo, if available.
1141 "role": "A String", # The primary role for this user. Allowed values are:
1142 # - owner
1143 # - reader
1144 # - writer
1145 "type": "A String", # The account type. Allowed values are:
1146 # - user
1147 # - group
1148 # - domain
1149 # - anyone
1150 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1151 "A String",
1152 ],
1153 "selfLink": "A String", # A link back to this permission.
1154 },
1155 ],
John Asmuth614db982014-04-24 15:46:26 -04001156 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1157 "mimeType": "A String", # The MIME type of the thumbnail.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001158 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
John Asmuth614db982014-04-24 15:46:26 -04001159 },
1160 "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.
1161 "a_key": "A String",
1162 },
1163 "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.
1164 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1165 "exposureTime": 3.14, # The length of the exposure, in seconds.
1166 "cameraMake": "A String", # The make of the camera used to create the photo.
1167 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1168 "isoSpeed": 42, # The ISO speed used to create the photo.
1169 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1170 "exposureMode": "A String", # The exposure mode used to create the photo.
1171 "colorSpace": "A String", # The color space of the photo.
1172 "location": { # Geographic location information stored in the image.
1173 "latitude": 3.14, # The latitude stored in the image.
1174 "altitude": 3.14, # The altitude stored in the image.
1175 "longitude": 3.14, # The longitude stored in the image.
1176 },
1177 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1178 "height": 42, # The height of the image in pixels.
1179 "lens": "A String", # The lens used to create the photo.
1180 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1181 "width": 42, # The width of the image in pixels.
1182 "meteringMode": "A String", # The metering mode used to create the photo.
1183 "flashUsed": True or False, # Whether a flash was used to create the photo.
1184 "aperture": 3.14, # The aperture used to create the photo (f-number).
1185 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1186 "sensor": "A String", # The type of sensor used to create the photo.
1187 "whiteBalance": "A String", # The white balance mode used to create the photo.
1188 "cameraModel": "A String", # The model of the camera used to create the photo.
1189 },
1190 "description": "A String", # A short description of the file.
1191 "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.
1192 "editable": True or False, # Whether the file can be edited by the current user.
1193 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001194 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001195 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1196 "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 -07001197 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001198 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001199 { # A key-value pair attached to a file that is either public or private to an application.
1200 # The following limits apply to file properties:
1201 # - Maximum of 100 properties total per file
1202 # - Maximum of 30 private properties per app
1203 # - Maximum of 30 public properties
1204 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04001205 "kind": "drive#property", # This is always drive#property.
1206 "value": "A String", # The value of this property.
1207 "etag": "A String", # ETag of the property.
1208 "visibility": "A String", # The visibility of this property.
1209 "key": "A String", # The key of this property.
1210 "selfLink": "A String", # The link back to this property.
1211 },
1212 ],
1213 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1214 "iconLink": "A String", # A link to the file's icon.
1215 "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.
1216 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001217 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001218 "title": "A String", # The title of this file.
1219 "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.
1220 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1221 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1222 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001223 "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 -04001224 "name": "A String", # The name for this permission.
1225 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001226 "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.
1227 "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 -04001228 "authKey": "A String", # The authkey parameter required for this permission.
1229 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001230 "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 -04001231 "photoLink": "A String", # A link to the profile photo, if available.
1232 "role": "A String", # The primary role for this user. Allowed values are:
1233 # - owner
1234 # - reader
1235 # - writer
1236 "type": "A String", # The account type. Allowed values are:
1237 # - user
1238 # - group
1239 # - domain
1240 # - anyone
1241 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1242 "A String",
1243 ],
1244 "selfLink": "A String", # A link back to this permission.
1245 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001246 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.
1247 "A String",
1248 ],
John Asmuth614db982014-04-24 15:46:26 -04001249 "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.
1250 "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.
1251 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1252 "selfLink": "A String", # A link back to this file.
1253 "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.
1254 }</pre>
1255</div>
1256
1257<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001258 <code class="details" id="list">list(q=None, projection=None, pageToken=None, maxResults=None, spaces=None, corpus=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04001259 <pre>Lists the user's files.
1260
1261Args:
1262 q: string, Query string for searching files.
1263 projection: string, This parameter is deprecated and has no function.
1264 Allowed values
1265 BASIC - Deprecated
1266 FULL - Deprecated
1267 pageToken: string, Page token for files.
1268 maxResults: integer, Maximum number of files to return.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001269 spaces: string, A comma-separated list of spaces to query. Supported values are 'drive' and 'appDataFolder'.
Craig Citro065b5302014-08-14 00:47:23 -07001270 corpus: string, The body of items (files/documents) to which the query applies.
1271 Allowed values
1272 DEFAULT - The items that the user has accessed.
1273 DOMAIN - Items shared to the user's domain.
John Asmuth614db982014-04-24 15:46:26 -04001274
1275Returns:
1276 An object of the form:
1277
1278 { # A list of files.
1279 "nextPageToken": "A String", # The page token for the next page of files.
1280 "kind": "drive#fileList", # This is always drive#fileList.
1281 "items": [ # The actual list of files.
1282 { # The metadata for a file.
1283 "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.
1284 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001285 "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.
1286 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001287 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04001288 "labels": { # A group of labels for the file.
1289 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1290 "hidden": True or False, # Deprecated.
1291 "viewed": True or False, # Whether this file has been viewed by this user.
1292 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001293 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04001294 },
1295 "indexableText": { # Indexable text attributes for the file (can only be written)
1296 "text": "A String", # The text to be indexed for this file.
1297 },
1298 "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.
1299 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1300 "writersCanShare": True or False, # Whether writers can share the document with other users.
1301 "owners": [ # The owner(s) of this file.
1302 { # The JSON template for a user.
1303 "picture": { # The user's profile picture.
1304 "url": "A String", # A URL that points to a profile picture of this user.
1305 },
1306 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001307 "displayName": "A String", # A plain text displayable name for this user.
1308 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001309 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1310 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001311 },
1312 ],
1313 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001314 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1315 "picture": { # The user's profile picture.
1316 "url": "A String", # A URL that points to a profile picture of this user.
1317 },
1318 "kind": "drive#user", # This is always drive#user.
1319 "displayName": "A String", # A plain text displayable name for this user.
1320 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1321 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1322 "emailAddress": "A String", # The email address of the user.
1323 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001324 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1325 "width": 42, # The width of the video in pixels.
1326 "durationMillis": "A String", # The duration of the video in milliseconds.
1327 "height": 42, # The height of the video in pixels.
1328 },
John Asmuth614db982014-04-24 15:46:26 -04001329 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1330 "picture": { # The user's profile picture.
1331 "url": "A String", # A URL that points to a profile picture of this user.
1332 },
1333 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001334 "displayName": "A String", # A plain text displayable name for this user.
1335 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001336 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1337 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001338 },
1339 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001340 "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 -04001341 "ownerNames": [ # Name(s) of the owner(s) of this file.
1342 "A String",
1343 ],
1344 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1345 "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.
1346 "etag": "A String", # ETag of the file.
1347 "parents": [ # Collection of parent folders which contain this file.
1348 # 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.
1349 { # A reference to a file's parent.
1350 "selfLink": "A String", # A link back to this reference.
1351 "kind": "drive#parentReference", # This is always drive#parentReference.
1352 "id": "A String", # The ID of the parent.
1353 "isRoot": True or False, # Whether or not the parent is the root folder.
1354 "parentLink": "A String", # A link to the parent.
1355 },
1356 ],
1357 "exportLinks": { # Links for exporting Google Docs to specific formats.
1358 "a_key": "A String", # A mapping from export format to URL
1359 },
1360 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001361 "permissions": [ # The list of permissions for users with access to this file.
1362 { # A permission for a file.
1363 "withLink": True or False, # Whether the link is required for this permission.
1364 "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.
1365 "name": "A String", # The name for this permission.
1366 "kind": "drive#permission", # This is always drive#permission.
1367 "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.
1368 "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.
1369 "authKey": "A String", # The authkey parameter required for this permission.
1370 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001371 "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 -07001372 "photoLink": "A String", # A link to the profile photo, if available.
1373 "role": "A String", # The primary role for this user. Allowed values are:
1374 # - owner
1375 # - reader
1376 # - writer
1377 "type": "A String", # The account type. Allowed values are:
1378 # - user
1379 # - group
1380 # - domain
1381 # - anyone
1382 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1383 "A String",
1384 ],
1385 "selfLink": "A String", # A link back to this permission.
1386 },
1387 ],
John Asmuth614db982014-04-24 15:46:26 -04001388 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1389 "mimeType": "A String", # The MIME type of the thumbnail.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001390 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
John Asmuth614db982014-04-24 15:46:26 -04001391 },
1392 "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.
1393 "a_key": "A String",
1394 },
1395 "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.
1396 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1397 "exposureTime": 3.14, # The length of the exposure, in seconds.
1398 "cameraMake": "A String", # The make of the camera used to create the photo.
1399 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1400 "isoSpeed": 42, # The ISO speed used to create the photo.
1401 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1402 "exposureMode": "A String", # The exposure mode used to create the photo.
1403 "colorSpace": "A String", # The color space of the photo.
1404 "location": { # Geographic location information stored in the image.
1405 "latitude": 3.14, # The latitude stored in the image.
1406 "altitude": 3.14, # The altitude stored in the image.
1407 "longitude": 3.14, # The longitude stored in the image.
1408 },
1409 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1410 "height": 42, # The height of the image in pixels.
1411 "lens": "A String", # The lens used to create the photo.
1412 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1413 "width": 42, # The width of the image in pixels.
1414 "meteringMode": "A String", # The metering mode used to create the photo.
1415 "flashUsed": True or False, # Whether a flash was used to create the photo.
1416 "aperture": 3.14, # The aperture used to create the photo (f-number).
1417 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1418 "sensor": "A String", # The type of sensor used to create the photo.
1419 "whiteBalance": "A String", # The white balance mode used to create the photo.
1420 "cameraModel": "A String", # The model of the camera used to create the photo.
1421 },
1422 "description": "A String", # A short description of the file.
1423 "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.
1424 "editable": True or False, # Whether the file can be edited by the current user.
1425 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001426 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001427 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1428 "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 -07001429 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001430 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001431 { # A key-value pair attached to a file that is either public or private to an application.
1432 # The following limits apply to file properties:
1433 # - Maximum of 100 properties total per file
1434 # - Maximum of 30 private properties per app
1435 # - Maximum of 30 public properties
1436 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04001437 "kind": "drive#property", # This is always drive#property.
1438 "value": "A String", # The value of this property.
1439 "etag": "A String", # ETag of the property.
1440 "visibility": "A String", # The visibility of this property.
1441 "key": "A String", # The key of this property.
1442 "selfLink": "A String", # The link back to this property.
1443 },
1444 ],
1445 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1446 "iconLink": "A String", # A link to the file's icon.
1447 "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.
1448 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001449 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001450 "title": "A String", # The title of this file.
1451 "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.
1452 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1453 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1454 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001455 "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 -04001456 "name": "A String", # The name for this permission.
1457 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001458 "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.
1459 "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 -04001460 "authKey": "A String", # The authkey parameter required for this permission.
1461 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001462 "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 -04001463 "photoLink": "A String", # A link to the profile photo, if available.
1464 "role": "A String", # The primary role for this user. Allowed values are:
1465 # - owner
1466 # - reader
1467 # - writer
1468 "type": "A String", # The account type. Allowed values are:
1469 # - user
1470 # - group
1471 # - domain
1472 # - anyone
1473 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1474 "A String",
1475 ],
1476 "selfLink": "A String", # A link back to this permission.
1477 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001478 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.
1479 "A String",
1480 ],
John Asmuth614db982014-04-24 15:46:26 -04001481 "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.
1482 "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.
1483 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1484 "selfLink": "A String", # A link back to this file.
1485 "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.
1486 },
1487 ],
1488 "nextLink": "A String", # A link to the next page of files.
1489 "etag": "A String", # The ETag of the list.
1490 "selfLink": "A String", # A link back to this list.
1491 }</pre>
1492</div>
1493
1494<div class="method">
1495 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1496 <pre>Retrieves the next page of results.
1497
1498Args:
1499 previous_request: The request for the previous page. (required)
1500 previous_response: The response from the request for the previous page. (required)
1501
1502Returns:
1503 A request object that you can call 'execute()' on to request the next
1504 page. Returns None if there are no more items in the collection.
1505 </pre>
1506</div>
1507
1508<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -07001509 <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 -04001510 <pre>Updates file metadata and/or content. This method supports patch semantics.
1511
1512Args:
1513 fileId: string, The ID of the file to update. (required)
1514 body: object, The request body. (required)
1515 The object takes the form of:
1516
1517{ # The metadata for a file.
1518 "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.
1519 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001520 "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.
1521 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001522 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04001523 "labels": { # A group of labels for the file.
1524 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1525 "hidden": True or False, # Deprecated.
1526 "viewed": True or False, # Whether this file has been viewed by this user.
1527 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001528 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04001529 },
1530 "indexableText": { # Indexable text attributes for the file (can only be written)
1531 "text": "A String", # The text to be indexed for this file.
1532 },
1533 "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.
1534 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1535 "writersCanShare": True or False, # Whether writers can share the document with other users.
1536 "owners": [ # The owner(s) of this file.
1537 { # The JSON template for a user.
1538 "picture": { # The user's profile picture.
1539 "url": "A String", # A URL that points to a profile picture of this user.
1540 },
1541 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001542 "displayName": "A String", # A plain text displayable name for this user.
1543 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001544 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1545 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001546 },
1547 ],
1548 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001549 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1550 "picture": { # The user's profile picture.
1551 "url": "A String", # A URL that points to a profile picture of this user.
1552 },
1553 "kind": "drive#user", # This is always drive#user.
1554 "displayName": "A String", # A plain text displayable name for this user.
1555 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1556 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1557 "emailAddress": "A String", # The email address of the user.
1558 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001559 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1560 "width": 42, # The width of the video in pixels.
1561 "durationMillis": "A String", # The duration of the video in milliseconds.
1562 "height": 42, # The height of the video in pixels.
1563 },
John Asmuth614db982014-04-24 15:46:26 -04001564 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1565 "picture": { # The user's profile picture.
1566 "url": "A String", # A URL that points to a profile picture of this user.
1567 },
1568 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001569 "displayName": "A String", # A plain text displayable name for this user.
1570 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001571 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1572 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001573 },
1574 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001575 "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 -04001576 "ownerNames": [ # Name(s) of the owner(s) of this file.
1577 "A String",
1578 ],
1579 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1580 "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.
1581 "etag": "A String", # ETag of the file.
1582 "parents": [ # Collection of parent folders which contain this file.
1583 # 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.
1584 { # A reference to a file's parent.
1585 "selfLink": "A String", # A link back to this reference.
1586 "kind": "drive#parentReference", # This is always drive#parentReference.
1587 "id": "A String", # The ID of the parent.
1588 "isRoot": True or False, # Whether or not the parent is the root folder.
1589 "parentLink": "A String", # A link to the parent.
1590 },
1591 ],
1592 "exportLinks": { # Links for exporting Google Docs to specific formats.
1593 "a_key": "A String", # A mapping from export format to URL
1594 },
1595 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001596 "permissions": [ # The list of permissions for users with access to this file.
1597 { # A permission for a file.
1598 "withLink": True or False, # Whether the link is required for this permission.
1599 "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.
1600 "name": "A String", # The name for this permission.
1601 "kind": "drive#permission", # This is always drive#permission.
1602 "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.
1603 "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.
1604 "authKey": "A String", # The authkey parameter required for this permission.
1605 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001606 "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 -07001607 "photoLink": "A String", # A link to the profile photo, if available.
1608 "role": "A String", # The primary role for this user. Allowed values are:
1609 # - owner
1610 # - reader
1611 # - writer
1612 "type": "A String", # The account type. Allowed values are:
1613 # - user
1614 # - group
1615 # - domain
1616 # - anyone
1617 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1618 "A String",
1619 ],
1620 "selfLink": "A String", # A link back to this permission.
1621 },
1622 ],
John Asmuth614db982014-04-24 15:46:26 -04001623 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1624 "mimeType": "A String", # The MIME type of the thumbnail.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001625 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
John Asmuth614db982014-04-24 15:46:26 -04001626 },
1627 "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.
1628 "a_key": "A String",
1629 },
1630 "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.
1631 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1632 "exposureTime": 3.14, # The length of the exposure, in seconds.
1633 "cameraMake": "A String", # The make of the camera used to create the photo.
1634 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1635 "isoSpeed": 42, # The ISO speed used to create the photo.
1636 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1637 "exposureMode": "A String", # The exposure mode used to create the photo.
1638 "colorSpace": "A String", # The color space of the photo.
1639 "location": { # Geographic location information stored in the image.
1640 "latitude": 3.14, # The latitude stored in the image.
1641 "altitude": 3.14, # The altitude stored in the image.
1642 "longitude": 3.14, # The longitude stored in the image.
1643 },
1644 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1645 "height": 42, # The height of the image in pixels.
1646 "lens": "A String", # The lens used to create the photo.
1647 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1648 "width": 42, # The width of the image in pixels.
1649 "meteringMode": "A String", # The metering mode used to create the photo.
1650 "flashUsed": True or False, # Whether a flash was used to create the photo.
1651 "aperture": 3.14, # The aperture used to create the photo (f-number).
1652 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1653 "sensor": "A String", # The type of sensor used to create the photo.
1654 "whiteBalance": "A String", # The white balance mode used to create the photo.
1655 "cameraModel": "A String", # The model of the camera used to create the photo.
1656 },
1657 "description": "A String", # A short description of the file.
1658 "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.
1659 "editable": True or False, # Whether the file can be edited by the current user.
1660 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001661 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001662 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1663 "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 -07001664 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001665 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001666 { # A key-value pair attached to a file that is either public or private to an application.
1667 # The following limits apply to file properties:
1668 # - Maximum of 100 properties total per file
1669 # - Maximum of 30 private properties per app
1670 # - Maximum of 30 public properties
1671 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04001672 "kind": "drive#property", # This is always drive#property.
1673 "value": "A String", # The value of this property.
1674 "etag": "A String", # ETag of the property.
1675 "visibility": "A String", # The visibility of this property.
1676 "key": "A String", # The key of this property.
1677 "selfLink": "A String", # The link back to this property.
1678 },
1679 ],
1680 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1681 "iconLink": "A String", # A link to the file's icon.
1682 "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.
1683 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001684 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001685 "title": "A String", # The title of this file.
1686 "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.
1687 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1688 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1689 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001690 "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 -04001691 "name": "A String", # The name for this permission.
1692 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001693 "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.
1694 "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 -04001695 "authKey": "A String", # The authkey parameter required for this permission.
1696 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001697 "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 -04001698 "photoLink": "A String", # A link to the profile photo, if available.
1699 "role": "A String", # The primary role for this user. Allowed values are:
1700 # - owner
1701 # - reader
1702 # - writer
1703 "type": "A String", # The account type. Allowed values are:
1704 # - user
1705 # - group
1706 # - domain
1707 # - anyone
1708 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1709 "A String",
1710 ],
1711 "selfLink": "A String", # A link back to this permission.
1712 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001713 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.
1714 "A String",
1715 ],
John Asmuth614db982014-04-24 15:46:26 -04001716 "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.
1717 "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.
1718 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1719 "selfLink": "A String", # A link back to this file.
1720 "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.
1721}
1722
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001723 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 unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001724 pinned: boolean, Whether to pin the new revision. A file can have a maximum of 200 pinned revisions.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001725 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
John Asmuth614db982014-04-24 15:46:26 -04001726 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Craig Citro065b5302014-08-14 00:47:23 -07001727 addParents: string, Comma-separated list of parent IDs to add.
1728 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04001729 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
1730 timedTextTrackName: string, The timed text track name.
1731 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
1732 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
1733 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
1734 timedTextLanguage: string, The language of the timed text.
1735
1736Returns:
1737 An object of the form:
1738
1739 { # The metadata for a file.
1740 "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.
1741 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001742 "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.
1743 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001744 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04001745 "labels": { # A group of labels for the file.
1746 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1747 "hidden": True or False, # Deprecated.
1748 "viewed": True or False, # Whether this file has been viewed by this user.
1749 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001750 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04001751 },
1752 "indexableText": { # Indexable text attributes for the file (can only be written)
1753 "text": "A String", # The text to be indexed for this file.
1754 },
1755 "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.
1756 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1757 "writersCanShare": True or False, # Whether writers can share the document with other users.
1758 "owners": [ # The owner(s) of this file.
1759 { # The JSON template for a user.
1760 "picture": { # The user's profile picture.
1761 "url": "A String", # A URL that points to a profile picture of this user.
1762 },
1763 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001764 "displayName": "A String", # A plain text displayable name for this user.
1765 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001766 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1767 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001768 },
1769 ],
1770 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001771 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1772 "picture": { # The user's profile picture.
1773 "url": "A String", # A URL that points to a profile picture of this user.
1774 },
1775 "kind": "drive#user", # This is always drive#user.
1776 "displayName": "A String", # A plain text displayable name for this user.
1777 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1778 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1779 "emailAddress": "A String", # The email address of the user.
1780 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001781 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1782 "width": 42, # The width of the video in pixels.
1783 "durationMillis": "A String", # The duration of the video in milliseconds.
1784 "height": 42, # The height of the video in pixels.
1785 },
John Asmuth614db982014-04-24 15:46:26 -04001786 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1787 "picture": { # The user's profile picture.
1788 "url": "A String", # A URL that points to a profile picture of this user.
1789 },
1790 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001791 "displayName": "A String", # A plain text displayable name for this user.
1792 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001793 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1794 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001795 },
1796 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001797 "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 -04001798 "ownerNames": [ # Name(s) of the owner(s) of this file.
1799 "A String",
1800 ],
1801 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1802 "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.
1803 "etag": "A String", # ETag of the file.
1804 "parents": [ # Collection of parent folders which contain this file.
1805 # 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.
1806 { # A reference to a file's parent.
1807 "selfLink": "A String", # A link back to this reference.
1808 "kind": "drive#parentReference", # This is always drive#parentReference.
1809 "id": "A String", # The ID of the parent.
1810 "isRoot": True or False, # Whether or not the parent is the root folder.
1811 "parentLink": "A String", # A link to the parent.
1812 },
1813 ],
1814 "exportLinks": { # Links for exporting Google Docs to specific formats.
1815 "a_key": "A String", # A mapping from export format to URL
1816 },
1817 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001818 "permissions": [ # The list of permissions for users with access to this file.
1819 { # A permission for a file.
1820 "withLink": True or False, # Whether the link is required for this permission.
1821 "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.
1822 "name": "A String", # The name for this permission.
1823 "kind": "drive#permission", # This is always drive#permission.
1824 "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.
1825 "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.
1826 "authKey": "A String", # The authkey parameter required for this permission.
1827 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001828 "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 -07001829 "photoLink": "A String", # A link to the profile photo, if available.
1830 "role": "A String", # The primary role for this user. Allowed values are:
1831 # - owner
1832 # - reader
1833 # - writer
1834 "type": "A String", # The account type. Allowed values are:
1835 # - user
1836 # - group
1837 # - domain
1838 # - anyone
1839 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1840 "A String",
1841 ],
1842 "selfLink": "A String", # A link back to this permission.
1843 },
1844 ],
John Asmuth614db982014-04-24 15:46:26 -04001845 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1846 "mimeType": "A String", # The MIME type of the thumbnail.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001847 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
John Asmuth614db982014-04-24 15:46:26 -04001848 },
1849 "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.
1850 "a_key": "A String",
1851 },
1852 "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.
1853 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1854 "exposureTime": 3.14, # The length of the exposure, in seconds.
1855 "cameraMake": "A String", # The make of the camera used to create the photo.
1856 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1857 "isoSpeed": 42, # The ISO speed used to create the photo.
1858 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1859 "exposureMode": "A String", # The exposure mode used to create the photo.
1860 "colorSpace": "A String", # The color space of the photo.
1861 "location": { # Geographic location information stored in the image.
1862 "latitude": 3.14, # The latitude stored in the image.
1863 "altitude": 3.14, # The altitude stored in the image.
1864 "longitude": 3.14, # The longitude stored in the image.
1865 },
1866 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1867 "height": 42, # The height of the image in pixels.
1868 "lens": "A String", # The lens used to create the photo.
1869 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1870 "width": 42, # The width of the image in pixels.
1871 "meteringMode": "A String", # The metering mode used to create the photo.
1872 "flashUsed": True or False, # Whether a flash was used to create the photo.
1873 "aperture": 3.14, # The aperture used to create the photo (f-number).
1874 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1875 "sensor": "A String", # The type of sensor used to create the photo.
1876 "whiteBalance": "A String", # The white balance mode used to create the photo.
1877 "cameraModel": "A String", # The model of the camera used to create the photo.
1878 },
1879 "description": "A String", # A short description of the file.
1880 "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.
1881 "editable": True or False, # Whether the file can be edited by the current user.
1882 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001883 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001884 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1885 "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 -07001886 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001887 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001888 { # A key-value pair attached to a file that is either public or private to an application.
1889 # The following limits apply to file properties:
1890 # - Maximum of 100 properties total per file
1891 # - Maximum of 30 private properties per app
1892 # - Maximum of 30 public properties
1893 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04001894 "kind": "drive#property", # This is always drive#property.
1895 "value": "A String", # The value of this property.
1896 "etag": "A String", # ETag of the property.
1897 "visibility": "A String", # The visibility of this property.
1898 "key": "A String", # The key of this property.
1899 "selfLink": "A String", # The link back to this property.
1900 },
1901 ],
1902 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1903 "iconLink": "A String", # A link to the file's icon.
1904 "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.
1905 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001906 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001907 "title": "A String", # The title of this file.
1908 "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.
1909 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1910 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1911 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001912 "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 -04001913 "name": "A String", # The name for this permission.
1914 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001915 "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.
1916 "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 -04001917 "authKey": "A String", # The authkey parameter required for this permission.
1918 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001919 "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 -04001920 "photoLink": "A String", # A link to the profile photo, if available.
1921 "role": "A String", # The primary role for this user. Allowed values are:
1922 # - owner
1923 # - reader
1924 # - writer
1925 "type": "A String", # The account type. Allowed values are:
1926 # - user
1927 # - group
1928 # - domain
1929 # - anyone
1930 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1931 "A String",
1932 ],
1933 "selfLink": "A String", # A link back to this permission.
1934 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001935 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.
1936 "A String",
1937 ],
John Asmuth614db982014-04-24 15:46:26 -04001938 "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.
1939 "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.
1940 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1941 "selfLink": "A String", # A link back to this file.
1942 "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.
1943 }</pre>
1944</div>
1945
1946<div class="method">
1947 <code class="details" id="touch">touch(fileId)</code>
1948 <pre>Set the file's updated time to the current server time.
1949
1950Args:
1951 fileId: string, The ID of the file to update. (required)
1952
1953Returns:
1954 An object of the form:
1955
1956 { # The metadata for a file.
1957 "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.
1958 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001959 "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.
1960 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001961 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04001962 "labels": { # A group of labels for the file.
1963 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1964 "hidden": True or False, # Deprecated.
1965 "viewed": True or False, # Whether this file has been viewed by this user.
1966 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001967 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04001968 },
1969 "indexableText": { # Indexable text attributes for the file (can only be written)
1970 "text": "A String", # The text to be indexed for this file.
1971 },
1972 "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.
1973 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1974 "writersCanShare": True or False, # Whether writers can share the document with other users.
1975 "owners": [ # The owner(s) of this file.
1976 { # The JSON template for a user.
1977 "picture": { # The user's profile picture.
1978 "url": "A String", # A URL that points to a profile picture of this user.
1979 },
1980 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001981 "displayName": "A String", # A plain text displayable name for this user.
1982 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001983 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1984 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001985 },
1986 ],
1987 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001988 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1989 "picture": { # The user's profile picture.
1990 "url": "A String", # A URL that points to a profile picture of this user.
1991 },
1992 "kind": "drive#user", # This is always drive#user.
1993 "displayName": "A String", # A plain text displayable name for this user.
1994 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1995 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1996 "emailAddress": "A String", # The email address of the user.
1997 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001998 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1999 "width": 42, # The width of the video in pixels.
2000 "durationMillis": "A String", # The duration of the video in milliseconds.
2001 "height": 42, # The height of the video in pixels.
2002 },
John Asmuth614db982014-04-24 15:46:26 -04002003 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2004 "picture": { # The user's profile picture.
2005 "url": "A String", # A URL that points to a profile picture of this user.
2006 },
2007 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002008 "displayName": "A String", # A plain text displayable name for this user.
2009 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002010 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2011 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002012 },
2013 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002014 "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 -04002015 "ownerNames": [ # Name(s) of the owner(s) of this file.
2016 "A String",
2017 ],
2018 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2019 "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.
2020 "etag": "A String", # ETag of the file.
2021 "parents": [ # Collection of parent folders which contain this file.
2022 # 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.
2023 { # A reference to a file's parent.
2024 "selfLink": "A String", # A link back to this reference.
2025 "kind": "drive#parentReference", # This is always drive#parentReference.
2026 "id": "A String", # The ID of the parent.
2027 "isRoot": True or False, # Whether or not the parent is the root folder.
2028 "parentLink": "A String", # A link to the parent.
2029 },
2030 ],
2031 "exportLinks": { # Links for exporting Google Docs to specific formats.
2032 "a_key": "A String", # A mapping from export format to URL
2033 },
2034 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002035 "permissions": [ # The list of permissions for users with access to this file.
2036 { # A permission for a file.
2037 "withLink": True or False, # Whether the link is required for this permission.
2038 "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.
2039 "name": "A String", # The name for this permission.
2040 "kind": "drive#permission", # This is always drive#permission.
2041 "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.
2042 "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.
2043 "authKey": "A String", # The authkey parameter required for this permission.
2044 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002045 "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 -07002046 "photoLink": "A String", # A link to the profile photo, if available.
2047 "role": "A String", # The primary role for this user. Allowed values are:
2048 # - owner
2049 # - reader
2050 # - writer
2051 "type": "A String", # The account type. Allowed values are:
2052 # - user
2053 # - group
2054 # - domain
2055 # - anyone
2056 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2057 "A String",
2058 ],
2059 "selfLink": "A String", # A link back to this permission.
2060 },
2061 ],
John Asmuth614db982014-04-24 15:46:26 -04002062 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2063 "mimeType": "A String", # The MIME type of the thumbnail.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002064 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
John Asmuth614db982014-04-24 15:46:26 -04002065 },
2066 "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.
2067 "a_key": "A String",
2068 },
2069 "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.
2070 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2071 "exposureTime": 3.14, # The length of the exposure, in seconds.
2072 "cameraMake": "A String", # The make of the camera used to create the photo.
2073 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2074 "isoSpeed": 42, # The ISO speed used to create the photo.
2075 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2076 "exposureMode": "A String", # The exposure mode used to create the photo.
2077 "colorSpace": "A String", # The color space of the photo.
2078 "location": { # Geographic location information stored in the image.
2079 "latitude": 3.14, # The latitude stored in the image.
2080 "altitude": 3.14, # The altitude stored in the image.
2081 "longitude": 3.14, # The longitude stored in the image.
2082 },
2083 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2084 "height": 42, # The height of the image in pixels.
2085 "lens": "A String", # The lens used to create the photo.
2086 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2087 "width": 42, # The width of the image in pixels.
2088 "meteringMode": "A String", # The metering mode used to create the photo.
2089 "flashUsed": True or False, # Whether a flash was used to create the photo.
2090 "aperture": 3.14, # The aperture used to create the photo (f-number).
2091 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2092 "sensor": "A String", # The type of sensor used to create the photo.
2093 "whiteBalance": "A String", # The white balance mode used to create the photo.
2094 "cameraModel": "A String", # The model of the camera used to create the photo.
2095 },
2096 "description": "A String", # A short description of the file.
2097 "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.
2098 "editable": True or False, # Whether the file can be edited by the current user.
2099 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002100 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002101 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2102 "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 -07002103 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002104 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002105 { # A key-value pair attached to a file that is either public or private to an application.
2106 # The following limits apply to file properties:
2107 # - Maximum of 100 properties total per file
2108 # - Maximum of 30 private properties per app
2109 # - Maximum of 30 public properties
2110 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04002111 "kind": "drive#property", # This is always drive#property.
2112 "value": "A String", # The value of this property.
2113 "etag": "A String", # ETag of the property.
2114 "visibility": "A String", # The visibility of this property.
2115 "key": "A String", # The key of this property.
2116 "selfLink": "A String", # The link back to this property.
2117 },
2118 ],
2119 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2120 "iconLink": "A String", # A link to the file's icon.
2121 "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.
2122 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002123 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002124 "title": "A String", # The title of this file.
2125 "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.
2126 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2127 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2128 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002129 "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 -04002130 "name": "A String", # The name for this permission.
2131 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002132 "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.
2133 "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 -04002134 "authKey": "A String", # The authkey parameter required for this permission.
2135 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002136 "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 -04002137 "photoLink": "A String", # A link to the profile photo, if available.
2138 "role": "A String", # The primary role for this user. Allowed values are:
2139 # - owner
2140 # - reader
2141 # - writer
2142 "type": "A String", # The account type. Allowed values are:
2143 # - user
2144 # - group
2145 # - domain
2146 # - anyone
2147 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2148 "A String",
2149 ],
2150 "selfLink": "A String", # A link back to this permission.
2151 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002152 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.
2153 "A String",
2154 ],
John Asmuth614db982014-04-24 15:46:26 -04002155 "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.
2156 "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.
2157 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2158 "selfLink": "A String", # A link back to this file.
2159 "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.
2160 }</pre>
2161</div>
2162
2163<div class="method">
2164 <code class="details" id="trash">trash(fileId)</code>
2165 <pre>Moves a file to the trash.
2166
2167Args:
2168 fileId: string, The ID of the file to trash. (required)
2169
2170Returns:
2171 An object of the form:
2172
2173 { # The metadata for a file.
2174 "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.
2175 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002176 "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.
2177 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002178 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04002179 "labels": { # A group of labels for the file.
2180 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2181 "hidden": True or False, # Deprecated.
2182 "viewed": True or False, # Whether this file has been viewed by this user.
2183 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002184 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04002185 },
2186 "indexableText": { # Indexable text attributes for the file (can only be written)
2187 "text": "A String", # The text to be indexed for this file.
2188 },
2189 "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.
2190 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2191 "writersCanShare": True or False, # Whether writers can share the document with other users.
2192 "owners": [ # The owner(s) of this file.
2193 { # The JSON template for a user.
2194 "picture": { # The user's profile picture.
2195 "url": "A String", # A URL that points to a profile picture of this user.
2196 },
2197 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002198 "displayName": "A String", # A plain text displayable name for this user.
2199 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002200 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2201 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002202 },
2203 ],
2204 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002205 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2206 "picture": { # The user's profile picture.
2207 "url": "A String", # A URL that points to a profile picture of this user.
2208 },
2209 "kind": "drive#user", # This is always drive#user.
2210 "displayName": "A String", # A plain text displayable name for this user.
2211 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2212 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2213 "emailAddress": "A String", # The email address of the user.
2214 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002215 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2216 "width": 42, # The width of the video in pixels.
2217 "durationMillis": "A String", # The duration of the video in milliseconds.
2218 "height": 42, # The height of the video in pixels.
2219 },
John Asmuth614db982014-04-24 15:46:26 -04002220 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2221 "picture": { # The user's profile picture.
2222 "url": "A String", # A URL that points to a profile picture of this user.
2223 },
2224 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002225 "displayName": "A String", # A plain text displayable name for this user.
2226 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002227 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2228 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002229 },
2230 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002231 "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 -04002232 "ownerNames": [ # Name(s) of the owner(s) of this file.
2233 "A String",
2234 ],
2235 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2236 "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.
2237 "etag": "A String", # ETag of the file.
2238 "parents": [ # Collection of parent folders which contain this file.
2239 # 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.
2240 { # A reference to a file's parent.
2241 "selfLink": "A String", # A link back to this reference.
2242 "kind": "drive#parentReference", # This is always drive#parentReference.
2243 "id": "A String", # The ID of the parent.
2244 "isRoot": True or False, # Whether or not the parent is the root folder.
2245 "parentLink": "A String", # A link to the parent.
2246 },
2247 ],
2248 "exportLinks": { # Links for exporting Google Docs to specific formats.
2249 "a_key": "A String", # A mapping from export format to URL
2250 },
2251 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002252 "permissions": [ # The list of permissions for users with access to this file.
2253 { # A permission for a file.
2254 "withLink": True or False, # Whether the link is required for this permission.
2255 "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.
2256 "name": "A String", # The name for this permission.
2257 "kind": "drive#permission", # This is always drive#permission.
2258 "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.
2259 "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.
2260 "authKey": "A String", # The authkey parameter required for this permission.
2261 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002262 "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 -07002263 "photoLink": "A String", # A link to the profile photo, if available.
2264 "role": "A String", # The primary role for this user. Allowed values are:
2265 # - owner
2266 # - reader
2267 # - writer
2268 "type": "A String", # The account type. Allowed values are:
2269 # - user
2270 # - group
2271 # - domain
2272 # - anyone
2273 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2274 "A String",
2275 ],
2276 "selfLink": "A String", # A link back to this permission.
2277 },
2278 ],
John Asmuth614db982014-04-24 15:46:26 -04002279 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2280 "mimeType": "A String", # The MIME type of the thumbnail.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002281 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
John Asmuth614db982014-04-24 15:46:26 -04002282 },
2283 "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.
2284 "a_key": "A String",
2285 },
2286 "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.
2287 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2288 "exposureTime": 3.14, # The length of the exposure, in seconds.
2289 "cameraMake": "A String", # The make of the camera used to create the photo.
2290 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2291 "isoSpeed": 42, # The ISO speed used to create the photo.
2292 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2293 "exposureMode": "A String", # The exposure mode used to create the photo.
2294 "colorSpace": "A String", # The color space of the photo.
2295 "location": { # Geographic location information stored in the image.
2296 "latitude": 3.14, # The latitude stored in the image.
2297 "altitude": 3.14, # The altitude stored in the image.
2298 "longitude": 3.14, # The longitude stored in the image.
2299 },
2300 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2301 "height": 42, # The height of the image in pixels.
2302 "lens": "A String", # The lens used to create the photo.
2303 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2304 "width": 42, # The width of the image in pixels.
2305 "meteringMode": "A String", # The metering mode used to create the photo.
2306 "flashUsed": True or False, # Whether a flash was used to create the photo.
2307 "aperture": 3.14, # The aperture used to create the photo (f-number).
2308 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2309 "sensor": "A String", # The type of sensor used to create the photo.
2310 "whiteBalance": "A String", # The white balance mode used to create the photo.
2311 "cameraModel": "A String", # The model of the camera used to create the photo.
2312 },
2313 "description": "A String", # A short description of the file.
2314 "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.
2315 "editable": True or False, # Whether the file can be edited by the current user.
2316 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002317 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002318 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2319 "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 -07002320 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002321 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002322 { # A key-value pair attached to a file that is either public or private to an application.
2323 # The following limits apply to file properties:
2324 # - Maximum of 100 properties total per file
2325 # - Maximum of 30 private properties per app
2326 # - Maximum of 30 public properties
2327 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04002328 "kind": "drive#property", # This is always drive#property.
2329 "value": "A String", # The value of this property.
2330 "etag": "A String", # ETag of the property.
2331 "visibility": "A String", # The visibility of this property.
2332 "key": "A String", # The key of this property.
2333 "selfLink": "A String", # The link back to this property.
2334 },
2335 ],
2336 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2337 "iconLink": "A String", # A link to the file's icon.
2338 "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.
2339 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002340 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002341 "title": "A String", # The title of this file.
2342 "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.
2343 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2344 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2345 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002346 "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 -04002347 "name": "A String", # The name for this permission.
2348 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002349 "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.
2350 "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 -04002351 "authKey": "A String", # The authkey parameter required for this permission.
2352 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002353 "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 -04002354 "photoLink": "A String", # A link to the profile photo, if available.
2355 "role": "A String", # The primary role for this user. Allowed values are:
2356 # - owner
2357 # - reader
2358 # - writer
2359 "type": "A String", # The account type. Allowed values are:
2360 # - user
2361 # - group
2362 # - domain
2363 # - anyone
2364 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2365 "A String",
2366 ],
2367 "selfLink": "A String", # A link back to this permission.
2368 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002369 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.
2370 "A String",
2371 ],
John Asmuth614db982014-04-24 15:46:26 -04002372 "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.
2373 "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.
2374 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2375 "selfLink": "A String", # A link back to this file.
2376 "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.
2377 }</pre>
2378</div>
2379
2380<div class="method">
2381 <code class="details" id="untrash">untrash(fileId)</code>
2382 <pre>Restores a file from the trash.
2383
2384Args:
2385 fileId: string, The ID of the file to untrash. (required)
2386
2387Returns:
2388 An object of the form:
2389
2390 { # The metadata for a file.
2391 "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.
2392 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002393 "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.
2394 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002395 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04002396 "labels": { # A group of labels for the file.
2397 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2398 "hidden": True or False, # Deprecated.
2399 "viewed": True or False, # Whether this file has been viewed by this user.
2400 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002401 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04002402 },
2403 "indexableText": { # Indexable text attributes for the file (can only be written)
2404 "text": "A String", # The text to be indexed for this file.
2405 },
2406 "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.
2407 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2408 "writersCanShare": True or False, # Whether writers can share the document with other users.
2409 "owners": [ # The owner(s) of this file.
2410 { # The JSON template for a user.
2411 "picture": { # The user's profile picture.
2412 "url": "A String", # A URL that points to a profile picture of this user.
2413 },
2414 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002415 "displayName": "A String", # A plain text displayable name for this user.
2416 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002417 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2418 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002419 },
2420 ],
2421 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002422 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2423 "picture": { # The user's profile picture.
2424 "url": "A String", # A URL that points to a profile picture of this user.
2425 },
2426 "kind": "drive#user", # This is always drive#user.
2427 "displayName": "A String", # A plain text displayable name for this user.
2428 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2429 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2430 "emailAddress": "A String", # The email address of the user.
2431 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002432 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2433 "width": 42, # The width of the video in pixels.
2434 "durationMillis": "A String", # The duration of the video in milliseconds.
2435 "height": 42, # The height of the video in pixels.
2436 },
John Asmuth614db982014-04-24 15:46:26 -04002437 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2438 "picture": { # The user's profile picture.
2439 "url": "A String", # A URL that points to a profile picture of this user.
2440 },
2441 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002442 "displayName": "A String", # A plain text displayable name for this user.
2443 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002444 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2445 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002446 },
2447 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002448 "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 -04002449 "ownerNames": [ # Name(s) of the owner(s) of this file.
2450 "A String",
2451 ],
2452 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2453 "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.
2454 "etag": "A String", # ETag of the file.
2455 "parents": [ # Collection of parent folders which contain this file.
2456 # 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.
2457 { # A reference to a file's parent.
2458 "selfLink": "A String", # A link back to this reference.
2459 "kind": "drive#parentReference", # This is always drive#parentReference.
2460 "id": "A String", # The ID of the parent.
2461 "isRoot": True or False, # Whether or not the parent is the root folder.
2462 "parentLink": "A String", # A link to the parent.
2463 },
2464 ],
2465 "exportLinks": { # Links for exporting Google Docs to specific formats.
2466 "a_key": "A String", # A mapping from export format to URL
2467 },
2468 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002469 "permissions": [ # The list of permissions for users with access to this file.
2470 { # A permission for a file.
2471 "withLink": True or False, # Whether the link is required for this permission.
2472 "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.
2473 "name": "A String", # The name for this permission.
2474 "kind": "drive#permission", # This is always drive#permission.
2475 "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.
2476 "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.
2477 "authKey": "A String", # The authkey parameter required for this permission.
2478 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002479 "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 -07002480 "photoLink": "A String", # A link to the profile photo, if available.
2481 "role": "A String", # The primary role for this user. Allowed values are:
2482 # - owner
2483 # - reader
2484 # - writer
2485 "type": "A String", # The account type. Allowed values are:
2486 # - user
2487 # - group
2488 # - domain
2489 # - anyone
2490 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2491 "A String",
2492 ],
2493 "selfLink": "A String", # A link back to this permission.
2494 },
2495 ],
John Asmuth614db982014-04-24 15:46:26 -04002496 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2497 "mimeType": "A String", # The MIME type of the thumbnail.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002498 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
John Asmuth614db982014-04-24 15:46:26 -04002499 },
2500 "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.
2501 "a_key": "A String",
2502 },
2503 "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.
2504 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2505 "exposureTime": 3.14, # The length of the exposure, in seconds.
2506 "cameraMake": "A String", # The make of the camera used to create the photo.
2507 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2508 "isoSpeed": 42, # The ISO speed used to create the photo.
2509 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2510 "exposureMode": "A String", # The exposure mode used to create the photo.
2511 "colorSpace": "A String", # The color space of the photo.
2512 "location": { # Geographic location information stored in the image.
2513 "latitude": 3.14, # The latitude stored in the image.
2514 "altitude": 3.14, # The altitude stored in the image.
2515 "longitude": 3.14, # The longitude stored in the image.
2516 },
2517 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2518 "height": 42, # The height of the image in pixels.
2519 "lens": "A String", # The lens used to create the photo.
2520 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2521 "width": 42, # The width of the image in pixels.
2522 "meteringMode": "A String", # The metering mode used to create the photo.
2523 "flashUsed": True or False, # Whether a flash was used to create the photo.
2524 "aperture": 3.14, # The aperture used to create the photo (f-number).
2525 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2526 "sensor": "A String", # The type of sensor used to create the photo.
2527 "whiteBalance": "A String", # The white balance mode used to create the photo.
2528 "cameraModel": "A String", # The model of the camera used to create the photo.
2529 },
2530 "description": "A String", # A short description of the file.
2531 "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.
2532 "editable": True or False, # Whether the file can be edited by the current user.
2533 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002534 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002535 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2536 "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 -07002537 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002538 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002539 { # A key-value pair attached to a file that is either public or private to an application.
2540 # The following limits apply to file properties:
2541 # - Maximum of 100 properties total per file
2542 # - Maximum of 30 private properties per app
2543 # - Maximum of 30 public properties
2544 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04002545 "kind": "drive#property", # This is always drive#property.
2546 "value": "A String", # The value of this property.
2547 "etag": "A String", # ETag of the property.
2548 "visibility": "A String", # The visibility of this property.
2549 "key": "A String", # The key of this property.
2550 "selfLink": "A String", # The link back to this property.
2551 },
2552 ],
2553 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2554 "iconLink": "A String", # A link to the file's icon.
2555 "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.
2556 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002557 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002558 "title": "A String", # The title of this file.
2559 "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.
2560 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2561 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2562 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002563 "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 -04002564 "name": "A String", # The name for this permission.
2565 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002566 "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.
2567 "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 -04002568 "authKey": "A String", # The authkey parameter required for this permission.
2569 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002570 "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 -04002571 "photoLink": "A String", # A link to the profile photo, if available.
2572 "role": "A String", # The primary role for this user. Allowed values are:
2573 # - owner
2574 # - reader
2575 # - writer
2576 "type": "A String", # The account type. Allowed values are:
2577 # - user
2578 # - group
2579 # - domain
2580 # - anyone
2581 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2582 "A String",
2583 ],
2584 "selfLink": "A String", # A link back to this permission.
2585 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002586 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.
2587 "A String",
2588 ],
John Asmuth614db982014-04-24 15:46:26 -04002589 "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.
2590 "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.
2591 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2592 "selfLink": "A String", # A link back to this file.
2593 "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.
2594 }</pre>
2595</div>
2596
2597<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -07002598 <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 -04002599 <pre>Updates file metadata and/or content.
2600
2601Args:
2602 fileId: string, The ID of the file to update. (required)
2603 body: object, The request body.
2604 The object takes the form of:
2605
2606{ # The metadata for a file.
2607 "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.
2608 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002609 "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.
2610 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002611 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04002612 "labels": { # A group of labels for the file.
2613 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2614 "hidden": True or False, # Deprecated.
2615 "viewed": True or False, # Whether this file has been viewed by this user.
2616 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002617 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04002618 },
2619 "indexableText": { # Indexable text attributes for the file (can only be written)
2620 "text": "A String", # The text to be indexed for this file.
2621 },
2622 "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.
2623 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2624 "writersCanShare": True or False, # Whether writers can share the document with other users.
2625 "owners": [ # The owner(s) of this file.
2626 { # The JSON template for a user.
2627 "picture": { # The user's profile picture.
2628 "url": "A String", # A URL that points to a profile picture of this user.
2629 },
2630 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002631 "displayName": "A String", # A plain text displayable name for this user.
2632 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002633 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2634 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002635 },
2636 ],
2637 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002638 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2639 "picture": { # The user's profile picture.
2640 "url": "A String", # A URL that points to a profile picture of this user.
2641 },
2642 "kind": "drive#user", # This is always drive#user.
2643 "displayName": "A String", # A plain text displayable name for this user.
2644 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2645 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2646 "emailAddress": "A String", # The email address of the user.
2647 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002648 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2649 "width": 42, # The width of the video in pixels.
2650 "durationMillis": "A String", # The duration of the video in milliseconds.
2651 "height": 42, # The height of the video in pixels.
2652 },
John Asmuth614db982014-04-24 15:46:26 -04002653 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2654 "picture": { # The user's profile picture.
2655 "url": "A String", # A URL that points to a profile picture of this user.
2656 },
2657 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002658 "displayName": "A String", # A plain text displayable name for this user.
2659 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002660 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2661 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002662 },
2663 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002664 "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 -04002665 "ownerNames": [ # Name(s) of the owner(s) of this file.
2666 "A String",
2667 ],
2668 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2669 "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.
2670 "etag": "A String", # ETag of the file.
2671 "parents": [ # Collection of parent folders which contain this file.
2672 # 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.
2673 { # A reference to a file's parent.
2674 "selfLink": "A String", # A link back to this reference.
2675 "kind": "drive#parentReference", # This is always drive#parentReference.
2676 "id": "A String", # The ID of the parent.
2677 "isRoot": True or False, # Whether or not the parent is the root folder.
2678 "parentLink": "A String", # A link to the parent.
2679 },
2680 ],
2681 "exportLinks": { # Links for exporting Google Docs to specific formats.
2682 "a_key": "A String", # A mapping from export format to URL
2683 },
2684 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002685 "permissions": [ # The list of permissions for users with access to this file.
2686 { # A permission for a file.
2687 "withLink": True or False, # Whether the link is required for this permission.
2688 "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.
2689 "name": "A String", # The name for this permission.
2690 "kind": "drive#permission", # This is always drive#permission.
2691 "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.
2692 "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.
2693 "authKey": "A String", # The authkey parameter required for this permission.
2694 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002695 "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 -07002696 "photoLink": "A String", # A link to the profile photo, if available.
2697 "role": "A String", # The primary role for this user. Allowed values are:
2698 # - owner
2699 # - reader
2700 # - writer
2701 "type": "A String", # The account type. Allowed values are:
2702 # - user
2703 # - group
2704 # - domain
2705 # - anyone
2706 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2707 "A String",
2708 ],
2709 "selfLink": "A String", # A link back to this permission.
2710 },
2711 ],
John Asmuth614db982014-04-24 15:46:26 -04002712 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2713 "mimeType": "A String", # The MIME type of the thumbnail.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002714 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
John Asmuth614db982014-04-24 15:46:26 -04002715 },
2716 "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.
2717 "a_key": "A String",
2718 },
2719 "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.
2720 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2721 "exposureTime": 3.14, # The length of the exposure, in seconds.
2722 "cameraMake": "A String", # The make of the camera used to create the photo.
2723 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2724 "isoSpeed": 42, # The ISO speed used to create the photo.
2725 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2726 "exposureMode": "A String", # The exposure mode used to create the photo.
2727 "colorSpace": "A String", # The color space of the photo.
2728 "location": { # Geographic location information stored in the image.
2729 "latitude": 3.14, # The latitude stored in the image.
2730 "altitude": 3.14, # The altitude stored in the image.
2731 "longitude": 3.14, # The longitude stored in the image.
2732 },
2733 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2734 "height": 42, # The height of the image in pixels.
2735 "lens": "A String", # The lens used to create the photo.
2736 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2737 "width": 42, # The width of the image in pixels.
2738 "meteringMode": "A String", # The metering mode used to create the photo.
2739 "flashUsed": True or False, # Whether a flash was used to create the photo.
2740 "aperture": 3.14, # The aperture used to create the photo (f-number).
2741 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2742 "sensor": "A String", # The type of sensor used to create the photo.
2743 "whiteBalance": "A String", # The white balance mode used to create the photo.
2744 "cameraModel": "A String", # The model of the camera used to create the photo.
2745 },
2746 "description": "A String", # A short description of the file.
2747 "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.
2748 "editable": True or False, # Whether the file can be edited by the current user.
2749 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002750 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002751 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2752 "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 -07002753 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002754 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002755 { # A key-value pair attached to a file that is either public or private to an application.
2756 # The following limits apply to file properties:
2757 # - Maximum of 100 properties total per file
2758 # - Maximum of 30 private properties per app
2759 # - Maximum of 30 public properties
2760 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04002761 "kind": "drive#property", # This is always drive#property.
2762 "value": "A String", # The value of this property.
2763 "etag": "A String", # ETag of the property.
2764 "visibility": "A String", # The visibility of this property.
2765 "key": "A String", # The key of this property.
2766 "selfLink": "A String", # The link back to this property.
2767 },
2768 ],
2769 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2770 "iconLink": "A String", # A link to the file's icon.
2771 "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.
2772 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002773 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002774 "title": "A String", # The title of this file.
2775 "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.
2776 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2777 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2778 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002779 "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 -04002780 "name": "A String", # The name for this permission.
2781 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002782 "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.
2783 "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 -04002784 "authKey": "A String", # The authkey parameter required for this permission.
2785 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002786 "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 -04002787 "photoLink": "A String", # A link to the profile photo, if available.
2788 "role": "A String", # The primary role for this user. Allowed values are:
2789 # - owner
2790 # - reader
2791 # - writer
2792 "type": "A String", # The account type. Allowed values are:
2793 # - user
2794 # - group
2795 # - domain
2796 # - anyone
2797 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2798 "A String",
2799 ],
2800 "selfLink": "A String", # A link back to this permission.
2801 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002802 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.
2803 "A String",
2804 ],
John Asmuth614db982014-04-24 15:46:26 -04002805 "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.
2806 "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.
2807 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2808 "selfLink": "A String", # A link back to this file.
2809 "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.
2810}
2811
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002812 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 unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions.
John Asmuth614db982014-04-24 15:46:26 -04002813 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002814 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
John Asmuth614db982014-04-24 15:46:26 -04002815 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002816 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 -07002817 addParents: string, Comma-separated list of parent IDs to add.
2818 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04002819 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
2820 timedTextTrackName: string, The timed text track name.
2821 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
2822 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
2823 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
2824 timedTextLanguage: string, The language of the timed text.
2825
2826Returns:
2827 An object of the form:
2828
2829 { # The metadata for a file.
2830 "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.
2831 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002832 "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.
2833 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002834 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04002835 "labels": { # A group of labels for the file.
2836 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2837 "hidden": True or False, # Deprecated.
2838 "viewed": True or False, # Whether this file has been viewed by this user.
2839 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002840 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04002841 },
2842 "indexableText": { # Indexable text attributes for the file (can only be written)
2843 "text": "A String", # The text to be indexed for this file.
2844 },
2845 "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.
2846 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2847 "writersCanShare": True or False, # Whether writers can share the document with other users.
2848 "owners": [ # The owner(s) of this file.
2849 { # The JSON template for a user.
2850 "picture": { # The user's profile picture.
2851 "url": "A String", # A URL that points to a profile picture of this user.
2852 },
2853 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002854 "displayName": "A String", # A plain text displayable name for this user.
2855 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002856 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2857 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002858 },
2859 ],
2860 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002861 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2862 "picture": { # The user's profile picture.
2863 "url": "A String", # A URL that points to a profile picture of this user.
2864 },
2865 "kind": "drive#user", # This is always drive#user.
2866 "displayName": "A String", # A plain text displayable name for this user.
2867 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2868 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2869 "emailAddress": "A String", # The email address of the user.
2870 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002871 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2872 "width": 42, # The width of the video in pixels.
2873 "durationMillis": "A String", # The duration of the video in milliseconds.
2874 "height": 42, # The height of the video in pixels.
2875 },
John Asmuth614db982014-04-24 15:46:26 -04002876 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2877 "picture": { # The user's profile picture.
2878 "url": "A String", # A URL that points to a profile picture of this user.
2879 },
2880 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002881 "displayName": "A String", # A plain text displayable name for this user.
2882 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002883 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2884 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002885 },
2886 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002887 "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 -04002888 "ownerNames": [ # Name(s) of the owner(s) of this file.
2889 "A String",
2890 ],
2891 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2892 "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.
2893 "etag": "A String", # ETag of the file.
2894 "parents": [ # Collection of parent folders which contain this file.
2895 # 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.
2896 { # A reference to a file's parent.
2897 "selfLink": "A String", # A link back to this reference.
2898 "kind": "drive#parentReference", # This is always drive#parentReference.
2899 "id": "A String", # The ID of the parent.
2900 "isRoot": True or False, # Whether or not the parent is the root folder.
2901 "parentLink": "A String", # A link to the parent.
2902 },
2903 ],
2904 "exportLinks": { # Links for exporting Google Docs to specific formats.
2905 "a_key": "A String", # A mapping from export format to URL
2906 },
2907 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002908 "permissions": [ # The list of permissions for users with access to this file.
2909 { # A permission for a file.
2910 "withLink": True or False, # Whether the link is required for this permission.
2911 "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.
2912 "name": "A String", # The name for this permission.
2913 "kind": "drive#permission", # This is always drive#permission.
2914 "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.
2915 "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.
2916 "authKey": "A String", # The authkey parameter required for this permission.
2917 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002918 "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 -07002919 "photoLink": "A String", # A link to the profile photo, if available.
2920 "role": "A String", # The primary role for this user. Allowed values are:
2921 # - owner
2922 # - reader
2923 # - writer
2924 "type": "A String", # The account type. Allowed values are:
2925 # - user
2926 # - group
2927 # - domain
2928 # - anyone
2929 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2930 "A String",
2931 ],
2932 "selfLink": "A String", # A link back to this permission.
2933 },
2934 ],
John Asmuth614db982014-04-24 15:46:26 -04002935 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2936 "mimeType": "A String", # The MIME type of the thumbnail.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002937 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
John Asmuth614db982014-04-24 15:46:26 -04002938 },
2939 "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.
2940 "a_key": "A String",
2941 },
2942 "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.
2943 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2944 "exposureTime": 3.14, # The length of the exposure, in seconds.
2945 "cameraMake": "A String", # The make of the camera used to create the photo.
2946 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2947 "isoSpeed": 42, # The ISO speed used to create the photo.
2948 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2949 "exposureMode": "A String", # The exposure mode used to create the photo.
2950 "colorSpace": "A String", # The color space of the photo.
2951 "location": { # Geographic location information stored in the image.
2952 "latitude": 3.14, # The latitude stored in the image.
2953 "altitude": 3.14, # The altitude stored in the image.
2954 "longitude": 3.14, # The longitude stored in the image.
2955 },
2956 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2957 "height": 42, # The height of the image in pixels.
2958 "lens": "A String", # The lens used to create the photo.
2959 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2960 "width": 42, # The width of the image in pixels.
2961 "meteringMode": "A String", # The metering mode used to create the photo.
2962 "flashUsed": True or False, # Whether a flash was used to create the photo.
2963 "aperture": 3.14, # The aperture used to create the photo (f-number).
2964 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2965 "sensor": "A String", # The type of sensor used to create the photo.
2966 "whiteBalance": "A String", # The white balance mode used to create the photo.
2967 "cameraModel": "A String", # The model of the camera used to create the photo.
2968 },
2969 "description": "A String", # A short description of the file.
2970 "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.
2971 "editable": True or False, # Whether the file can be edited by the current user.
2972 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002973 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002974 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2975 "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 -07002976 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002977 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002978 { # A key-value pair attached to a file that is either public or private to an application.
2979 # The following limits apply to file properties:
2980 # - Maximum of 100 properties total per file
2981 # - Maximum of 30 private properties per app
2982 # - Maximum of 30 public properties
2983 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04002984 "kind": "drive#property", # This is always drive#property.
2985 "value": "A String", # The value of this property.
2986 "etag": "A String", # ETag of the property.
2987 "visibility": "A String", # The visibility of this property.
2988 "key": "A String", # The key of this property.
2989 "selfLink": "A String", # The link back to this property.
2990 },
2991 ],
2992 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2993 "iconLink": "A String", # A link to the file's icon.
2994 "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.
2995 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002996 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002997 "title": "A String", # The title of this file.
2998 "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.
2999 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
3000 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
3001 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07003002 "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 -04003003 "name": "A String", # The name for this permission.
3004 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07003005 "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.
3006 "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 -04003007 "authKey": "A String", # The authkey parameter required for this permission.
3008 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08003009 "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 -04003010 "photoLink": "A String", # A link to the profile photo, if available.
3011 "role": "A String", # The primary role for this user. Allowed values are:
3012 # - owner
3013 # - reader
3014 # - writer
3015 "type": "A String", # The account type. Allowed values are:
3016 # - user
3017 # - group
3018 # - domain
3019 # - anyone
3020 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
3021 "A String",
3022 ],
3023 "selfLink": "A String", # A link back to this permission.
3024 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003025 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive' and 'appDataFolder'.
3026 "A String",
3027 ],
John Asmuth614db982014-04-24 15:46:26 -04003028 "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.
3029 "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.
3030 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
3031 "selfLink": "A String", # A link back to this file.
3032 "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.
3033 }</pre>
3034</div>
3035
3036<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003037 <code class="details" id="watch">watch(fileId, body, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04003038 <pre>Subscribe to changes on a file
3039
3040Args:
3041 fileId: string, The ID for the file in question. (required)
3042 body: object, The request body. (required)
3043 The object takes the form of:
3044
3045{ # An notification channel used to watch for resource changes.
3046 "resourceUri": "A String", # A version-specific identifier for the watched resource.
3047 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
3048 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
3049 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
3050 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
3051 "params": { # Additional parameters controlling delivery channel behavior. Optional.
3052 "a_key": "A String", # Declares a new parameter by name.
3053 },
3054 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
3055 "address": "A String", # The address where notifications are delivered for this channel.
3056 "type": "A String", # The type of delivery mechanism used for this channel.
3057 "id": "A String", # A UUID or similar unique string that identifies this channel.
3058 }
3059
3060 projection: string, This parameter is deprecated and has no function.
3061 Allowed values
3062 BASIC - Deprecated
3063 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003064 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -08003065 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
John Asmuth614db982014-04-24 15:46:26 -04003066 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
3067
3068Returns:
3069 An object of the form:
3070
3071 { # An notification channel used to watch for resource changes.
3072 "resourceUri": "A String", # A version-specific identifier for the watched resource.
3073 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
3074 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
3075 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
3076 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
3077 "params": { # Additional parameters controlling delivery channel behavior. Optional.
3078 "a_key": "A String", # Declares a new parameter by name.
3079 },
3080 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
3081 "address": "A String", # The address where notifications are delivered for this channel.
3082 "type": "A String", # The type of delivery mechanism used for this channel.
3083 "id": "A String", # A UUID or similar unique string that identifies this channel.
3084 }</pre>
3085</div>
3086
Craig Citroe633be12015-03-02 13:40:36 -08003087<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003088 <code class="details" id="watch_media">watch_media(fileId, body, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
Craig Citroe633be12015-03-02 13:40:36 -08003089 <pre>Subscribe to changes on a file
3090
3091Args:
3092 fileId: string, The ID for the file in question. (required)
3093 body: object, The request body. (required)
3094 The object takes the form of:
3095
3096{ # An notification channel used to watch for resource changes.
3097 "resourceUri": "A String", # A version-specific identifier for the watched resource.
3098 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
3099 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
3100 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
3101 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
3102 "params": { # Additional parameters controlling delivery channel behavior. Optional.
3103 "a_key": "A String", # Declares a new parameter by name.
3104 },
3105 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
3106 "address": "A String", # The address where notifications are delivered for this channel.
3107 "type": "A String", # The type of delivery mechanism used for this channel.
3108 "id": "A String", # A UUID or similar unique string that identifies this channel.
3109 }
3110
3111 projection: string, This parameter is deprecated and has no function.
3112 Allowed values
3113 BASIC - Deprecated
3114 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003115 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -08003116 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
3117 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
3118
3119Returns:
3120 The media object as a string.
3121
3122 </pre>
3123</div>
3124
John Asmuth614db982014-04-24 15:46:26 -04003125</body></html>