blob: 2ac0001a43ccb38a028fb974edc239fa3e3cba25 [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="drive_v2.html">Drive API</a> . <a href="drive_v2.files.html">files</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#copy">copy(fileId, body, pinned=None, convert=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None)</a></code></p>
79<p class="firstline">Creates a copy of the specified file.</p>
80<p class="toc_element">
81 <code><a href="#delete">delete(fileId)</a></code></p>
82<p class="firstline">Permanently deletes a file by ID. Skips the trash.</p>
83<p class="toc_element">
Craig Citro065b5302014-08-14 00:47:23 -070084 <code><a href="#emptyTrash">emptyTrash()</a></code></p>
85<p class="firstline">Permanently deletes all of the user's trashed files.</p>
86<p class="toc_element">
John Asmuth614db982014-04-24 15:46:26 -040087 <code><a href="#get">get(fileId, projection=None, updateViewedDate=None)</a></code></p>
88<p class="firstline">Gets a file's metadata by ID.</p>
89<p class="toc_element">
90 <code><a href="#insert">insert(body=None, media_body=None, convert=None, useContentAsIndexableText=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None, pinned=None)</a></code></p>
91<p class="firstline">Insert a new file.</p>
92<p class="toc_element">
Craig Citro065b5302014-08-14 00:47:23 -070093 <code><a href="#list">list(q=None, projection=None, pageToken=None, maxResults=None, corpus=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040094<p class="firstline">Lists the user's files.</p>
95<p class="toc_element">
96 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
97<p class="firstline">Retrieves the next page of results.</p>
98<p class="toc_element">
Craig Citro065b5302014-08-14 00:47:23 -070099 <code><a href="#patch">patch(fileId, body, newRevision=None, pinned=None, ocrLanguage=None, ocr=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400100<p class="firstline">Updates file metadata and/or content. This method supports patch semantics.</p>
101<p class="toc_element">
102 <code><a href="#touch">touch(fileId)</a></code></p>
103<p class="firstline">Set the file's updated time to the current server time.</p>
104<p class="toc_element">
105 <code><a href="#trash">trash(fileId)</a></code></p>
106<p class="firstline">Moves a file to the trash.</p>
107<p class="toc_element">
108 <code><a href="#untrash">untrash(fileId)</a></code></p>
109<p class="firstline">Restores a file from the trash.</p>
110<p class="toc_element">
Craig Citro065b5302014-08-14 00:47:23 -0700111 <code><a href="#update">update(fileId, body=None, newRevision=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400112<p class="firstline">Updates file metadata and/or content.</p>
113<p class="toc_element">
114 <code><a href="#watch">watch(fileId, body, projection=None, updateViewedDate=None)</a></code></p>
115<p class="firstline">Subscribe to changes on a file</p>
116<h3>Method Details</h3>
117<div class="method">
118 <code class="details" id="copy">copy(fileId, body, pinned=None, convert=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None)</code>
119 <pre>Creates a copy of the specified file.
120
121Args:
122 fileId: string, The ID of the file to copy. (required)
123 body: object, The request body. (required)
124 The object takes the form of:
125
126{ # The metadata for a file.
127 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
128 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700129 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
130 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400131 "thumbnailLink": "A String", # A link to the file's thumbnail.
132 "labels": { # A group of labels for the file.
133 "restricted": True or False, # Whether viewers are prevented from downloading this file.
134 "hidden": True or False, # Deprecated.
135 "viewed": True or False, # Whether this file has been viewed by this user.
136 "starred": True or False, # Whether this file is starred by the user.
137 "trashed": True or False, # Whether this file has been trashed.
138 },
139 "indexableText": { # Indexable text attributes for the file (can only be written)
140 "text": "A String", # The text to be indexed for this file.
141 },
142 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
143 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
144 "writersCanShare": True or False, # Whether writers can share the document with other users.
145 "owners": [ # The owner(s) of this file.
146 { # The JSON template for a user.
147 "picture": { # The user's profile picture.
148 "url": "A String", # A URL that points to a profile picture of this user.
149 },
150 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400151 "displayName": "A String", # A plain text displayable name for this user.
152 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700153 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
154 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400155 },
156 ],
157 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700158 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
159 "picture": { # The user's profile picture.
160 "url": "A String", # A URL that points to a profile picture of this user.
161 },
162 "kind": "drive#user", # This is always drive#user.
163 "displayName": "A String", # A plain text displayable name for this user.
164 "permissionId": "A String", # The user's ID as visible in the permissions collection.
165 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
166 "emailAddress": "A String", # The email address of the user.
167 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700168 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
169 "width": 42, # The width of the video in pixels.
170 "durationMillis": "A String", # The duration of the video in milliseconds.
171 "height": 42, # The height of the video in pixels.
172 },
John Asmuth614db982014-04-24 15:46:26 -0400173 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
174 "picture": { # The user's profile picture.
175 "url": "A String", # A URL that points to a profile picture of this user.
176 },
177 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400178 "displayName": "A String", # A plain text displayable name for this user.
179 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700180 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
181 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400182 },
183 "copyable": True or False, # Whether the file can be copied by the current user.
184 "ownerNames": [ # Name(s) of the owner(s) of this file.
185 "A String",
186 ],
187 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
188 "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.
189 "etag": "A String", # ETag of the file.
190 "parents": [ # Collection of parent folders which contain this file.
191 # 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.
192 { # A reference to a file's parent.
193 "selfLink": "A String", # A link back to this reference.
194 "kind": "drive#parentReference", # This is always drive#parentReference.
195 "id": "A String", # The ID of the parent.
196 "isRoot": True or False, # Whether or not the parent is the root folder.
197 "parentLink": "A String", # A link to the parent.
198 },
199 ],
200 "exportLinks": { # Links for exporting Google Docs to specific formats.
201 "a_key": "A String", # A mapping from export format to URL
202 },
203 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700204 "permissions": [ # The list of permissions for users with access to this file.
205 { # A permission for a file.
206 "withLink": True or False, # Whether the link is required for this permission.
207 "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.
208 "name": "A String", # The name for this permission.
209 "kind": "drive#permission", # This is always drive#permission.
210 "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.
211 "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.
212 "authKey": "A String", # The authkey parameter required for this permission.
213 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700214 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Craig Citro065b5302014-08-14 00:47:23 -0700215 "photoLink": "A String", # A link to the profile photo, if available.
216 "role": "A String", # The primary role for this user. Allowed values are:
217 # - owner
218 # - reader
219 # - writer
220 "type": "A String", # The account type. Allowed values are:
221 # - user
222 # - group
223 # - domain
224 # - anyone
225 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
226 "A String",
227 ],
228 "selfLink": "A String", # A link back to this permission.
229 },
230 ],
John Asmuth614db982014-04-24 15:46:26 -0400231 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
232 "mimeType": "A String", # The MIME type of the thumbnail.
233 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
234 },
235 "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.
236 "a_key": "A String",
237 },
238 "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.
239 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
240 "exposureTime": 3.14, # The length of the exposure, in seconds.
241 "cameraMake": "A String", # The make of the camera used to create the photo.
242 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
243 "isoSpeed": 42, # The ISO speed used to create the photo.
244 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
245 "exposureMode": "A String", # The exposure mode used to create the photo.
246 "colorSpace": "A String", # The color space of the photo.
247 "location": { # Geographic location information stored in the image.
248 "latitude": 3.14, # The latitude stored in the image.
249 "altitude": 3.14, # The altitude stored in the image.
250 "longitude": 3.14, # The longitude stored in the image.
251 },
252 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
253 "height": 42, # The height of the image in pixels.
254 "lens": "A String", # The lens used to create the photo.
255 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
256 "width": 42, # The width of the image in pixels.
257 "meteringMode": "A String", # The metering mode used to create the photo.
258 "flashUsed": True or False, # Whether a flash was used to create the photo.
259 "aperture": 3.14, # The aperture used to create the photo (f-number).
260 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
261 "sensor": "A String", # The type of sensor used to create the photo.
262 "whiteBalance": "A String", # The white balance mode used to create the photo.
263 "cameraModel": "A String", # The model of the camera used to create the photo.
264 },
265 "description": "A String", # A short description of the file.
266 "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.
267 "editable": True or False, # Whether the file can be edited by the current user.
268 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700269 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400270 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
271 "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 -0700272 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400273 "properties": [ # The list of properties.
274 { # A key-value pair that is either public or private to an application.
275 "kind": "drive#property", # This is always drive#property.
276 "value": "A String", # The value of this property.
277 "etag": "A String", # ETag of the property.
278 "visibility": "A String", # The visibility of this property.
279 "key": "A String", # The key of this property.
280 "selfLink": "A String", # The link back to this property.
281 },
282 ],
283 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
284 "iconLink": "A String", # A link to the file's icon.
285 "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.
286 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700287 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400288 "title": "A String", # The title of this file.
289 "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.
290 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
291 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
292 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700293 "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 -0400294 "name": "A String", # The name for this permission.
295 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700296 "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.
297 "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 -0400298 "authKey": "A String", # The authkey parameter required for this permission.
299 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700300 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
John Asmuth614db982014-04-24 15:46:26 -0400301 "photoLink": "A String", # A link to the profile photo, if available.
302 "role": "A String", # The primary role for this user. Allowed values are:
303 # - owner
304 # - reader
305 # - writer
306 "type": "A String", # The account type. Allowed values are:
307 # - user
308 # - group
309 # - domain
310 # - anyone
311 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
312 "A String",
313 ],
314 "selfLink": "A String", # A link back to this permission.
315 },
316 "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.
317 "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.
318 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
319 "selfLink": "A String", # A link back to this file.
320 "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.
321}
322
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700323 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 -0400324 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
325 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.
326 Allowed values
327 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
328 PRIVATE - The new file will be visible to only the owner.
329 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
330 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
331 timedTextLanguage: string, The language of the timed text.
332 timedTextTrackName: string, The timed text track name.
333
334Returns:
335 An object of the form:
336
337 { # The metadata for a file.
338 "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.
339 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700340 "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.
341 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400342 "thumbnailLink": "A String", # A link to the file's thumbnail.
343 "labels": { # A group of labels for the file.
344 "restricted": True or False, # Whether viewers are prevented from downloading this file.
345 "hidden": True or False, # Deprecated.
346 "viewed": True or False, # Whether this file has been viewed by this user.
347 "starred": True or False, # Whether this file is starred by the user.
348 "trashed": True or False, # Whether this file has been trashed.
349 },
350 "indexableText": { # Indexable text attributes for the file (can only be written)
351 "text": "A String", # The text to be indexed for this file.
352 },
353 "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.
354 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
355 "writersCanShare": True or False, # Whether writers can share the document with other users.
356 "owners": [ # The owner(s) of this file.
357 { # The JSON template for a user.
358 "picture": { # The user's profile picture.
359 "url": "A String", # A URL that points to a profile picture of this user.
360 },
361 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400362 "displayName": "A String", # A plain text displayable name for this user.
363 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700364 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
365 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400366 },
367 ],
368 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700369 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
370 "picture": { # The user's profile picture.
371 "url": "A String", # A URL that points to a profile picture of this user.
372 },
373 "kind": "drive#user", # This is always drive#user.
374 "displayName": "A String", # A plain text displayable name for this user.
375 "permissionId": "A String", # The user's ID as visible in the permissions collection.
376 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
377 "emailAddress": "A String", # The email address of the user.
378 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700379 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
380 "width": 42, # The width of the video in pixels.
381 "durationMillis": "A String", # The duration of the video in milliseconds.
382 "height": 42, # The height of the video in pixels.
383 },
John Asmuth614db982014-04-24 15:46:26 -0400384 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
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.
John Asmuth614db982014-04-24 15:46:26 -0400389 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700391 "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.
John Asmuth614db982014-04-24 15:46:26 -0400393 },
394 "copyable": True or False, # Whether the file can be copied by the current user.
395 "ownerNames": [ # Name(s) of the owner(s) of this file.
396 "A String",
397 ],
398 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
399 "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.
400 "etag": "A String", # ETag of the file.
401 "parents": [ # Collection of parent folders which contain this file.
402 # 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.
403 { # A reference to a file's parent.
404 "selfLink": "A String", # A link back to this reference.
405 "kind": "drive#parentReference", # This is always drive#parentReference.
406 "id": "A String", # The ID of the parent.
407 "isRoot": True or False, # Whether or not the parent is the root folder.
408 "parentLink": "A String", # A link to the parent.
409 },
410 ],
411 "exportLinks": { # Links for exporting Google Docs to specific formats.
412 "a_key": "A String", # A mapping from export format to URL
413 },
414 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700415 "permissions": [ # The list of permissions for users with access to this file.
416 { # A permission for a file.
417 "withLink": True or False, # Whether the link is required for this permission.
418 "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.
419 "name": "A String", # The name for this permission.
420 "kind": "drive#permission", # This is always drive#permission.
421 "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.
422 "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.
423 "authKey": "A String", # The authkey parameter required for this permission.
424 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700425 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Craig Citro065b5302014-08-14 00:47:23 -0700426 "photoLink": "A String", # A link to the profile photo, if available.
427 "role": "A String", # The primary role for this user. Allowed values are:
428 # - owner
429 # - reader
430 # - writer
431 "type": "A String", # The account type. Allowed values are:
432 # - user
433 # - group
434 # - domain
435 # - anyone
436 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
437 "A String",
438 ],
439 "selfLink": "A String", # A link back to this permission.
440 },
441 ],
John Asmuth614db982014-04-24 15:46:26 -0400442 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
443 "mimeType": "A String", # The MIME type of the thumbnail.
444 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
445 },
446 "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.
447 "a_key": "A String",
448 },
449 "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.
450 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
451 "exposureTime": 3.14, # The length of the exposure, in seconds.
452 "cameraMake": "A String", # The make of the camera used to create the photo.
453 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
454 "isoSpeed": 42, # The ISO speed used to create the photo.
455 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
456 "exposureMode": "A String", # The exposure mode used to create the photo.
457 "colorSpace": "A String", # The color space of the photo.
458 "location": { # Geographic location information stored in the image.
459 "latitude": 3.14, # The latitude stored in the image.
460 "altitude": 3.14, # The altitude stored in the image.
461 "longitude": 3.14, # The longitude stored in the image.
462 },
463 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
464 "height": 42, # The height of the image in pixels.
465 "lens": "A String", # The lens used to create the photo.
466 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
467 "width": 42, # The width of the image in pixels.
468 "meteringMode": "A String", # The metering mode used to create the photo.
469 "flashUsed": True or False, # Whether a flash was used to create the photo.
470 "aperture": 3.14, # The aperture used to create the photo (f-number).
471 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
472 "sensor": "A String", # The type of sensor used to create the photo.
473 "whiteBalance": "A String", # The white balance mode used to create the photo.
474 "cameraModel": "A String", # The model of the camera used to create the photo.
475 },
476 "description": "A String", # A short description of the file.
477 "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.
478 "editable": True or False, # Whether the file can be edited by the current user.
479 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700480 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400481 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
482 "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 -0700483 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400484 "properties": [ # The list of properties.
485 { # A key-value pair that is either public or private to an application.
486 "kind": "drive#property", # This is always drive#property.
487 "value": "A String", # The value of this property.
488 "etag": "A String", # ETag of the property.
489 "visibility": "A String", # The visibility of this property.
490 "key": "A String", # The key of this property.
491 "selfLink": "A String", # The link back to this property.
492 },
493 ],
494 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
495 "iconLink": "A String", # A link to the file's icon.
496 "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.
497 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700498 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400499 "title": "A String", # The title of this file.
500 "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.
501 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
502 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
503 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700504 "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 -0400505 "name": "A String", # The name for this permission.
506 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700507 "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.
508 "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 -0400509 "authKey": "A String", # The authkey parameter required for this permission.
510 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700511 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
John Asmuth614db982014-04-24 15:46:26 -0400512 "photoLink": "A String", # A link to the profile photo, if available.
513 "role": "A String", # The primary role for this user. Allowed values are:
514 # - owner
515 # - reader
516 # - writer
517 "type": "A String", # The account type. Allowed values are:
518 # - user
519 # - group
520 # - domain
521 # - anyone
522 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
523 "A String",
524 ],
525 "selfLink": "A String", # A link back to this permission.
526 },
527 "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.
528 "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.
529 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
530 "selfLink": "A String", # A link back to this file.
531 "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.
532 }</pre>
533</div>
534
535<div class="method">
536 <code class="details" id="delete">delete(fileId)</code>
537 <pre>Permanently deletes a file by ID. Skips the trash.
538
539Args:
540 fileId: string, The ID of the file to delete. (required)
541</pre>
542</div>
543
544<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -0700545 <code class="details" id="emptyTrash">emptyTrash()</code>
546 <pre>Permanently deletes all of the user's trashed files.
547
548Args:
549</pre>
550</div>
551
552<div class="method">
John Asmuth614db982014-04-24 15:46:26 -0400553 <code class="details" id="get">get(fileId, projection=None, updateViewedDate=None)</code>
554 <pre>Gets a file's metadata by ID.
555
556Args:
557 fileId: string, The ID for the file in question. (required)
558 projection: string, This parameter is deprecated and has no function.
559 Allowed values
560 BASIC - Deprecated
561 FULL - Deprecated
562 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
563
564Returns:
565 An object of the form:
566
567 { # The metadata for a file.
568 "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.
569 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700570 "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.
571 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400572 "thumbnailLink": "A String", # A link to the file's thumbnail.
573 "labels": { # A group of labels for the file.
574 "restricted": True or False, # Whether viewers are prevented from downloading this file.
575 "hidden": True or False, # Deprecated.
576 "viewed": True or False, # Whether this file has been viewed by this user.
577 "starred": True or False, # Whether this file is starred by the user.
578 "trashed": True or False, # Whether this file has been trashed.
579 },
580 "indexableText": { # Indexable text attributes for the file (can only be written)
581 "text": "A String", # The text to be indexed for this file.
582 },
583 "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.
584 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
585 "writersCanShare": True or False, # Whether writers can share the document with other users.
586 "owners": [ # The owner(s) of this file.
587 { # The JSON template for a user.
588 "picture": { # The user's profile picture.
589 "url": "A String", # A URL that points to a profile picture of this user.
590 },
591 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400592 "displayName": "A String", # A plain text displayable name for this user.
593 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700594 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
595 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400596 },
597 ],
598 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700599 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
600 "picture": { # The user's profile picture.
601 "url": "A String", # A URL that points to a profile picture of this user.
602 },
603 "kind": "drive#user", # This is always drive#user.
604 "displayName": "A String", # A plain text displayable name for this user.
605 "permissionId": "A String", # The user's ID as visible in the permissions collection.
606 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
607 "emailAddress": "A String", # The email address of the user.
608 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700609 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
610 "width": 42, # The width of the video in pixels.
611 "durationMillis": "A String", # The duration of the video in milliseconds.
612 "height": 42, # The height of the video in pixels.
613 },
John Asmuth614db982014-04-24 15:46:26 -0400614 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
615 "picture": { # The user's profile picture.
616 "url": "A String", # A URL that points to a profile picture of this user.
617 },
618 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400619 "displayName": "A String", # A plain text displayable name for this user.
620 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700621 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
622 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400623 },
624 "copyable": True or False, # Whether the file can be copied by the current user.
625 "ownerNames": [ # Name(s) of the owner(s) of this file.
626 "A String",
627 ],
628 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
629 "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.
630 "etag": "A String", # ETag of the file.
631 "parents": [ # Collection of parent folders which contain this file.
632 # 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.
633 { # A reference to a file's parent.
634 "selfLink": "A String", # A link back to this reference.
635 "kind": "drive#parentReference", # This is always drive#parentReference.
636 "id": "A String", # The ID of the parent.
637 "isRoot": True or False, # Whether or not the parent is the root folder.
638 "parentLink": "A String", # A link to the parent.
639 },
640 ],
641 "exportLinks": { # Links for exporting Google Docs to specific formats.
642 "a_key": "A String", # A mapping from export format to URL
643 },
644 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700645 "permissions": [ # The list of permissions for users with access to this file.
646 { # A permission for a file.
647 "withLink": True or False, # Whether the link is required for this permission.
648 "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.
649 "name": "A String", # The name for this permission.
650 "kind": "drive#permission", # This is always drive#permission.
651 "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.
652 "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.
653 "authKey": "A String", # The authkey parameter required for this permission.
654 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700655 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Craig Citro065b5302014-08-14 00:47:23 -0700656 "photoLink": "A String", # A link to the profile photo, if available.
657 "role": "A String", # The primary role for this user. Allowed values are:
658 # - owner
659 # - reader
660 # - writer
661 "type": "A String", # The account type. Allowed values are:
662 # - user
663 # - group
664 # - domain
665 # - anyone
666 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
667 "A String",
668 ],
669 "selfLink": "A String", # A link back to this permission.
670 },
671 ],
John Asmuth614db982014-04-24 15:46:26 -0400672 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
673 "mimeType": "A String", # The MIME type of the thumbnail.
674 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
675 },
676 "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.
677 "a_key": "A String",
678 },
679 "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.
680 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
681 "exposureTime": 3.14, # The length of the exposure, in seconds.
682 "cameraMake": "A String", # The make of the camera used to create the photo.
683 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
684 "isoSpeed": 42, # The ISO speed used to create the photo.
685 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
686 "exposureMode": "A String", # The exposure mode used to create the photo.
687 "colorSpace": "A String", # The color space of the photo.
688 "location": { # Geographic location information stored in the image.
689 "latitude": 3.14, # The latitude stored in the image.
690 "altitude": 3.14, # The altitude stored in the image.
691 "longitude": 3.14, # The longitude stored in the image.
692 },
693 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
694 "height": 42, # The height of the image in pixels.
695 "lens": "A String", # The lens used to create the photo.
696 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
697 "width": 42, # The width of the image in pixels.
698 "meteringMode": "A String", # The metering mode used to create the photo.
699 "flashUsed": True or False, # Whether a flash was used to create the photo.
700 "aperture": 3.14, # The aperture used to create the photo (f-number).
701 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
702 "sensor": "A String", # The type of sensor used to create the photo.
703 "whiteBalance": "A String", # The white balance mode used to create the photo.
704 "cameraModel": "A String", # The model of the camera used to create the photo.
705 },
706 "description": "A String", # A short description of the file.
707 "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.
708 "editable": True or False, # Whether the file can be edited by the current user.
709 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700710 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400711 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
712 "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 -0700713 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400714 "properties": [ # The list of properties.
715 { # A key-value pair that is either public or private to an application.
716 "kind": "drive#property", # This is always drive#property.
717 "value": "A String", # The value of this property.
718 "etag": "A String", # ETag of the property.
719 "visibility": "A String", # The visibility of this property.
720 "key": "A String", # The key of this property.
721 "selfLink": "A String", # The link back to this property.
722 },
723 ],
724 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
725 "iconLink": "A String", # A link to the file's icon.
726 "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.
727 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700728 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400729 "title": "A String", # The title of this file.
730 "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.
731 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
732 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
733 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700734 "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 -0400735 "name": "A String", # The name for this permission.
736 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700737 "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.
738 "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 -0400739 "authKey": "A String", # The authkey parameter required for this permission.
740 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700741 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
John Asmuth614db982014-04-24 15:46:26 -0400742 "photoLink": "A String", # A link to the profile photo, if available.
743 "role": "A String", # The primary role for this user. Allowed values are:
744 # - owner
745 # - reader
746 # - writer
747 "type": "A String", # The account type. Allowed values are:
748 # - user
749 # - group
750 # - domain
751 # - anyone
752 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
753 "A String",
754 ],
755 "selfLink": "A String", # A link back to this permission.
756 },
757 "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.
758 "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.
759 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
760 "selfLink": "A String", # A link back to this file.
761 "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.
762 }</pre>
763</div>
764
765<div class="method">
766 <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>
767 <pre>Insert a new file.
768
769Args:
770 body: object, The request body.
771 The object takes the form of:
772
773{ # The metadata for a file.
774 "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.
775 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700776 "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.
777 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400778 "thumbnailLink": "A String", # A link to the file's thumbnail.
779 "labels": { # A group of labels for the file.
780 "restricted": True or False, # Whether viewers are prevented from downloading this file.
781 "hidden": True or False, # Deprecated.
782 "viewed": True or False, # Whether this file has been viewed by this user.
783 "starred": True or False, # Whether this file is starred by the user.
784 "trashed": True or False, # Whether this file has been trashed.
785 },
786 "indexableText": { # Indexable text attributes for the file (can only be written)
787 "text": "A String", # The text to be indexed for this file.
788 },
789 "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.
790 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
791 "writersCanShare": True or False, # Whether writers can share the document with other users.
792 "owners": [ # The owner(s) of this file.
793 { # The JSON template for a user.
794 "picture": { # The user's profile picture.
795 "url": "A String", # A URL that points to a profile picture of this user.
796 },
797 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400798 "displayName": "A String", # A plain text displayable name for this user.
799 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700800 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
801 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400802 },
803 ],
804 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700805 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
806 "picture": { # The user's profile picture.
807 "url": "A String", # A URL that points to a profile picture of this user.
808 },
809 "kind": "drive#user", # This is always drive#user.
810 "displayName": "A String", # A plain text displayable name for this user.
811 "permissionId": "A String", # The user's ID as visible in the permissions collection.
812 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
813 "emailAddress": "A String", # The email address of the user.
814 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700815 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
816 "width": 42, # The width of the video in pixels.
817 "durationMillis": "A String", # The duration of the video in milliseconds.
818 "height": 42, # The height of the video in pixels.
819 },
John Asmuth614db982014-04-24 15:46:26 -0400820 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
821 "picture": { # The user's profile picture.
822 "url": "A String", # A URL that points to a profile picture of this user.
823 },
824 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400825 "displayName": "A String", # A plain text displayable name for this user.
826 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700827 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
828 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400829 },
830 "copyable": True or False, # Whether the file can be copied by the current user.
831 "ownerNames": [ # Name(s) of the owner(s) of this file.
832 "A String",
833 ],
834 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
835 "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.
836 "etag": "A String", # ETag of the file.
837 "parents": [ # Collection of parent folders which contain this file.
838 # 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.
839 { # A reference to a file's parent.
840 "selfLink": "A String", # A link back to this reference.
841 "kind": "drive#parentReference", # This is always drive#parentReference.
842 "id": "A String", # The ID of the parent.
843 "isRoot": True or False, # Whether or not the parent is the root folder.
844 "parentLink": "A String", # A link to the parent.
845 },
846 ],
847 "exportLinks": { # Links for exporting Google Docs to specific formats.
848 "a_key": "A String", # A mapping from export format to URL
849 },
850 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700851 "permissions": [ # The list of permissions for users with access to this file.
852 { # A permission for a file.
853 "withLink": True or False, # Whether the link is required for this permission.
854 "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.
855 "name": "A String", # The name for this permission.
856 "kind": "drive#permission", # This is always drive#permission.
857 "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.
858 "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.
859 "authKey": "A String", # The authkey parameter required for this permission.
860 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700861 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Craig Citro065b5302014-08-14 00:47:23 -0700862 "photoLink": "A String", # A link to the profile photo, if available.
863 "role": "A String", # The primary role for this user. Allowed values are:
864 # - owner
865 # - reader
866 # - writer
867 "type": "A String", # The account type. Allowed values are:
868 # - user
869 # - group
870 # - domain
871 # - anyone
872 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
873 "A String",
874 ],
875 "selfLink": "A String", # A link back to this permission.
876 },
877 ],
John Asmuth614db982014-04-24 15:46:26 -0400878 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
879 "mimeType": "A String", # The MIME type of the thumbnail.
880 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
881 },
882 "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.
883 "a_key": "A String",
884 },
885 "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.
886 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
887 "exposureTime": 3.14, # The length of the exposure, in seconds.
888 "cameraMake": "A String", # The make of the camera used to create the photo.
889 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
890 "isoSpeed": 42, # The ISO speed used to create the photo.
891 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
892 "exposureMode": "A String", # The exposure mode used to create the photo.
893 "colorSpace": "A String", # The color space of the photo.
894 "location": { # Geographic location information stored in the image.
895 "latitude": 3.14, # The latitude stored in the image.
896 "altitude": 3.14, # The altitude stored in the image.
897 "longitude": 3.14, # The longitude stored in the image.
898 },
899 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
900 "height": 42, # The height of the image in pixels.
901 "lens": "A String", # The lens used to create the photo.
902 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
903 "width": 42, # The width of the image in pixels.
904 "meteringMode": "A String", # The metering mode used to create the photo.
905 "flashUsed": True or False, # Whether a flash was used to create the photo.
906 "aperture": 3.14, # The aperture used to create the photo (f-number).
907 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
908 "sensor": "A String", # The type of sensor used to create the photo.
909 "whiteBalance": "A String", # The white balance mode used to create the photo.
910 "cameraModel": "A String", # The model of the camera used to create the photo.
911 },
912 "description": "A String", # A short description of the file.
913 "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.
914 "editable": True or False, # Whether the file can be edited by the current user.
915 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -0700916 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400917 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
918 "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 -0700919 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400920 "properties": [ # The list of properties.
921 { # A key-value pair that is either public or private to an application.
922 "kind": "drive#property", # This is always drive#property.
923 "value": "A String", # The value of this property.
924 "etag": "A String", # ETag of the property.
925 "visibility": "A String", # The visibility of this property.
926 "key": "A String", # The key of this property.
927 "selfLink": "A String", # The link back to this property.
928 },
929 ],
930 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
931 "iconLink": "A String", # A link to the file's icon.
932 "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.
933 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700934 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400935 "title": "A String", # The title of this file.
936 "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.
937 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
938 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
939 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700940 "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 -0400941 "name": "A String", # The name for this permission.
942 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700943 "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.
944 "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 -0400945 "authKey": "A String", # The authkey parameter required for this permission.
946 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700947 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
John Asmuth614db982014-04-24 15:46:26 -0400948 "photoLink": "A String", # A link to the profile photo, if available.
949 "role": "A String", # The primary role for this user. Allowed values are:
950 # - owner
951 # - reader
952 # - writer
953 "type": "A String", # The account type. Allowed values are:
954 # - user
955 # - group
956 # - domain
957 # - anyone
958 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
959 "A String",
960 ],
961 "selfLink": "A String", # A link back to this permission.
962 },
963 "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.
964 "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.
965 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
966 "selfLink": "A String", # A link back to this file.
967 "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.
968}
969
970 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
971 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
972 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
973 visibility: string, The visibility of the new file. This parameter is only relevant when convert=false.
974 Allowed values
975 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
976 PRIVATE - The new file will be visible to only the owner.
977 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
978 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
979 timedTextLanguage: string, The language of the timed text.
980 timedTextTrackName: string, The timed text track name.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700981 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 -0400982
983Returns:
984 An object of the form:
985
986 { # The metadata for a file.
987 "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.
988 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700989 "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.
990 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -0400991 "thumbnailLink": "A String", # A link to the file's thumbnail.
992 "labels": { # A group of labels for the file.
993 "restricted": True or False, # Whether viewers are prevented from downloading this file.
994 "hidden": True or False, # Deprecated.
995 "viewed": True or False, # Whether this file has been viewed by this user.
996 "starred": True or False, # Whether this file is starred by the user.
997 "trashed": True or False, # Whether this file has been trashed.
998 },
999 "indexableText": { # Indexable text attributes for the file (can only be written)
1000 "text": "A String", # The text to be indexed for this file.
1001 },
1002 "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.
1003 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1004 "writersCanShare": True or False, # Whether writers can share the document with other users.
1005 "owners": [ # The owner(s) of this file.
1006 { # The JSON template for a user.
1007 "picture": { # The user's profile picture.
1008 "url": "A String", # A URL that points to a profile picture of this user.
1009 },
1010 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001011 "displayName": "A String", # A plain text displayable name for this user.
1012 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001013 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1014 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001015 },
1016 ],
1017 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001018 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1019 "picture": { # The user's profile picture.
1020 "url": "A String", # A URL that points to a profile picture of this user.
1021 },
1022 "kind": "drive#user", # This is always drive#user.
1023 "displayName": "A String", # A plain text displayable name for this user.
1024 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1025 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1026 "emailAddress": "A String", # The email address of the user.
1027 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001028 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1029 "width": 42, # The width of the video in pixels.
1030 "durationMillis": "A String", # The duration of the video in milliseconds.
1031 "height": 42, # The height of the video in pixels.
1032 },
John Asmuth614db982014-04-24 15:46:26 -04001033 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1034 "picture": { # The user's profile picture.
1035 "url": "A String", # A URL that points to a profile picture of this user.
1036 },
1037 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001038 "displayName": "A String", # A plain text displayable name for this user.
1039 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001040 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1041 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001042 },
1043 "copyable": True or False, # Whether the file can be copied by the current user.
1044 "ownerNames": [ # Name(s) of the owner(s) of this file.
1045 "A String",
1046 ],
1047 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1048 "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.
1049 "etag": "A String", # ETag of the file.
1050 "parents": [ # Collection of parent folders which contain this file.
1051 # 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.
1052 { # A reference to a file's parent.
1053 "selfLink": "A String", # A link back to this reference.
1054 "kind": "drive#parentReference", # This is always drive#parentReference.
1055 "id": "A String", # The ID of the parent.
1056 "isRoot": True or False, # Whether or not the parent is the root folder.
1057 "parentLink": "A String", # A link to the parent.
1058 },
1059 ],
1060 "exportLinks": { # Links for exporting Google Docs to specific formats.
1061 "a_key": "A String", # A mapping from export format to URL
1062 },
1063 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001064 "permissions": [ # The list of permissions for users with access to this file.
1065 { # A permission for a file.
1066 "withLink": True or False, # Whether the link is required for this permission.
1067 "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.
1068 "name": "A String", # The name for this permission.
1069 "kind": "drive#permission", # This is always drive#permission.
1070 "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.
1071 "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.
1072 "authKey": "A String", # The authkey parameter required for this permission.
1073 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001074 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Craig Citro065b5302014-08-14 00:47:23 -07001075 "photoLink": "A String", # A link to the profile photo, if available.
1076 "role": "A String", # The primary role for this user. Allowed values are:
1077 # - owner
1078 # - reader
1079 # - writer
1080 "type": "A String", # The account type. Allowed values are:
1081 # - user
1082 # - group
1083 # - domain
1084 # - anyone
1085 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1086 "A String",
1087 ],
1088 "selfLink": "A String", # A link back to this permission.
1089 },
1090 ],
John Asmuth614db982014-04-24 15:46:26 -04001091 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1092 "mimeType": "A String", # The MIME type of the thumbnail.
1093 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1094 },
1095 "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.
1096 "a_key": "A String",
1097 },
1098 "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.
1099 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1100 "exposureTime": 3.14, # The length of the exposure, in seconds.
1101 "cameraMake": "A String", # The make of the camera used to create the photo.
1102 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1103 "isoSpeed": 42, # The ISO speed used to create the photo.
1104 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1105 "exposureMode": "A String", # The exposure mode used to create the photo.
1106 "colorSpace": "A String", # The color space of the photo.
1107 "location": { # Geographic location information stored in the image.
1108 "latitude": 3.14, # The latitude stored in the image.
1109 "altitude": 3.14, # The altitude stored in the image.
1110 "longitude": 3.14, # The longitude stored in the image.
1111 },
1112 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1113 "height": 42, # The height of the image in pixels.
1114 "lens": "A String", # The lens used to create the photo.
1115 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1116 "width": 42, # The width of the image in pixels.
1117 "meteringMode": "A String", # The metering mode used to create the photo.
1118 "flashUsed": True or False, # Whether a flash was used to create the photo.
1119 "aperture": 3.14, # The aperture used to create the photo (f-number).
1120 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1121 "sensor": "A String", # The type of sensor used to create the photo.
1122 "whiteBalance": "A String", # The white balance mode used to create the photo.
1123 "cameraModel": "A String", # The model of the camera used to create the photo.
1124 },
1125 "description": "A String", # A short description of the file.
1126 "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.
1127 "editable": True or False, # Whether the file can be edited by the current user.
1128 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001129 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001130 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1131 "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 -07001132 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001133 "properties": [ # The list of properties.
1134 { # A key-value pair that is either public or private to an application.
1135 "kind": "drive#property", # This is always drive#property.
1136 "value": "A String", # The value of this property.
1137 "etag": "A String", # ETag of the property.
1138 "visibility": "A String", # The visibility of this property.
1139 "key": "A String", # The key of this property.
1140 "selfLink": "A String", # The link back to this property.
1141 },
1142 ],
1143 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1144 "iconLink": "A String", # A link to the file's icon.
1145 "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.
1146 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001147 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001148 "title": "A String", # The title of this file.
1149 "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.
1150 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1151 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1152 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001153 "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 -04001154 "name": "A String", # The name for this permission.
1155 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001156 "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.
1157 "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 -04001158 "authKey": "A String", # The authkey parameter required for this permission.
1159 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001160 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
John Asmuth614db982014-04-24 15:46:26 -04001161 "photoLink": "A String", # A link to the profile photo, if available.
1162 "role": "A String", # The primary role for this user. Allowed values are:
1163 # - owner
1164 # - reader
1165 # - writer
1166 "type": "A String", # The account type. Allowed values are:
1167 # - user
1168 # - group
1169 # - domain
1170 # - anyone
1171 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1172 "A String",
1173 ],
1174 "selfLink": "A String", # A link back to this permission.
1175 },
1176 "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.
1177 "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.
1178 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1179 "selfLink": "A String", # A link back to this file.
1180 "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.
1181 }</pre>
1182</div>
1183
1184<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -07001185 <code class="details" id="list">list(q=None, projection=None, pageToken=None, maxResults=None, corpus=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04001186 <pre>Lists the user's files.
1187
1188Args:
1189 q: string, Query string for searching files.
1190 projection: string, This parameter is deprecated and has no function.
1191 Allowed values
1192 BASIC - Deprecated
1193 FULL - Deprecated
1194 pageToken: string, Page token for files.
1195 maxResults: integer, Maximum number of files to return.
Craig Citro065b5302014-08-14 00:47:23 -07001196 corpus: string, The body of items (files/documents) to which the query applies.
1197 Allowed values
1198 DEFAULT - The items that the user has accessed.
1199 DOMAIN - Items shared to the user's domain.
John Asmuth614db982014-04-24 15:46:26 -04001200
1201Returns:
1202 An object of the form:
1203
1204 { # A list of files.
1205 "nextPageToken": "A String", # The page token for the next page of files.
1206 "kind": "drive#fileList", # This is always drive#fileList.
1207 "items": [ # The actual list of files.
1208 { # The metadata for a file.
1209 "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.
1210 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001211 "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.
1212 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04001213 "thumbnailLink": "A String", # A link to the file's thumbnail.
1214 "labels": { # A group of labels for the file.
1215 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1216 "hidden": True or False, # Deprecated.
1217 "viewed": True or False, # Whether this file has been viewed by this user.
1218 "starred": True or False, # Whether this file is starred by the user.
1219 "trashed": True or False, # Whether this file has been trashed.
1220 },
1221 "indexableText": { # Indexable text attributes for the file (can only be written)
1222 "text": "A String", # The text to be indexed for this file.
1223 },
1224 "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.
1225 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1226 "writersCanShare": True or False, # Whether writers can share the document with other users.
1227 "owners": [ # The owner(s) of this file.
1228 { # The JSON template for a user.
1229 "picture": { # The user's profile picture.
1230 "url": "A String", # A URL that points to a profile picture of this user.
1231 },
1232 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001233 "displayName": "A String", # A plain text displayable name for this user.
1234 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001235 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1236 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001237 },
1238 ],
1239 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001240 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1241 "picture": { # The user's profile picture.
1242 "url": "A String", # A URL that points to a profile picture of this user.
1243 },
1244 "kind": "drive#user", # This is always drive#user.
1245 "displayName": "A String", # A plain text displayable name for this user.
1246 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1247 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1248 "emailAddress": "A String", # The email address of the user.
1249 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001250 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1251 "width": 42, # The width of the video in pixels.
1252 "durationMillis": "A String", # The duration of the video in milliseconds.
1253 "height": 42, # The height of the video in pixels.
1254 },
John Asmuth614db982014-04-24 15:46:26 -04001255 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1256 "picture": { # The user's profile picture.
1257 "url": "A String", # A URL that points to a profile picture of this user.
1258 },
1259 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001260 "displayName": "A String", # A plain text displayable name for this user.
1261 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001262 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1263 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001264 },
1265 "copyable": True or False, # Whether the file can be copied by the current user.
1266 "ownerNames": [ # Name(s) of the owner(s) of this file.
1267 "A String",
1268 ],
1269 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1270 "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.
1271 "etag": "A String", # ETag of the file.
1272 "parents": [ # Collection of parent folders which contain this file.
1273 # 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.
1274 { # A reference to a file's parent.
1275 "selfLink": "A String", # A link back to this reference.
1276 "kind": "drive#parentReference", # This is always drive#parentReference.
1277 "id": "A String", # The ID of the parent.
1278 "isRoot": True or False, # Whether or not the parent is the root folder.
1279 "parentLink": "A String", # A link to the parent.
1280 },
1281 ],
1282 "exportLinks": { # Links for exporting Google Docs to specific formats.
1283 "a_key": "A String", # A mapping from export format to URL
1284 },
1285 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001286 "permissions": [ # The list of permissions for users with access to this file.
1287 { # A permission for a file.
1288 "withLink": True or False, # Whether the link is required for this permission.
1289 "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.
1290 "name": "A String", # The name for this permission.
1291 "kind": "drive#permission", # This is always drive#permission.
1292 "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.
1293 "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.
1294 "authKey": "A String", # The authkey parameter required for this permission.
1295 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001296 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Craig Citro065b5302014-08-14 00:47:23 -07001297 "photoLink": "A String", # A link to the profile photo, if available.
1298 "role": "A String", # The primary role for this user. Allowed values are:
1299 # - owner
1300 # - reader
1301 # - writer
1302 "type": "A String", # The account type. Allowed values are:
1303 # - user
1304 # - group
1305 # - domain
1306 # - anyone
1307 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1308 "A String",
1309 ],
1310 "selfLink": "A String", # A link back to this permission.
1311 },
1312 ],
John Asmuth614db982014-04-24 15:46:26 -04001313 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1314 "mimeType": "A String", # The MIME type of the thumbnail.
1315 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1316 },
1317 "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.
1318 "a_key": "A String",
1319 },
1320 "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.
1321 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1322 "exposureTime": 3.14, # The length of the exposure, in seconds.
1323 "cameraMake": "A String", # The make of the camera used to create the photo.
1324 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1325 "isoSpeed": 42, # The ISO speed used to create the photo.
1326 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1327 "exposureMode": "A String", # The exposure mode used to create the photo.
1328 "colorSpace": "A String", # The color space of the photo.
1329 "location": { # Geographic location information stored in the image.
1330 "latitude": 3.14, # The latitude stored in the image.
1331 "altitude": 3.14, # The altitude stored in the image.
1332 "longitude": 3.14, # The longitude stored in the image.
1333 },
1334 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1335 "height": 42, # The height of the image in pixels.
1336 "lens": "A String", # The lens used to create the photo.
1337 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1338 "width": 42, # The width of the image in pixels.
1339 "meteringMode": "A String", # The metering mode used to create the photo.
1340 "flashUsed": True or False, # Whether a flash was used to create the photo.
1341 "aperture": 3.14, # The aperture used to create the photo (f-number).
1342 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1343 "sensor": "A String", # The type of sensor used to create the photo.
1344 "whiteBalance": "A String", # The white balance mode used to create the photo.
1345 "cameraModel": "A String", # The model of the camera used to create the photo.
1346 },
1347 "description": "A String", # A short description of the file.
1348 "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.
1349 "editable": True or False, # Whether the file can be edited by the current user.
1350 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001351 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001352 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1353 "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 -07001354 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001355 "properties": [ # The list of properties.
1356 { # A key-value pair that is either public or private to an application.
1357 "kind": "drive#property", # This is always drive#property.
1358 "value": "A String", # The value of this property.
1359 "etag": "A String", # ETag of the property.
1360 "visibility": "A String", # The visibility of this property.
1361 "key": "A String", # The key of this property.
1362 "selfLink": "A String", # The link back to this property.
1363 },
1364 ],
1365 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1366 "iconLink": "A String", # A link to the file's icon.
1367 "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.
1368 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001369 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001370 "title": "A String", # The title of this file.
1371 "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.
1372 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1373 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1374 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001375 "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 -04001376 "name": "A String", # The name for this permission.
1377 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001378 "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.
1379 "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 -04001380 "authKey": "A String", # The authkey parameter required for this permission.
1381 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001382 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
John Asmuth614db982014-04-24 15:46:26 -04001383 "photoLink": "A String", # A link to the profile photo, if available.
1384 "role": "A String", # The primary role for this user. Allowed values are:
1385 # - owner
1386 # - reader
1387 # - writer
1388 "type": "A String", # The account type. Allowed values are:
1389 # - user
1390 # - group
1391 # - domain
1392 # - anyone
1393 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1394 "A String",
1395 ],
1396 "selfLink": "A String", # A link back to this permission.
1397 },
1398 "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.
1399 "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.
1400 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1401 "selfLink": "A String", # A link back to this file.
1402 "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.
1403 },
1404 ],
1405 "nextLink": "A String", # A link to the next page of files.
1406 "etag": "A String", # The ETag of the list.
1407 "selfLink": "A String", # A link back to this list.
1408 }</pre>
1409</div>
1410
1411<div class="method">
1412 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1413 <pre>Retrieves the next page of results.
1414
1415Args:
1416 previous_request: The request for the previous page. (required)
1417 previous_response: The response from the request for the previous page. (required)
1418
1419Returns:
1420 A request object that you can call 'execute()' on to request the next
1421 page. Returns None if there are no more items in the collection.
1422 </pre>
1423</div>
1424
1425<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -07001426 <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 -04001427 <pre>Updates file metadata and/or content. This method supports patch semantics.
1428
1429Args:
1430 fileId: string, The ID of the file to update. (required)
1431 body: object, The request body. (required)
1432 The object takes the form of:
1433
1434{ # The metadata for a file.
1435 "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.
1436 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001437 "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.
1438 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04001439 "thumbnailLink": "A String", # A link to the file's thumbnail.
1440 "labels": { # A group of labels for the file.
1441 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1442 "hidden": True or False, # Deprecated.
1443 "viewed": True or False, # Whether this file has been viewed by this user.
1444 "starred": True or False, # Whether this file is starred by the user.
1445 "trashed": True or False, # Whether this file has been trashed.
1446 },
1447 "indexableText": { # Indexable text attributes for the file (can only be written)
1448 "text": "A String", # The text to be indexed for this file.
1449 },
1450 "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.
1451 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1452 "writersCanShare": True or False, # Whether writers can share the document with other users.
1453 "owners": [ # The owner(s) of this file.
1454 { # The JSON template for a user.
1455 "picture": { # The user's profile picture.
1456 "url": "A String", # A URL that points to a profile picture of this user.
1457 },
1458 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001459 "displayName": "A String", # A plain text displayable name for this user.
1460 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001461 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1462 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001463 },
1464 ],
1465 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001466 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1467 "picture": { # The user's profile picture.
1468 "url": "A String", # A URL that points to a profile picture of this user.
1469 },
1470 "kind": "drive#user", # This is always drive#user.
1471 "displayName": "A String", # A plain text displayable name for this user.
1472 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1473 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1474 "emailAddress": "A String", # The email address of the user.
1475 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001476 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1477 "width": 42, # The width of the video in pixels.
1478 "durationMillis": "A String", # The duration of the video in milliseconds.
1479 "height": 42, # The height of the video in pixels.
1480 },
John Asmuth614db982014-04-24 15:46:26 -04001481 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1482 "picture": { # The user's profile picture.
1483 "url": "A String", # A URL that points to a profile picture of this user.
1484 },
1485 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001486 "displayName": "A String", # A plain text displayable name for this user.
1487 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001488 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1489 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001490 },
1491 "copyable": True or False, # Whether the file can be copied by the current user.
1492 "ownerNames": [ # Name(s) of the owner(s) of this file.
1493 "A String",
1494 ],
1495 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1496 "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.
1497 "etag": "A String", # ETag of the file.
1498 "parents": [ # Collection of parent folders which contain this file.
1499 # 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.
1500 { # A reference to a file's parent.
1501 "selfLink": "A String", # A link back to this reference.
1502 "kind": "drive#parentReference", # This is always drive#parentReference.
1503 "id": "A String", # The ID of the parent.
1504 "isRoot": True or False, # Whether or not the parent is the root folder.
1505 "parentLink": "A String", # A link to the parent.
1506 },
1507 ],
1508 "exportLinks": { # Links for exporting Google Docs to specific formats.
1509 "a_key": "A String", # A mapping from export format to URL
1510 },
1511 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001512 "permissions": [ # The list of permissions for users with access to this file.
1513 { # A permission for a file.
1514 "withLink": True or False, # Whether the link is required for this permission.
1515 "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.
1516 "name": "A String", # The name for this permission.
1517 "kind": "drive#permission", # This is always drive#permission.
1518 "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.
1519 "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.
1520 "authKey": "A String", # The authkey parameter required for this permission.
1521 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001522 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Craig Citro065b5302014-08-14 00:47:23 -07001523 "photoLink": "A String", # A link to the profile photo, if available.
1524 "role": "A String", # The primary role for this user. Allowed values are:
1525 # - owner
1526 # - reader
1527 # - writer
1528 "type": "A String", # The account type. Allowed values are:
1529 # - user
1530 # - group
1531 # - domain
1532 # - anyone
1533 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1534 "A String",
1535 ],
1536 "selfLink": "A String", # A link back to this permission.
1537 },
1538 ],
John Asmuth614db982014-04-24 15:46:26 -04001539 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1540 "mimeType": "A String", # The MIME type of the thumbnail.
1541 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1542 },
1543 "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.
1544 "a_key": "A String",
1545 },
1546 "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.
1547 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1548 "exposureTime": 3.14, # The length of the exposure, in seconds.
1549 "cameraMake": "A String", # The make of the camera used to create the photo.
1550 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1551 "isoSpeed": 42, # The ISO speed used to create the photo.
1552 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1553 "exposureMode": "A String", # The exposure mode used to create the photo.
1554 "colorSpace": "A String", # The color space of the photo.
1555 "location": { # Geographic location information stored in the image.
1556 "latitude": 3.14, # The latitude stored in the image.
1557 "altitude": 3.14, # The altitude stored in the image.
1558 "longitude": 3.14, # The longitude stored in the image.
1559 },
1560 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1561 "height": 42, # The height of the image in pixels.
1562 "lens": "A String", # The lens used to create the photo.
1563 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1564 "width": 42, # The width of the image in pixels.
1565 "meteringMode": "A String", # The metering mode used to create the photo.
1566 "flashUsed": True or False, # Whether a flash was used to create the photo.
1567 "aperture": 3.14, # The aperture used to create the photo (f-number).
1568 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1569 "sensor": "A String", # The type of sensor used to create the photo.
1570 "whiteBalance": "A String", # The white balance mode used to create the photo.
1571 "cameraModel": "A String", # The model of the camera used to create the photo.
1572 },
1573 "description": "A String", # A short description of the file.
1574 "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.
1575 "editable": True or False, # Whether the file can be edited by the current user.
1576 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001577 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001578 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1579 "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 -07001580 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001581 "properties": [ # The list of properties.
1582 { # A key-value pair that is either public or private to an application.
1583 "kind": "drive#property", # This is always drive#property.
1584 "value": "A String", # The value of this property.
1585 "etag": "A String", # ETag of the property.
1586 "visibility": "A String", # The visibility of this property.
1587 "key": "A String", # The key of this property.
1588 "selfLink": "A String", # The link back to this property.
1589 },
1590 ],
1591 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1592 "iconLink": "A String", # A link to the file's icon.
1593 "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.
1594 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001595 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001596 "title": "A String", # The title of this file.
1597 "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.
1598 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1599 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1600 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001601 "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 -04001602 "name": "A String", # The name for this permission.
1603 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001604 "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.
1605 "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 -04001606 "authKey": "A String", # The authkey parameter required for this permission.
1607 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001608 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
John Asmuth614db982014-04-24 15:46:26 -04001609 "photoLink": "A String", # A link to the profile photo, if available.
1610 "role": "A String", # The primary role for this user. Allowed values are:
1611 # - owner
1612 # - reader
1613 # - writer
1614 "type": "A String", # The account type. Allowed values are:
1615 # - user
1616 # - group
1617 # - domain
1618 # - anyone
1619 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1620 "A String",
1621 ],
1622 "selfLink": "A String", # A link back to this permission.
1623 },
1624 "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.
1625 "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.
1626 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1627 "selfLink": "A String", # A link back to this file.
1628 "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.
1629}
1630
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001631 newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).
1632 pinned: boolean, Whether to pin the new revision. A file can have a maximum of 200 pinned revisions.
John Asmuth614db982014-04-24 15:46:26 -04001633 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
1634 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Craig Citro065b5302014-08-14 00:47:23 -07001635 addParents: string, Comma-separated list of parent IDs to add.
1636 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04001637 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
1638 timedTextTrackName: string, The timed text track name.
1639 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
1640 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
1641 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
1642 timedTextLanguage: string, The language of the timed text.
1643
1644Returns:
1645 An object of the form:
1646
1647 { # The metadata for a file.
1648 "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.
1649 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001650 "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.
1651 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04001652 "thumbnailLink": "A String", # A link to the file's thumbnail.
1653 "labels": { # A group of labels for the file.
1654 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1655 "hidden": True or False, # Deprecated.
1656 "viewed": True or False, # Whether this file has been viewed by this user.
1657 "starred": True or False, # Whether this file is starred by the user.
1658 "trashed": True or False, # Whether this file has been trashed.
1659 },
1660 "indexableText": { # Indexable text attributes for the file (can only be written)
1661 "text": "A String", # The text to be indexed for this file.
1662 },
1663 "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.
1664 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1665 "writersCanShare": True or False, # Whether writers can share the document with other users.
1666 "owners": [ # The owner(s) of this file.
1667 { # The JSON template for a user.
1668 "picture": { # The user's profile picture.
1669 "url": "A String", # A URL that points to a profile picture of this user.
1670 },
1671 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001672 "displayName": "A String", # A plain text displayable name for this user.
1673 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001674 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1675 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001676 },
1677 ],
1678 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001679 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1680 "picture": { # The user's profile picture.
1681 "url": "A String", # A URL that points to a profile picture of this user.
1682 },
1683 "kind": "drive#user", # This is always drive#user.
1684 "displayName": "A String", # A plain text displayable name for this user.
1685 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1686 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1687 "emailAddress": "A String", # The email address of the user.
1688 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001689 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1690 "width": 42, # The width of the video in pixels.
1691 "durationMillis": "A String", # The duration of the video in milliseconds.
1692 "height": 42, # The height of the video in pixels.
1693 },
John Asmuth614db982014-04-24 15:46:26 -04001694 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1695 "picture": { # The user's profile picture.
1696 "url": "A String", # A URL that points to a profile picture of this user.
1697 },
1698 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001699 "displayName": "A String", # A plain text displayable name for this user.
1700 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001701 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1702 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001703 },
1704 "copyable": True or False, # Whether the file can be copied by the current user.
1705 "ownerNames": [ # Name(s) of the owner(s) of this file.
1706 "A String",
1707 ],
1708 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1709 "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.
1710 "etag": "A String", # ETag of the file.
1711 "parents": [ # Collection of parent folders which contain this file.
1712 # 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.
1713 { # A reference to a file's parent.
1714 "selfLink": "A String", # A link back to this reference.
1715 "kind": "drive#parentReference", # This is always drive#parentReference.
1716 "id": "A String", # The ID of the parent.
1717 "isRoot": True or False, # Whether or not the parent is the root folder.
1718 "parentLink": "A String", # A link to the parent.
1719 },
1720 ],
1721 "exportLinks": { # Links for exporting Google Docs to specific formats.
1722 "a_key": "A String", # A mapping from export format to URL
1723 },
1724 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001725 "permissions": [ # The list of permissions for users with access to this file.
1726 { # A permission for a file.
1727 "withLink": True or False, # Whether the link is required for this permission.
1728 "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.
1729 "name": "A String", # The name for this permission.
1730 "kind": "drive#permission", # This is always drive#permission.
1731 "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.
1732 "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.
1733 "authKey": "A String", # The authkey parameter required for this permission.
1734 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001735 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Craig Citro065b5302014-08-14 00:47:23 -07001736 "photoLink": "A String", # A link to the profile photo, if available.
1737 "role": "A String", # The primary role for this user. Allowed values are:
1738 # - owner
1739 # - reader
1740 # - writer
1741 "type": "A String", # The account type. Allowed values are:
1742 # - user
1743 # - group
1744 # - domain
1745 # - anyone
1746 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1747 "A String",
1748 ],
1749 "selfLink": "A String", # A link back to this permission.
1750 },
1751 ],
John Asmuth614db982014-04-24 15:46:26 -04001752 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1753 "mimeType": "A String", # The MIME type of the thumbnail.
1754 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1755 },
1756 "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.
1757 "a_key": "A String",
1758 },
1759 "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.
1760 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1761 "exposureTime": 3.14, # The length of the exposure, in seconds.
1762 "cameraMake": "A String", # The make of the camera used to create the photo.
1763 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1764 "isoSpeed": 42, # The ISO speed used to create the photo.
1765 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1766 "exposureMode": "A String", # The exposure mode used to create the photo.
1767 "colorSpace": "A String", # The color space of the photo.
1768 "location": { # Geographic location information stored in the image.
1769 "latitude": 3.14, # The latitude stored in the image.
1770 "altitude": 3.14, # The altitude stored in the image.
1771 "longitude": 3.14, # The longitude stored in the image.
1772 },
1773 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1774 "height": 42, # The height of the image in pixels.
1775 "lens": "A String", # The lens used to create the photo.
1776 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1777 "width": 42, # The width of the image in pixels.
1778 "meteringMode": "A String", # The metering mode used to create the photo.
1779 "flashUsed": True or False, # Whether a flash was used to create the photo.
1780 "aperture": 3.14, # The aperture used to create the photo (f-number).
1781 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1782 "sensor": "A String", # The type of sensor used to create the photo.
1783 "whiteBalance": "A String", # The white balance mode used to create the photo.
1784 "cameraModel": "A String", # The model of the camera used to create the photo.
1785 },
1786 "description": "A String", # A short description of the file.
1787 "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.
1788 "editable": True or False, # Whether the file can be edited by the current user.
1789 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001790 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001791 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1792 "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 -07001793 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001794 "properties": [ # The list of properties.
1795 { # A key-value pair that is either public or private to an application.
1796 "kind": "drive#property", # This is always drive#property.
1797 "value": "A String", # The value of this property.
1798 "etag": "A String", # ETag of the property.
1799 "visibility": "A String", # The visibility of this property.
1800 "key": "A String", # The key of this property.
1801 "selfLink": "A String", # The link back to this property.
1802 },
1803 ],
1804 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1805 "iconLink": "A String", # A link to the file's icon.
1806 "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.
1807 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001808 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001809 "title": "A String", # The title of this file.
1810 "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.
1811 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1812 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1813 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001814 "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 -04001815 "name": "A String", # The name for this permission.
1816 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001817 "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.
1818 "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 -04001819 "authKey": "A String", # The authkey parameter required for this permission.
1820 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001821 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
John Asmuth614db982014-04-24 15:46:26 -04001822 "photoLink": "A String", # A link to the profile photo, if available.
1823 "role": "A String", # The primary role for this user. Allowed values are:
1824 # - owner
1825 # - reader
1826 # - writer
1827 "type": "A String", # The account type. Allowed values are:
1828 # - user
1829 # - group
1830 # - domain
1831 # - anyone
1832 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1833 "A String",
1834 ],
1835 "selfLink": "A String", # A link back to this permission.
1836 },
1837 "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.
1838 "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.
1839 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
1840 "selfLink": "A String", # A link back to this file.
1841 "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.
1842 }</pre>
1843</div>
1844
1845<div class="method">
1846 <code class="details" id="touch">touch(fileId)</code>
1847 <pre>Set the file's updated time to the current server time.
1848
1849Args:
1850 fileId: string, The ID of the file to update. (required)
1851
1852Returns:
1853 An object of the form:
1854
1855 { # The metadata for a file.
1856 "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.
1857 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001858 "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.
1859 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04001860 "thumbnailLink": "A String", # A link to the file's thumbnail.
1861 "labels": { # A group of labels for the file.
1862 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1863 "hidden": True or False, # Deprecated.
1864 "viewed": True or False, # Whether this file has been viewed by this user.
1865 "starred": True or False, # Whether this file is starred by the user.
1866 "trashed": True or False, # Whether this file has been trashed.
1867 },
1868 "indexableText": { # Indexable text attributes for the file (can only be written)
1869 "text": "A String", # The text to be indexed for this file.
1870 },
1871 "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.
1872 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1873 "writersCanShare": True or False, # Whether writers can share the document with other users.
1874 "owners": [ # The owner(s) of this file.
1875 { # The JSON template for a user.
1876 "picture": { # The user's profile picture.
1877 "url": "A String", # A URL that points to a profile picture of this user.
1878 },
1879 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001880 "displayName": "A String", # A plain text displayable name for this user.
1881 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001882 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1883 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001884 },
1885 ],
1886 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001887 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1888 "picture": { # The user's profile picture.
1889 "url": "A String", # A URL that points to a profile picture of this user.
1890 },
1891 "kind": "drive#user", # This is always drive#user.
1892 "displayName": "A String", # A plain text displayable name for this user.
1893 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1894 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1895 "emailAddress": "A String", # The email address of the user.
1896 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001897 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1898 "width": 42, # The width of the video in pixels.
1899 "durationMillis": "A String", # The duration of the video in milliseconds.
1900 "height": 42, # The height of the video in pixels.
1901 },
John Asmuth614db982014-04-24 15:46:26 -04001902 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1903 "picture": { # The user's profile picture.
1904 "url": "A String", # A URL that points to a profile picture of this user.
1905 },
1906 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001907 "displayName": "A String", # A plain text displayable name for this user.
1908 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001909 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1910 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001911 },
1912 "copyable": True or False, # Whether the file can be copied by the current user.
1913 "ownerNames": [ # Name(s) of the owner(s) of this file.
1914 "A String",
1915 ],
1916 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1917 "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.
1918 "etag": "A String", # ETag of the file.
1919 "parents": [ # Collection of parent folders which contain this file.
1920 # 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.
1921 { # A reference to a file's parent.
1922 "selfLink": "A String", # A link back to this reference.
1923 "kind": "drive#parentReference", # This is always drive#parentReference.
1924 "id": "A String", # The ID of the parent.
1925 "isRoot": True or False, # Whether or not the parent is the root folder.
1926 "parentLink": "A String", # A link to the parent.
1927 },
1928 ],
1929 "exportLinks": { # Links for exporting Google Docs to specific formats.
1930 "a_key": "A String", # A mapping from export format to URL
1931 },
1932 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001933 "permissions": [ # The list of permissions for users with access to this file.
1934 { # A permission for a file.
1935 "withLink": True or False, # Whether the link is required for this permission.
1936 "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.
1937 "name": "A String", # The name for this permission.
1938 "kind": "drive#permission", # This is always drive#permission.
1939 "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.
1940 "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.
1941 "authKey": "A String", # The authkey parameter required for this permission.
1942 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001943 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Craig Citro065b5302014-08-14 00:47:23 -07001944 "photoLink": "A String", # A link to the profile photo, if available.
1945 "role": "A String", # The primary role for this user. Allowed values are:
1946 # - owner
1947 # - reader
1948 # - writer
1949 "type": "A String", # The account type. Allowed values are:
1950 # - user
1951 # - group
1952 # - domain
1953 # - anyone
1954 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1955 "A String",
1956 ],
1957 "selfLink": "A String", # A link back to this permission.
1958 },
1959 ],
John Asmuth614db982014-04-24 15:46:26 -04001960 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1961 "mimeType": "A String", # The MIME type of the thumbnail.
1962 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1963 },
1964 "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.
1965 "a_key": "A String",
1966 },
1967 "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.
1968 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1969 "exposureTime": 3.14, # The length of the exposure, in seconds.
1970 "cameraMake": "A String", # The make of the camera used to create the photo.
1971 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1972 "isoSpeed": 42, # The ISO speed used to create the photo.
1973 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1974 "exposureMode": "A String", # The exposure mode used to create the photo.
1975 "colorSpace": "A String", # The color space of the photo.
1976 "location": { # Geographic location information stored in the image.
1977 "latitude": 3.14, # The latitude stored in the image.
1978 "altitude": 3.14, # The altitude stored in the image.
1979 "longitude": 3.14, # The longitude stored in the image.
1980 },
1981 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1982 "height": 42, # The height of the image in pixels.
1983 "lens": "A String", # The lens used to create the photo.
1984 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1985 "width": 42, # The width of the image in pixels.
1986 "meteringMode": "A String", # The metering mode used to create the photo.
1987 "flashUsed": True or False, # Whether a flash was used to create the photo.
1988 "aperture": 3.14, # The aperture used to create the photo (f-number).
1989 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1990 "sensor": "A String", # The type of sensor used to create the photo.
1991 "whiteBalance": "A String", # The white balance mode used to create the photo.
1992 "cameraModel": "A String", # The model of the camera used to create the photo.
1993 },
1994 "description": "A String", # A short description of the file.
1995 "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.
1996 "editable": True or False, # Whether the file can be edited by the current user.
1997 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07001998 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001999 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2000 "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 -07002001 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002002 "properties": [ # The list of properties.
2003 { # A key-value pair that is either public or private to an application.
2004 "kind": "drive#property", # This is always drive#property.
2005 "value": "A String", # The value of this property.
2006 "etag": "A String", # ETag of the property.
2007 "visibility": "A String", # The visibility of this property.
2008 "key": "A String", # The key of this property.
2009 "selfLink": "A String", # The link back to this property.
2010 },
2011 ],
2012 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2013 "iconLink": "A String", # A link to the file's icon.
2014 "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.
2015 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002016 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002017 "title": "A String", # The title of this file.
2018 "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.
2019 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2020 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2021 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002022 "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 -04002023 "name": "A String", # The name for this permission.
2024 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002025 "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.
2026 "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 -04002027 "authKey": "A String", # The authkey parameter required for this permission.
2028 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002029 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
John Asmuth614db982014-04-24 15:46:26 -04002030 "photoLink": "A String", # A link to the profile photo, if available.
2031 "role": "A String", # The primary role for this user. Allowed values are:
2032 # - owner
2033 # - reader
2034 # - writer
2035 "type": "A String", # The account type. Allowed values are:
2036 # - user
2037 # - group
2038 # - domain
2039 # - anyone
2040 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2041 "A String",
2042 ],
2043 "selfLink": "A String", # A link back to this permission.
2044 },
2045 "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.
2046 "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.
2047 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2048 "selfLink": "A String", # A link back to this file.
2049 "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.
2050 }</pre>
2051</div>
2052
2053<div class="method">
2054 <code class="details" id="trash">trash(fileId)</code>
2055 <pre>Moves a file to the trash.
2056
2057Args:
2058 fileId: string, The ID of the file to trash. (required)
2059
2060Returns:
2061 An object of the form:
2062
2063 { # The metadata for a file.
2064 "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.
2065 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002066 "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.
2067 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04002068 "thumbnailLink": "A String", # A link to the file's thumbnail.
2069 "labels": { # A group of labels for the file.
2070 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2071 "hidden": True or False, # Deprecated.
2072 "viewed": True or False, # Whether this file has been viewed by this user.
2073 "starred": True or False, # Whether this file is starred by the user.
2074 "trashed": True or False, # Whether this file has been trashed.
2075 },
2076 "indexableText": { # Indexable text attributes for the file (can only be written)
2077 "text": "A String", # The text to be indexed for this file.
2078 },
2079 "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.
2080 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2081 "writersCanShare": True or False, # Whether writers can share the document with other users.
2082 "owners": [ # The owner(s) of this file.
2083 { # The JSON template for a user.
2084 "picture": { # The user's profile picture.
2085 "url": "A String", # A URL that points to a profile picture of this user.
2086 },
2087 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002088 "displayName": "A String", # A plain text displayable name for this user.
2089 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002090 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2091 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002092 },
2093 ],
2094 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002095 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2096 "picture": { # The user's profile picture.
2097 "url": "A String", # A URL that points to a profile picture of this user.
2098 },
2099 "kind": "drive#user", # This is always drive#user.
2100 "displayName": "A String", # A plain text displayable name for this user.
2101 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2102 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2103 "emailAddress": "A String", # The email address of the user.
2104 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002105 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2106 "width": 42, # The width of the video in pixels.
2107 "durationMillis": "A String", # The duration of the video in milliseconds.
2108 "height": 42, # The height of the video in pixels.
2109 },
John Asmuth614db982014-04-24 15:46:26 -04002110 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2111 "picture": { # The user's profile picture.
2112 "url": "A String", # A URL that points to a profile picture of this user.
2113 },
2114 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002115 "displayName": "A String", # A plain text displayable name for this user.
2116 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002117 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2118 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002119 },
2120 "copyable": True or False, # Whether the file can be copied by the current user.
2121 "ownerNames": [ # Name(s) of the owner(s) of this file.
2122 "A String",
2123 ],
2124 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2125 "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.
2126 "etag": "A String", # ETag of the file.
2127 "parents": [ # Collection of parent folders which contain this file.
2128 # 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.
2129 { # A reference to a file's parent.
2130 "selfLink": "A String", # A link back to this reference.
2131 "kind": "drive#parentReference", # This is always drive#parentReference.
2132 "id": "A String", # The ID of the parent.
2133 "isRoot": True or False, # Whether or not the parent is the root folder.
2134 "parentLink": "A String", # A link to the parent.
2135 },
2136 ],
2137 "exportLinks": { # Links for exporting Google Docs to specific formats.
2138 "a_key": "A String", # A mapping from export format to URL
2139 },
2140 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002141 "permissions": [ # The list of permissions for users with access to this file.
2142 { # A permission for a file.
2143 "withLink": True or False, # Whether the link is required for this permission.
2144 "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.
2145 "name": "A String", # The name for this permission.
2146 "kind": "drive#permission", # This is always drive#permission.
2147 "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.
2148 "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.
2149 "authKey": "A String", # The authkey parameter required for this permission.
2150 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002151 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Craig Citro065b5302014-08-14 00:47:23 -07002152 "photoLink": "A String", # A link to the profile photo, if available.
2153 "role": "A String", # The primary role for this user. Allowed values are:
2154 # - owner
2155 # - reader
2156 # - writer
2157 "type": "A String", # The account type. Allowed values are:
2158 # - user
2159 # - group
2160 # - domain
2161 # - anyone
2162 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2163 "A String",
2164 ],
2165 "selfLink": "A String", # A link back to this permission.
2166 },
2167 ],
John Asmuth614db982014-04-24 15:46:26 -04002168 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2169 "mimeType": "A String", # The MIME type of the thumbnail.
2170 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2171 },
2172 "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.
2173 "a_key": "A String",
2174 },
2175 "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.
2176 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2177 "exposureTime": 3.14, # The length of the exposure, in seconds.
2178 "cameraMake": "A String", # The make of the camera used to create the photo.
2179 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2180 "isoSpeed": 42, # The ISO speed used to create the photo.
2181 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2182 "exposureMode": "A String", # The exposure mode used to create the photo.
2183 "colorSpace": "A String", # The color space of the photo.
2184 "location": { # Geographic location information stored in the image.
2185 "latitude": 3.14, # The latitude stored in the image.
2186 "altitude": 3.14, # The altitude stored in the image.
2187 "longitude": 3.14, # The longitude stored in the image.
2188 },
2189 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2190 "height": 42, # The height of the image in pixels.
2191 "lens": "A String", # The lens used to create the photo.
2192 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2193 "width": 42, # The width of the image in pixels.
2194 "meteringMode": "A String", # The metering mode used to create the photo.
2195 "flashUsed": True or False, # Whether a flash was used to create the photo.
2196 "aperture": 3.14, # The aperture used to create the photo (f-number).
2197 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2198 "sensor": "A String", # The type of sensor used to create the photo.
2199 "whiteBalance": "A String", # The white balance mode used to create the photo.
2200 "cameraModel": "A String", # The model of the camera used to create the photo.
2201 },
2202 "description": "A String", # A short description of the file.
2203 "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.
2204 "editable": True or False, # Whether the file can be edited by the current user.
2205 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002206 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002207 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2208 "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 -07002209 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002210 "properties": [ # The list of properties.
2211 { # A key-value pair that is either public or private to an application.
2212 "kind": "drive#property", # This is always drive#property.
2213 "value": "A String", # The value of this property.
2214 "etag": "A String", # ETag of the property.
2215 "visibility": "A String", # The visibility of this property.
2216 "key": "A String", # The key of this property.
2217 "selfLink": "A String", # The link back to this property.
2218 },
2219 ],
2220 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2221 "iconLink": "A String", # A link to the file's icon.
2222 "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.
2223 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002224 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002225 "title": "A String", # The title of this file.
2226 "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.
2227 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2228 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2229 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002230 "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 -04002231 "name": "A String", # The name for this permission.
2232 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002233 "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.
2234 "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 -04002235 "authKey": "A String", # The authkey parameter required for this permission.
2236 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002237 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
John Asmuth614db982014-04-24 15:46:26 -04002238 "photoLink": "A String", # A link to the profile photo, if available.
2239 "role": "A String", # The primary role for this user. Allowed values are:
2240 # - owner
2241 # - reader
2242 # - writer
2243 "type": "A String", # The account type. Allowed values are:
2244 # - user
2245 # - group
2246 # - domain
2247 # - anyone
2248 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2249 "A String",
2250 ],
2251 "selfLink": "A String", # A link back to this permission.
2252 },
2253 "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.
2254 "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.
2255 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2256 "selfLink": "A String", # A link back to this file.
2257 "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.
2258 }</pre>
2259</div>
2260
2261<div class="method">
2262 <code class="details" id="untrash">untrash(fileId)</code>
2263 <pre>Restores a file from the trash.
2264
2265Args:
2266 fileId: string, The ID of the file to untrash. (required)
2267
2268Returns:
2269 An object of the form:
2270
2271 { # The metadata for a file.
2272 "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.
2273 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002274 "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.
2275 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04002276 "thumbnailLink": "A String", # A link to the file's thumbnail.
2277 "labels": { # A group of labels for the file.
2278 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2279 "hidden": True or False, # Deprecated.
2280 "viewed": True or False, # Whether this file has been viewed by this user.
2281 "starred": True or False, # Whether this file is starred by the user.
2282 "trashed": True or False, # Whether this file has been trashed.
2283 },
2284 "indexableText": { # Indexable text attributes for the file (can only be written)
2285 "text": "A String", # The text to be indexed for this file.
2286 },
2287 "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.
2288 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2289 "writersCanShare": True or False, # Whether writers can share the document with other users.
2290 "owners": [ # The owner(s) of this file.
2291 { # The JSON template for a user.
2292 "picture": { # The user's profile picture.
2293 "url": "A String", # A URL that points to a profile picture of this user.
2294 },
2295 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002296 "displayName": "A String", # A plain text displayable name for this user.
2297 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002298 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2299 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002300 },
2301 ],
2302 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002303 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2304 "picture": { # The user's profile picture.
2305 "url": "A String", # A URL that points to a profile picture of this user.
2306 },
2307 "kind": "drive#user", # This is always drive#user.
2308 "displayName": "A String", # A plain text displayable name for this user.
2309 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2310 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2311 "emailAddress": "A String", # The email address of the user.
2312 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002313 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2314 "width": 42, # The width of the video in pixels.
2315 "durationMillis": "A String", # The duration of the video in milliseconds.
2316 "height": 42, # The height of the video in pixels.
2317 },
John Asmuth614db982014-04-24 15:46:26 -04002318 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2319 "picture": { # The user's profile picture.
2320 "url": "A String", # A URL that points to a profile picture of this user.
2321 },
2322 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002323 "displayName": "A String", # A plain text displayable name for this user.
2324 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002325 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2326 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002327 },
2328 "copyable": True or False, # Whether the file can be copied by the current user.
2329 "ownerNames": [ # Name(s) of the owner(s) of this file.
2330 "A String",
2331 ],
2332 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2333 "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.
2334 "etag": "A String", # ETag of the file.
2335 "parents": [ # Collection of parent folders which contain this file.
2336 # 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.
2337 { # A reference to a file's parent.
2338 "selfLink": "A String", # A link back to this reference.
2339 "kind": "drive#parentReference", # This is always drive#parentReference.
2340 "id": "A String", # The ID of the parent.
2341 "isRoot": True or False, # Whether or not the parent is the root folder.
2342 "parentLink": "A String", # A link to the parent.
2343 },
2344 ],
2345 "exportLinks": { # Links for exporting Google Docs to specific formats.
2346 "a_key": "A String", # A mapping from export format to URL
2347 },
2348 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002349 "permissions": [ # The list of permissions for users with access to this file.
2350 { # A permission for a file.
2351 "withLink": True or False, # Whether the link is required for this permission.
2352 "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.
2353 "name": "A String", # The name for this permission.
2354 "kind": "drive#permission", # This is always drive#permission.
2355 "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.
2356 "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.
2357 "authKey": "A String", # The authkey parameter required for this permission.
2358 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002359 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Craig Citro065b5302014-08-14 00:47:23 -07002360 "photoLink": "A String", # A link to the profile photo, if available.
2361 "role": "A String", # The primary role for this user. Allowed values are:
2362 # - owner
2363 # - reader
2364 # - writer
2365 "type": "A String", # The account type. Allowed values are:
2366 # - user
2367 # - group
2368 # - domain
2369 # - anyone
2370 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2371 "A String",
2372 ],
2373 "selfLink": "A String", # A link back to this permission.
2374 },
2375 ],
John Asmuth614db982014-04-24 15:46:26 -04002376 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2377 "mimeType": "A String", # The MIME type of the thumbnail.
2378 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2379 },
2380 "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.
2381 "a_key": "A String",
2382 },
2383 "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.
2384 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2385 "exposureTime": 3.14, # The length of the exposure, in seconds.
2386 "cameraMake": "A String", # The make of the camera used to create the photo.
2387 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2388 "isoSpeed": 42, # The ISO speed used to create the photo.
2389 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2390 "exposureMode": "A String", # The exposure mode used to create the photo.
2391 "colorSpace": "A String", # The color space of the photo.
2392 "location": { # Geographic location information stored in the image.
2393 "latitude": 3.14, # The latitude stored in the image.
2394 "altitude": 3.14, # The altitude stored in the image.
2395 "longitude": 3.14, # The longitude stored in the image.
2396 },
2397 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2398 "height": 42, # The height of the image in pixels.
2399 "lens": "A String", # The lens used to create the photo.
2400 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2401 "width": 42, # The width of the image in pixels.
2402 "meteringMode": "A String", # The metering mode used to create the photo.
2403 "flashUsed": True or False, # Whether a flash was used to create the photo.
2404 "aperture": 3.14, # The aperture used to create the photo (f-number).
2405 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2406 "sensor": "A String", # The type of sensor used to create the photo.
2407 "whiteBalance": "A String", # The white balance mode used to create the photo.
2408 "cameraModel": "A String", # The model of the camera used to create the photo.
2409 },
2410 "description": "A String", # A short description of the file.
2411 "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.
2412 "editable": True or False, # Whether the file can be edited by the current user.
2413 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002414 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002415 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2416 "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 -07002417 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002418 "properties": [ # The list of properties.
2419 { # A key-value pair that is either public or private to an application.
2420 "kind": "drive#property", # This is always drive#property.
2421 "value": "A String", # The value of this property.
2422 "etag": "A String", # ETag of the property.
2423 "visibility": "A String", # The visibility of this property.
2424 "key": "A String", # The key of this property.
2425 "selfLink": "A String", # The link back to this property.
2426 },
2427 ],
2428 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2429 "iconLink": "A String", # A link to the file's icon.
2430 "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.
2431 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002432 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002433 "title": "A String", # The title of this file.
2434 "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.
2435 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2436 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2437 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002438 "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 -04002439 "name": "A String", # The name for this permission.
2440 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002441 "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.
2442 "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 -04002443 "authKey": "A String", # The authkey parameter required for this permission.
2444 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002445 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
John Asmuth614db982014-04-24 15:46:26 -04002446 "photoLink": "A String", # A link to the profile photo, if available.
2447 "role": "A String", # The primary role for this user. Allowed values are:
2448 # - owner
2449 # - reader
2450 # - writer
2451 "type": "A String", # The account type. Allowed values are:
2452 # - user
2453 # - group
2454 # - domain
2455 # - anyone
2456 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2457 "A String",
2458 ],
2459 "selfLink": "A String", # A link back to this permission.
2460 },
2461 "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.
2462 "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.
2463 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2464 "selfLink": "A String", # A link back to this file.
2465 "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.
2466 }</pre>
2467</div>
2468
2469<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -07002470 <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 -04002471 <pre>Updates file metadata and/or content.
2472
2473Args:
2474 fileId: string, The ID of the file to update. (required)
2475 body: object, The request body.
2476 The object takes the form of:
2477
2478{ # The metadata for a file.
2479 "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.
2480 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002481 "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.
2482 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04002483 "thumbnailLink": "A String", # A link to the file's thumbnail.
2484 "labels": { # A group of labels for the file.
2485 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2486 "hidden": True or False, # Deprecated.
2487 "viewed": True or False, # Whether this file has been viewed by this user.
2488 "starred": True or False, # Whether this file is starred by the user.
2489 "trashed": True or False, # Whether this file has been trashed.
2490 },
2491 "indexableText": { # Indexable text attributes for the file (can only be written)
2492 "text": "A String", # The text to be indexed for this file.
2493 },
2494 "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.
2495 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2496 "writersCanShare": True or False, # Whether writers can share the document with other users.
2497 "owners": [ # The owner(s) of this file.
2498 { # The JSON template for a user.
2499 "picture": { # The user's profile picture.
2500 "url": "A String", # A URL that points to a profile picture of this user.
2501 },
2502 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002503 "displayName": "A String", # A plain text displayable name for this user.
2504 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002505 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2506 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002507 },
2508 ],
2509 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002510 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2511 "picture": { # The user's profile picture.
2512 "url": "A String", # A URL that points to a profile picture of this user.
2513 },
2514 "kind": "drive#user", # This is always drive#user.
2515 "displayName": "A String", # A plain text displayable name for this user.
2516 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2517 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2518 "emailAddress": "A String", # The email address of the user.
2519 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002520 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2521 "width": 42, # The width of the video in pixels.
2522 "durationMillis": "A String", # The duration of the video in milliseconds.
2523 "height": 42, # The height of the video in pixels.
2524 },
John Asmuth614db982014-04-24 15:46:26 -04002525 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2526 "picture": { # The user's profile picture.
2527 "url": "A String", # A URL that points to a profile picture of this user.
2528 },
2529 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002530 "displayName": "A String", # A plain text displayable name for this user.
2531 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002532 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2533 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002534 },
2535 "copyable": True or False, # Whether the file can be copied by the current user.
2536 "ownerNames": [ # Name(s) of the owner(s) of this file.
2537 "A String",
2538 ],
2539 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2540 "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.
2541 "etag": "A String", # ETag of the file.
2542 "parents": [ # Collection of parent folders which contain this file.
2543 # 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.
2544 { # A reference to a file's parent.
2545 "selfLink": "A String", # A link back to this reference.
2546 "kind": "drive#parentReference", # This is always drive#parentReference.
2547 "id": "A String", # The ID of the parent.
2548 "isRoot": True or False, # Whether or not the parent is the root folder.
2549 "parentLink": "A String", # A link to the parent.
2550 },
2551 ],
2552 "exportLinks": { # Links for exporting Google Docs to specific formats.
2553 "a_key": "A String", # A mapping from export format to URL
2554 },
2555 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002556 "permissions": [ # The list of permissions for users with access to this file.
2557 { # A permission for a file.
2558 "withLink": True or False, # Whether the link is required for this permission.
2559 "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.
2560 "name": "A String", # The name for this permission.
2561 "kind": "drive#permission", # This is always drive#permission.
2562 "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.
2563 "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.
2564 "authKey": "A String", # The authkey parameter required for this permission.
2565 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002566 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Craig Citro065b5302014-08-14 00:47:23 -07002567 "photoLink": "A String", # A link to the profile photo, if available.
2568 "role": "A String", # The primary role for this user. Allowed values are:
2569 # - owner
2570 # - reader
2571 # - writer
2572 "type": "A String", # The account type. Allowed values are:
2573 # - user
2574 # - group
2575 # - domain
2576 # - anyone
2577 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2578 "A String",
2579 ],
2580 "selfLink": "A String", # A link back to this permission.
2581 },
2582 ],
John Asmuth614db982014-04-24 15:46:26 -04002583 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2584 "mimeType": "A String", # The MIME type of the thumbnail.
2585 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2586 },
2587 "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.
2588 "a_key": "A String",
2589 },
2590 "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.
2591 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2592 "exposureTime": 3.14, # The length of the exposure, in seconds.
2593 "cameraMake": "A String", # The make of the camera used to create the photo.
2594 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2595 "isoSpeed": 42, # The ISO speed used to create the photo.
2596 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2597 "exposureMode": "A String", # The exposure mode used to create the photo.
2598 "colorSpace": "A String", # The color space of the photo.
2599 "location": { # Geographic location information stored in the image.
2600 "latitude": 3.14, # The latitude stored in the image.
2601 "altitude": 3.14, # The altitude stored in the image.
2602 "longitude": 3.14, # The longitude stored in the image.
2603 },
2604 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2605 "height": 42, # The height of the image in pixels.
2606 "lens": "A String", # The lens used to create the photo.
2607 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2608 "width": 42, # The width of the image in pixels.
2609 "meteringMode": "A String", # The metering mode used to create the photo.
2610 "flashUsed": True or False, # Whether a flash was used to create the photo.
2611 "aperture": 3.14, # The aperture used to create the photo (f-number).
2612 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2613 "sensor": "A String", # The type of sensor used to create the photo.
2614 "whiteBalance": "A String", # The white balance mode used to create the photo.
2615 "cameraModel": "A String", # The model of the camera used to create the photo.
2616 },
2617 "description": "A String", # A short description of the file.
2618 "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.
2619 "editable": True or False, # Whether the file can be edited by the current user.
2620 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002621 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002622 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2623 "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 -07002624 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002625 "properties": [ # The list of properties.
2626 { # A key-value pair that is either public or private to an application.
2627 "kind": "drive#property", # This is always drive#property.
2628 "value": "A String", # The value of this property.
2629 "etag": "A String", # ETag of the property.
2630 "visibility": "A String", # The visibility of this property.
2631 "key": "A String", # The key of this property.
2632 "selfLink": "A String", # The link back to this property.
2633 },
2634 ],
2635 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2636 "iconLink": "A String", # A link to the file's icon.
2637 "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.
2638 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002639 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002640 "title": "A String", # The title of this file.
2641 "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.
2642 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2643 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2644 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002645 "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 -04002646 "name": "A String", # The name for this permission.
2647 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002648 "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.
2649 "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 -04002650 "authKey": "A String", # The authkey parameter required for this permission.
2651 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002652 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
John Asmuth614db982014-04-24 15:46:26 -04002653 "photoLink": "A String", # A link to the profile photo, if available.
2654 "role": "A String", # The primary role for this user. Allowed values are:
2655 # - owner
2656 # - reader
2657 # - writer
2658 "type": "A String", # The account type. Allowed values are:
2659 # - user
2660 # - group
2661 # - domain
2662 # - anyone
2663 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2664 "A String",
2665 ],
2666 "selfLink": "A String", # A link back to this permission.
2667 },
2668 "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.
2669 "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.
2670 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2671 "selfLink": "A String", # A link back to this file.
2672 "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.
2673}
2674
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002675 newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).
John Asmuth614db982014-04-24 15:46:26 -04002676 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
2677 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
2678 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002679 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 -07002680 addParents: string, Comma-separated list of parent IDs to add.
2681 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04002682 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
2683 timedTextTrackName: string, The timed text track name.
2684 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
2685 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
2686 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
2687 timedTextLanguage: string, The language of the timed text.
2688
2689Returns:
2690 An object of the form:
2691
2692 { # The metadata for a file.
2693 "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.
2694 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002695 "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.
2696 "appDataContents": True or False, # Whether this file is in the Application Data folder.
John Asmuth614db982014-04-24 15:46:26 -04002697 "thumbnailLink": "A String", # A link to the file's thumbnail.
2698 "labels": { # A group of labels for the file.
2699 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2700 "hidden": True or False, # Deprecated.
2701 "viewed": True or False, # Whether this file has been viewed by this user.
2702 "starred": True or False, # Whether this file is starred by the user.
2703 "trashed": True or False, # Whether this file has been trashed.
2704 },
2705 "indexableText": { # Indexable text attributes for the file (can only be written)
2706 "text": "A String", # The text to be indexed for this file.
2707 },
2708 "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.
2709 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2710 "writersCanShare": True or False, # Whether writers can share the document with other users.
2711 "owners": [ # The owner(s) of this file.
2712 { # The JSON template for a user.
2713 "picture": { # The user's profile picture.
2714 "url": "A String", # A URL that points to a profile picture of this user.
2715 },
2716 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002717 "displayName": "A String", # A plain text displayable name for this user.
2718 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002719 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2720 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002721 },
2722 ],
2723 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002724 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2725 "picture": { # The user's profile picture.
2726 "url": "A String", # A URL that points to a profile picture of this user.
2727 },
2728 "kind": "drive#user", # This is always drive#user.
2729 "displayName": "A String", # A plain text displayable name for this user.
2730 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2731 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2732 "emailAddress": "A String", # The email address of the user.
2733 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002734 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2735 "width": 42, # The width of the video in pixels.
2736 "durationMillis": "A String", # The duration of the video in milliseconds.
2737 "height": 42, # The height of the video in pixels.
2738 },
John Asmuth614db982014-04-24 15:46:26 -04002739 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2740 "picture": { # The user's profile picture.
2741 "url": "A String", # A URL that points to a profile picture of this user.
2742 },
2743 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002744 "displayName": "A String", # A plain text displayable name for this user.
2745 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002746 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2747 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002748 },
2749 "copyable": True or False, # Whether the file can be copied by the current user.
2750 "ownerNames": [ # Name(s) of the owner(s) of this file.
2751 "A String",
2752 ],
2753 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2754 "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.
2755 "etag": "A String", # ETag of the file.
2756 "parents": [ # Collection of parent folders which contain this file.
2757 # 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.
2758 { # A reference to a file's parent.
2759 "selfLink": "A String", # A link back to this reference.
2760 "kind": "drive#parentReference", # This is always drive#parentReference.
2761 "id": "A String", # The ID of the parent.
2762 "isRoot": True or False, # Whether or not the parent is the root folder.
2763 "parentLink": "A String", # A link to the parent.
2764 },
2765 ],
2766 "exportLinks": { # Links for exporting Google Docs to specific formats.
2767 "a_key": "A String", # A mapping from export format to URL
2768 },
2769 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002770 "permissions": [ # The list of permissions for users with access to this file.
2771 { # A permission for a file.
2772 "withLink": True or False, # Whether the link is required for this permission.
2773 "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.
2774 "name": "A String", # The name for this permission.
2775 "kind": "drive#permission", # This is always drive#permission.
2776 "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.
2777 "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.
2778 "authKey": "A String", # The authkey parameter required for this permission.
2779 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002780 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
Craig Citro065b5302014-08-14 00:47:23 -07002781 "photoLink": "A String", # A link to the profile photo, if available.
2782 "role": "A String", # The primary role for this user. Allowed values are:
2783 # - owner
2784 # - reader
2785 # - writer
2786 "type": "A String", # The account type. Allowed values are:
2787 # - user
2788 # - group
2789 # - domain
2790 # - anyone
2791 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2792 "A String",
2793 ],
2794 "selfLink": "A String", # A link back to this permission.
2795 },
2796 ],
John Asmuth614db982014-04-24 15:46:26 -04002797 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2798 "mimeType": "A String", # The MIME type of the thumbnail.
2799 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2800 },
2801 "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.
2802 "a_key": "A String",
2803 },
2804 "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.
2805 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2806 "exposureTime": 3.14, # The length of the exposure, in seconds.
2807 "cameraMake": "A String", # The make of the camera used to create the photo.
2808 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2809 "isoSpeed": 42, # The ISO speed used to create the photo.
2810 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2811 "exposureMode": "A String", # The exposure mode used to create the photo.
2812 "colorSpace": "A String", # The color space of the photo.
2813 "location": { # Geographic location information stored in the image.
2814 "latitude": 3.14, # The latitude stored in the image.
2815 "altitude": 3.14, # The altitude stored in the image.
2816 "longitude": 3.14, # The longitude stored in the image.
2817 },
2818 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2819 "height": 42, # The height of the image in pixels.
2820 "lens": "A String", # The lens used to create the photo.
2821 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2822 "width": 42, # The width of the image in pixels.
2823 "meteringMode": "A String", # The metering mode used to create the photo.
2824 "flashUsed": True or False, # Whether a flash was used to create the photo.
2825 "aperture": 3.14, # The aperture used to create the photo (f-number).
2826 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2827 "sensor": "A String", # The type of sensor used to create the photo.
2828 "whiteBalance": "A String", # The white balance mode used to create the photo.
2829 "cameraModel": "A String", # The model of the camera used to create the photo.
2830 },
2831 "description": "A String", # A short description of the file.
2832 "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.
2833 "editable": True or False, # Whether the file can be edited by the current user.
2834 "kind": "drive#file", # The type of file. This is always drive#file.
Craig Citro065b5302014-08-14 00:47:23 -07002835 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002836 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2837 "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 -07002838 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002839 "properties": [ # The list of properties.
2840 { # A key-value pair that is either public or private to an application.
2841 "kind": "drive#property", # This is always drive#property.
2842 "value": "A String", # The value of this property.
2843 "etag": "A String", # ETag of the property.
2844 "visibility": "A String", # The visibility of this property.
2845 "key": "A String", # The key of this property.
2846 "selfLink": "A String", # The link back to this property.
2847 },
2848 ],
2849 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2850 "iconLink": "A String", # A link to the file's icon.
2851 "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.
2852 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002853 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002854 "title": "A String", # The title of this file.
2855 "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.
2856 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2857 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2858 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002859 "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 -04002860 "name": "A String", # The name for this permission.
2861 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002862 "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.
2863 "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 -04002864 "authKey": "A String", # The authkey parameter required for this permission.
2865 "etag": "A String", # The ETag of the permission.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002866 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is present when the permission type is user.
John Asmuth614db982014-04-24 15:46:26 -04002867 "photoLink": "A String", # A link to the profile photo, if available.
2868 "role": "A String", # The primary role for this user. Allowed values are:
2869 # - owner
2870 # - reader
2871 # - writer
2872 "type": "A String", # The account type. Allowed values are:
2873 # - user
2874 # - group
2875 # - domain
2876 # - anyone
2877 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2878 "A String",
2879 ],
2880 "selfLink": "A String", # A link back to this permission.
2881 },
2882 "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.
2883 "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.
2884 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
2885 "selfLink": "A String", # A link back to this file.
2886 "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.
2887 }</pre>
2888</div>
2889
2890<div class="method">
2891 <code class="details" id="watch">watch(fileId, body, projection=None, updateViewedDate=None)</code>
2892 <pre>Subscribe to changes on a file
2893
2894Args:
2895 fileId: string, The ID for the file in question. (required)
2896 body: object, The request body. (required)
2897 The object takes the form of:
2898
2899{ # An notification channel used to watch for resource changes.
2900 "resourceUri": "A String", # A version-specific identifier for the watched resource.
2901 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
2902 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
2903 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
2904 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
2905 "params": { # Additional parameters controlling delivery channel behavior. Optional.
2906 "a_key": "A String", # Declares a new parameter by name.
2907 },
2908 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
2909 "address": "A String", # The address where notifications are delivered for this channel.
2910 "type": "A String", # The type of delivery mechanism used for this channel.
2911 "id": "A String", # A UUID or similar unique string that identifies this channel.
2912 }
2913
2914 projection: string, This parameter is deprecated and has no function.
2915 Allowed values
2916 BASIC - Deprecated
2917 FULL - Deprecated
2918 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
2919
2920Returns:
2921 An object of the form:
2922
2923 { # An notification channel used to watch for resource changes.
2924 "resourceUri": "A String", # A version-specific identifier for the watched resource.
2925 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
2926 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
2927 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
2928 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
2929 "params": { # Additional parameters controlling delivery channel behavior. Optional.
2930 "a_key": "A String", # Declares a new parameter by name.
2931 },
2932 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
2933 "address": "A String", # The address where notifications are delivered for this channel.
2934 "type": "A String", # The type of delivery mechanism used for this channel.
2935 "id": "A String", # A UUID or similar unique string that identifies this channel.
2936 }</pre>
2937</div>
2938
2939</body></html>