blob: acbcd80c8bbd56f1cb73c4098f451978b1ed8cb0 [file] [log] [blame]
Joe Gregorio075572b2012-07-09 16:53:09 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="drive_v2.html">Drive API</a> . <a href="drive_v2.files.html">files</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Joe Gregorio37802c32013-08-06 12:24:05 -040078 <code><a href="#copy">copy(fileId, body, pinned=None, convert=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None)</a></code></p>
Joe Gregorio075572b2012-07-09 16:53:09 -040079<p class="firstline">Creates a copy of the specified file.</p>
80<p class="toc_element">
81 <code><a href="#delete">delete(fileId)</a></code></p>
82<p class="firstline">Permanently deletes a file by ID. Skips the trash.</p>
83<p class="toc_element">
84 <code><a href="#get">get(fileId, projection=None, updateViewedDate=None)</a></code></p>
85<p class="firstline">Gets a file's metadata by ID.</p>
86<p class="toc_element">
Joe Gregorio37802c32013-08-06 12:24:05 -040087 <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>
Joe Gregorio075572b2012-07-09 16:53:09 -040088<p class="firstline">Insert a new file.</p>
89<p class="toc_element">
90 <code><a href="#list">list(q=None, projection=None, pageToken=None, maxResults=None)</a></code></p>
91<p class="firstline">Lists the user's files.</p>
92<p class="toc_element">
93 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
94<p class="firstline">Retrieves the next page of results.</p>
95<p class="toc_element">
Joe Gregorio41be8e82013-03-07 10:31:47 -050096 <code><a href="#patch">patch(fileId, body, newRevision=None, pinned=None, ocrLanguage=None, ocr=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
Joe Gregorio075572b2012-07-09 16:53:09 -040097<p class="firstline">Updates file metadata and/or content. This method supports patch semantics.</p>
98<p class="toc_element">
99 <code><a href="#touch">touch(fileId)</a></code></p>
100<p class="firstline">Set the file's updated time to the current server time.</p>
101<p class="toc_element">
102 <code><a href="#trash">trash(fileId)</a></code></p>
103<p class="firstline">Moves a file to the trash.</p>
104<p class="toc_element">
105 <code><a href="#untrash">untrash(fileId)</a></code></p>
106<p class="firstline">Restores a file from the trash.</p>
107<p class="toc_element">
Joe Gregorio41be8e82013-03-07 10:31:47 -0500108 <code><a href="#update">update(fileId, body=None, newRevision=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
109<p class="firstline">Updates file metadata and/or content.</p>
Joe Gregorio37802c32013-08-06 12:24:05 -0400110<p class="toc_element">
111 <code><a href="#watch">watch(fileId, body, projection=None, updateViewedDate=None)</a></code></p>
112<p class="firstline">Subscribe to changes on a file</p>
Joe Gregorio075572b2012-07-09 16:53:09 -0400113<h3>Method Details</h3>
114<div class="method">
Joe Gregorio37802c32013-08-06 12:24:05 -0400115 <code class="details" id="copy">copy(fileId, body, pinned=None, convert=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None)</code>
Joe Gregorio075572b2012-07-09 16:53:09 -0400116 <pre>Creates a copy of the specified file.
117
118Args:
119 fileId: string, The ID of the file to copy. (required)
120 body: object, The request body. (required)
121 The object takes the form of:
122
123{ # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400124 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio37802c32013-08-06 12:24:05 -0400125 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
126 "appDataContents": True or False, # Whether this file is in the appdata folder.
Joe Gregorio075572b2012-07-09 16:53:09 -0400127 "thumbnailLink": "A String", # A link to the file's thumbnail.
128 "labels": { # A group of labels for the file.
129 "restricted": True or False, # Whether viewers are prevented from downloading this file.
130 "hidden": True or False, # Whether this file is hidden from the user.
131 "viewed": True or False, # Whether this file has been viewed by this user.
132 "starred": True or False, # Whether this file is starred by the user.
133 "trashed": True or False, # Whether this file has been trashed.
134 },
135 "indexableText": { # Indexable text attributes for the file (can only be written)
Joe Gregorio41be8e82013-03-07 10:31:47 -0500136 "text": "A String", # The text to be indexed for this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400137 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400138 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500139 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400140 "writersCanShare": True or False, # Whether writers can share the document with other users.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500141 "owners": [ # The owner(s) of this file.
142 { # The JSON template for a user.
143 "picture": { # The user's profile picture.
144 "url": "A String", # A URL that points to a profile picture of this user.
145 },
146 "kind": "drive#user", # This is always drive#user.
147 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
148 "displayName": "A String", # A plain text displayable name for this user.
149 "permissionId": "A String", # The user's ID as visible in the permissions collection.
150 },
151 ],
152 "id": "A String", # The ID of the file.
153 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
154 "picture": { # The user's profile picture.
155 "url": "A String", # A URL that points to a profile picture of this user.
156 },
157 "kind": "drive#user", # This is always drive#user.
158 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
159 "displayName": "A String", # A plain text displayable name for this user.
160 "permissionId": "A String", # The user's ID as visible in the permissions collection.
161 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400162 "copyable": True or False, # Whether the file can be copied by the current user.
Joe Gregorio075572b2012-07-09 16:53:09 -0400163 "ownerNames": [ # Name(s) of the owner(s) of this file.
164 "A String",
165 ],
166 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
Joe Gregorio52a5c532013-01-24 16:19:07 -0500167 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -0400168 "etag": "A String", # ETag of the file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400169 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400170 # Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.
Joe Gregorio075572b2012-07-09 16:53:09 -0400171 { # A reference to a file's parent.
172 "selfLink": "A String", # A link back to this reference.
173 "kind": "drive#parentReference", # This is always drive#parentReference.
174 "id": "A String", # The ID of the parent.
175 "isRoot": True or False, # Whether or not the parent is the root folder.
176 "parentLink": "A String", # A link to the parent.
177 },
178 ],
179 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400180 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -0400181 },
Joe Gregorio52a5c532013-01-24 16:19:07 -0500182 "shared": True or False, # Whether the file has been shared.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500183 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
184 "mimeType": "A String", # The MIME type of the thumbnail.
185 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
186 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400187 "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.
188 "a_key": "A String",
189 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400190 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500191 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -0500192 "exposureTime": 3.14, # The length of the exposure, in seconds.
193 "cameraMake": "A String", # The make of the camera used to create the photo.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500194 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -0500195 "isoSpeed": 42, # The ISO speed used to create the photo.
196 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500197 "exposureMode": "A String", # The exposure mode used to create the photo.
198 "colorSpace": "A String", # The color space of the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400199 "location": { # Geographic location information stored in the image.
200 "latitude": 3.14, # The latitude stored in the image.
201 "altitude": 3.14, # The altitude stored in the image.
202 "longitude": 3.14, # The longitude stored in the image.
203 },
Joe Gregorio52a5c532013-01-24 16:19:07 -0500204 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
205 "height": 42, # The height of the image in pixels.
206 "lens": "A String", # The lens used to create the photo.
207 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
208 "width": 42, # The width of the image in pixels.
209 "meteringMode": "A String", # The metering mode used to create the photo.
210 "flashUsed": True or False, # Whether a flash was used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500211 "aperture": 3.14, # The aperture used to create the photo (f-number).
212 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500213 "sensor": "A String", # The type of sensor used to create the photo.
214 "whiteBalance": "A String", # The white balance mode used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500215 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400216 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400217 "description": "A String", # A short description of the file.
218 "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.
219 "editable": True or False, # Whether the file can be edited by the current user.
220 "kind": "drive#file", # The type of file. This is always drive#file.
221 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
222 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
223 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
224 "properties": [ # The list of properties.
225 { # A key-value pair that is either public or private to an application.
226 "kind": "drive#property", # This is always drive#property.
227 "value": "A String", # The value of this property.
228 "etag": "A String", # ETag of the property.
229 "visibility": "A String", # The visibility of this property.
230 "key": "A String", # The key of this property.
231 "selfLink": "A String", # The link back to this property.
232 },
233 ],
234 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
235 "iconLink": "A String", # A link to the file's icon.
236 "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.
Joe Gregorio075572b2012-07-09 16:53:09 -0400237 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400238 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
Joe Gregorio37802c32013-08-06 12:24:05 -0400239 "title": "A String", # The title of this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400240 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500241 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
242 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400243 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400244 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -0400245 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400246 "kind": "drive#permission", # This is always drive#permission.
247 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -0400248 "id": "A String", # The ID of the permission.
249 "authKey": "A String", # The authkey parameter required for this permission.
250 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400251 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
252 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -0400253 "role": "A String", # The primary role for this user. Allowed values are:
254 # - owner
255 # - reader
256 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -0400257 "type": "A String", # The account type. Allowed values are:
258 # - user
259 # - group
260 # - domain
261 # - anyone
262 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
263 "A String",
264 ],
265 "selfLink": "A String", # A link back to this permission.
266 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400267 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500268 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -0400269 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400270 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400271 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -0400272}
273
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400274 pinned: boolean, Whether to pin the head revision of the new copy.
Joe Gregorio075572b2012-07-09 16:53:09 -0400275 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
Joe Gregorio37802c32013-08-06 12:24:05 -0400276 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.
277 Allowed values
278 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
279 PRIVATE - The new file will be visible to only the owner.
Joe Gregorio075572b2012-07-09 16:53:09 -0400280 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500281 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Joe Gregorio075572b2012-07-09 16:53:09 -0400282 timedTextLanguage: string, The language of the timed text.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500283 timedTextTrackName: string, The timed text track name.
Joe Gregorio075572b2012-07-09 16:53:09 -0400284
285Returns:
286 An object of the form:
287
288 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400289 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio37802c32013-08-06 12:24:05 -0400290 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
291 "appDataContents": True or False, # Whether this file is in the appdata folder.
Joe Gregorio075572b2012-07-09 16:53:09 -0400292 "thumbnailLink": "A String", # A link to the file's thumbnail.
293 "labels": { # A group of labels for the file.
294 "restricted": True or False, # Whether viewers are prevented from downloading this file.
295 "hidden": True or False, # Whether this file is hidden from the user.
296 "viewed": True or False, # Whether this file has been viewed by this user.
297 "starred": True or False, # Whether this file is starred by the user.
298 "trashed": True or False, # Whether this file has been trashed.
299 },
300 "indexableText": { # Indexable text attributes for the file (can only be written)
Joe Gregorio41be8e82013-03-07 10:31:47 -0500301 "text": "A String", # The text to be indexed for this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400302 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400303 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500304 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400305 "writersCanShare": True or False, # Whether writers can share the document with other users.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500306 "owners": [ # The owner(s) of this file.
307 { # The JSON template for a user.
308 "picture": { # The user's profile picture.
309 "url": "A String", # A URL that points to a profile picture of this user.
310 },
311 "kind": "drive#user", # This is always drive#user.
312 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
313 "displayName": "A String", # A plain text displayable name for this user.
314 "permissionId": "A String", # The user's ID as visible in the permissions collection.
315 },
316 ],
317 "id": "A String", # The ID of the file.
318 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
319 "picture": { # The user's profile picture.
320 "url": "A String", # A URL that points to a profile picture of this user.
321 },
322 "kind": "drive#user", # This is always drive#user.
323 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
324 "displayName": "A String", # A plain text displayable name for this user.
325 "permissionId": "A String", # The user's ID as visible in the permissions collection.
326 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400327 "copyable": True or False, # Whether the file can be copied by the current user.
Joe Gregorio075572b2012-07-09 16:53:09 -0400328 "ownerNames": [ # Name(s) of the owner(s) of this file.
329 "A String",
330 ],
331 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
Joe Gregorio52a5c532013-01-24 16:19:07 -0500332 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -0400333 "etag": "A String", # ETag of the file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400334 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400335 # Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.
Joe Gregorio075572b2012-07-09 16:53:09 -0400336 { # A reference to a file's parent.
337 "selfLink": "A String", # A link back to this reference.
338 "kind": "drive#parentReference", # This is always drive#parentReference.
339 "id": "A String", # The ID of the parent.
340 "isRoot": True or False, # Whether or not the parent is the root folder.
341 "parentLink": "A String", # A link to the parent.
342 },
343 ],
344 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400345 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -0400346 },
Joe Gregorio52a5c532013-01-24 16:19:07 -0500347 "shared": True or False, # Whether the file has been shared.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500348 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
349 "mimeType": "A String", # The MIME type of the thumbnail.
350 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
351 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400352 "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.
353 "a_key": "A String",
354 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400355 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500356 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -0500357 "exposureTime": 3.14, # The length of the exposure, in seconds.
358 "cameraMake": "A String", # The make of the camera used to create the photo.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500359 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -0500360 "isoSpeed": 42, # The ISO speed used to create the photo.
361 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500362 "exposureMode": "A String", # The exposure mode used to create the photo.
363 "colorSpace": "A String", # The color space of the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400364 "location": { # Geographic location information stored in the image.
365 "latitude": 3.14, # The latitude stored in the image.
366 "altitude": 3.14, # The altitude stored in the image.
367 "longitude": 3.14, # The longitude stored in the image.
368 },
Joe Gregorio52a5c532013-01-24 16:19:07 -0500369 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
370 "height": 42, # The height of the image in pixels.
371 "lens": "A String", # The lens used to create the photo.
372 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
373 "width": 42, # The width of the image in pixels.
374 "meteringMode": "A String", # The metering mode used to create the photo.
375 "flashUsed": True or False, # Whether a flash was used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500376 "aperture": 3.14, # The aperture used to create the photo (f-number).
377 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500378 "sensor": "A String", # The type of sensor used to create the photo.
379 "whiteBalance": "A String", # The white balance mode used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500380 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400381 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400382 "description": "A String", # A short description of the file.
383 "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.
384 "editable": True or False, # Whether the file can be edited by the current user.
385 "kind": "drive#file", # The type of file. This is always drive#file.
386 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
387 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
388 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
389 "properties": [ # The list of properties.
390 { # A key-value pair that is either public or private to an application.
391 "kind": "drive#property", # This is always drive#property.
392 "value": "A String", # The value of this property.
393 "etag": "A String", # ETag of the property.
394 "visibility": "A String", # The visibility of this property.
395 "key": "A String", # The key of this property.
396 "selfLink": "A String", # The link back to this property.
397 },
398 ],
399 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
400 "iconLink": "A String", # A link to the file's icon.
401 "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.
Joe Gregorio075572b2012-07-09 16:53:09 -0400402 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400403 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
Joe Gregorio37802c32013-08-06 12:24:05 -0400404 "title": "A String", # The title of this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400405 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500406 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
407 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400408 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400409 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -0400410 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400411 "kind": "drive#permission", # This is always drive#permission.
412 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -0400413 "id": "A String", # The ID of the permission.
414 "authKey": "A String", # The authkey parameter required for this permission.
415 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400416 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
417 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -0400418 "role": "A String", # The primary role for this user. Allowed values are:
419 # - owner
420 # - reader
421 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -0400422 "type": "A String", # The account type. Allowed values are:
423 # - user
424 # - group
425 # - domain
426 # - anyone
427 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
428 "A String",
429 ],
430 "selfLink": "A String", # A link back to this permission.
431 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400432 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500433 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -0400434 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400435 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400436 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -0400437 }</pre>
438</div>
439
440<div class="method">
441 <code class="details" id="delete">delete(fileId)</code>
442 <pre>Permanently deletes a file by ID. Skips the trash.
443
444Args:
445 fileId: string, The ID of the file to delete. (required)
446</pre>
447</div>
448
449<div class="method">
450 <code class="details" id="get">get(fileId, projection=None, updateViewedDate=None)</code>
451 <pre>Gets a file's metadata by ID.
452
453Args:
454 fileId: string, The ID for the file in question. (required)
Joe Gregorioad8013f2012-08-03 08:44:02 -0400455 projection: string, This parameter is deprecated and has no function.
Joe Gregorio075572b2012-07-09 16:53:09 -0400456 Allowed values
Joe Gregorioad8013f2012-08-03 08:44:02 -0400457 BASIC - Deprecated
458 FULL - Deprecated
Joe Gregorio075572b2012-07-09 16:53:09 -0400459 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
460
461Returns:
462 An object of the form:
463
464 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400465 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio37802c32013-08-06 12:24:05 -0400466 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
467 "appDataContents": True or False, # Whether this file is in the appdata folder.
Joe Gregorio075572b2012-07-09 16:53:09 -0400468 "thumbnailLink": "A String", # A link to the file's thumbnail.
469 "labels": { # A group of labels for the file.
470 "restricted": True or False, # Whether viewers are prevented from downloading this file.
471 "hidden": True or False, # Whether this file is hidden from the user.
472 "viewed": True or False, # Whether this file has been viewed by this user.
473 "starred": True or False, # Whether this file is starred by the user.
474 "trashed": True or False, # Whether this file has been trashed.
475 },
476 "indexableText": { # Indexable text attributes for the file (can only be written)
Joe Gregorio41be8e82013-03-07 10:31:47 -0500477 "text": "A String", # The text to be indexed for this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400478 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400479 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500480 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400481 "writersCanShare": True or False, # Whether writers can share the document with other users.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500482 "owners": [ # The owner(s) of this file.
483 { # The JSON template for a user.
484 "picture": { # The user's profile picture.
485 "url": "A String", # A URL that points to a profile picture of this user.
486 },
487 "kind": "drive#user", # This is always drive#user.
488 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
489 "displayName": "A String", # A plain text displayable name for this user.
490 "permissionId": "A String", # The user's ID as visible in the permissions collection.
491 },
492 ],
493 "id": "A String", # The ID of the file.
494 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
495 "picture": { # The user's profile picture.
496 "url": "A String", # A URL that points to a profile picture of this user.
497 },
498 "kind": "drive#user", # This is always drive#user.
499 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
500 "displayName": "A String", # A plain text displayable name for this user.
501 "permissionId": "A String", # The user's ID as visible in the permissions collection.
502 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400503 "copyable": True or False, # Whether the file can be copied by the current user.
Joe Gregorio075572b2012-07-09 16:53:09 -0400504 "ownerNames": [ # Name(s) of the owner(s) of this file.
505 "A String",
506 ],
507 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
Joe Gregorio52a5c532013-01-24 16:19:07 -0500508 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -0400509 "etag": "A String", # ETag of the file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400510 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400511 # Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.
Joe Gregorio075572b2012-07-09 16:53:09 -0400512 { # A reference to a file's parent.
513 "selfLink": "A String", # A link back to this reference.
514 "kind": "drive#parentReference", # This is always drive#parentReference.
515 "id": "A String", # The ID of the parent.
516 "isRoot": True or False, # Whether or not the parent is the root folder.
517 "parentLink": "A String", # A link to the parent.
518 },
519 ],
520 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400521 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -0400522 },
Joe Gregorio52a5c532013-01-24 16:19:07 -0500523 "shared": True or False, # Whether the file has been shared.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500524 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
525 "mimeType": "A String", # The MIME type of the thumbnail.
526 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
527 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400528 "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.
529 "a_key": "A String",
530 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400531 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500532 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -0500533 "exposureTime": 3.14, # The length of the exposure, in seconds.
534 "cameraMake": "A String", # The make of the camera used to create the photo.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500535 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -0500536 "isoSpeed": 42, # The ISO speed used to create the photo.
537 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500538 "exposureMode": "A String", # The exposure mode used to create the photo.
539 "colorSpace": "A String", # The color space of the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400540 "location": { # Geographic location information stored in the image.
541 "latitude": 3.14, # The latitude stored in the image.
542 "altitude": 3.14, # The altitude stored in the image.
543 "longitude": 3.14, # The longitude stored in the image.
544 },
Joe Gregorio52a5c532013-01-24 16:19:07 -0500545 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
546 "height": 42, # The height of the image in pixels.
547 "lens": "A String", # The lens used to create the photo.
548 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
549 "width": 42, # The width of the image in pixels.
550 "meteringMode": "A String", # The metering mode used to create the photo.
551 "flashUsed": True or False, # Whether a flash was used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500552 "aperture": 3.14, # The aperture used to create the photo (f-number).
553 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500554 "sensor": "A String", # The type of sensor used to create the photo.
555 "whiteBalance": "A String", # The white balance mode used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500556 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400557 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400558 "description": "A String", # A short description of the file.
559 "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.
560 "editable": True or False, # Whether the file can be edited by the current user.
561 "kind": "drive#file", # The type of file. This is always drive#file.
562 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
563 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
564 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
565 "properties": [ # The list of properties.
566 { # A key-value pair that is either public or private to an application.
567 "kind": "drive#property", # This is always drive#property.
568 "value": "A String", # The value of this property.
569 "etag": "A String", # ETag of the property.
570 "visibility": "A String", # The visibility of this property.
571 "key": "A String", # The key of this property.
572 "selfLink": "A String", # The link back to this property.
573 },
574 ],
575 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
576 "iconLink": "A String", # A link to the file's icon.
577 "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.
Joe Gregorio075572b2012-07-09 16:53:09 -0400578 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400579 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
Joe Gregorio37802c32013-08-06 12:24:05 -0400580 "title": "A String", # The title of this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400581 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500582 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
583 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400584 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400585 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -0400586 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400587 "kind": "drive#permission", # This is always drive#permission.
588 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -0400589 "id": "A String", # The ID of the permission.
590 "authKey": "A String", # The authkey parameter required for this permission.
591 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400592 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
593 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -0400594 "role": "A String", # The primary role for this user. Allowed values are:
595 # - owner
596 # - reader
597 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -0400598 "type": "A String", # The account type. Allowed values are:
599 # - user
600 # - group
601 # - domain
602 # - anyone
603 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
604 "A String",
605 ],
606 "selfLink": "A String", # A link back to this permission.
607 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400608 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500609 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -0400610 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400611 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400612 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -0400613 }</pre>
614</div>
615
616<div class="method">
Joe Gregorio37802c32013-08-06 12:24:05 -0400617 <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>
Joe Gregorio075572b2012-07-09 16:53:09 -0400618 <pre>Insert a new file.
619
620Args:
621 body: object, The request body.
622 The object takes the form of:
623
624{ # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400625 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio37802c32013-08-06 12:24:05 -0400626 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
627 "appDataContents": True or False, # Whether this file is in the appdata folder.
Joe Gregorio075572b2012-07-09 16:53:09 -0400628 "thumbnailLink": "A String", # A link to the file's thumbnail.
629 "labels": { # A group of labels for the file.
630 "restricted": True or False, # Whether viewers are prevented from downloading this file.
631 "hidden": True or False, # Whether this file is hidden from the user.
632 "viewed": True or False, # Whether this file has been viewed by this user.
633 "starred": True or False, # Whether this file is starred by the user.
634 "trashed": True or False, # Whether this file has been trashed.
635 },
636 "indexableText": { # Indexable text attributes for the file (can only be written)
Joe Gregorio41be8e82013-03-07 10:31:47 -0500637 "text": "A String", # The text to be indexed for this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400638 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400639 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500640 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400641 "writersCanShare": True or False, # Whether writers can share the document with other users.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500642 "owners": [ # The owner(s) of this file.
643 { # The JSON template for a user.
644 "picture": { # The user's profile picture.
645 "url": "A String", # A URL that points to a profile picture of this user.
646 },
647 "kind": "drive#user", # This is always drive#user.
648 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
649 "displayName": "A String", # A plain text displayable name for this user.
650 "permissionId": "A String", # The user's ID as visible in the permissions collection.
651 },
652 ],
653 "id": "A String", # The ID of the file.
654 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
655 "picture": { # The user's profile picture.
656 "url": "A String", # A URL that points to a profile picture of this user.
657 },
658 "kind": "drive#user", # This is always drive#user.
659 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
660 "displayName": "A String", # A plain text displayable name for this user.
661 "permissionId": "A String", # The user's ID as visible in the permissions collection.
662 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400663 "copyable": True or False, # Whether the file can be copied by the current user.
Joe Gregorio075572b2012-07-09 16:53:09 -0400664 "ownerNames": [ # Name(s) of the owner(s) of this file.
665 "A String",
666 ],
667 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
Joe Gregorio52a5c532013-01-24 16:19:07 -0500668 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -0400669 "etag": "A String", # ETag of the file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400670 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400671 # Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.
Joe Gregorio075572b2012-07-09 16:53:09 -0400672 { # A reference to a file's parent.
673 "selfLink": "A String", # A link back to this reference.
674 "kind": "drive#parentReference", # This is always drive#parentReference.
675 "id": "A String", # The ID of the parent.
676 "isRoot": True or False, # Whether or not the parent is the root folder.
677 "parentLink": "A String", # A link to the parent.
678 },
679 ],
680 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400681 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -0400682 },
Joe Gregorio52a5c532013-01-24 16:19:07 -0500683 "shared": True or False, # Whether the file has been shared.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500684 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
685 "mimeType": "A String", # The MIME type of the thumbnail.
686 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
687 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400688 "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.
689 "a_key": "A String",
690 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400691 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500692 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -0500693 "exposureTime": 3.14, # The length of the exposure, in seconds.
694 "cameraMake": "A String", # The make of the camera used to create the photo.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500695 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -0500696 "isoSpeed": 42, # The ISO speed used to create the photo.
697 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500698 "exposureMode": "A String", # The exposure mode used to create the photo.
699 "colorSpace": "A String", # The color space of the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400700 "location": { # Geographic location information stored in the image.
701 "latitude": 3.14, # The latitude stored in the image.
702 "altitude": 3.14, # The altitude stored in the image.
703 "longitude": 3.14, # The longitude stored in the image.
704 },
Joe Gregorio52a5c532013-01-24 16:19:07 -0500705 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
706 "height": 42, # The height of the image in pixels.
707 "lens": "A String", # The lens used to create the photo.
708 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
709 "width": 42, # The width of the image in pixels.
710 "meteringMode": "A String", # The metering mode used to create the photo.
711 "flashUsed": True or False, # Whether a flash was used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500712 "aperture": 3.14, # The aperture used to create the photo (f-number).
713 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500714 "sensor": "A String", # The type of sensor used to create the photo.
715 "whiteBalance": "A String", # The white balance mode used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500716 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400717 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400718 "description": "A String", # A short description of the file.
719 "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.
720 "editable": True or False, # Whether the file can be edited by the current user.
721 "kind": "drive#file", # The type of file. This is always drive#file.
722 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
723 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
724 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
725 "properties": [ # The list of properties.
726 { # A key-value pair that is either public or private to an application.
727 "kind": "drive#property", # This is always drive#property.
728 "value": "A String", # The value of this property.
729 "etag": "A String", # ETag of the property.
730 "visibility": "A String", # The visibility of this property.
731 "key": "A String", # The key of this property.
732 "selfLink": "A String", # The link back to this property.
733 },
734 ],
735 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
736 "iconLink": "A String", # A link to the file's icon.
737 "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.
Joe Gregorio075572b2012-07-09 16:53:09 -0400738 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400739 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
Joe Gregorio37802c32013-08-06 12:24:05 -0400740 "title": "A String", # The title of this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400741 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500742 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
743 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400744 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400745 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -0400746 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400747 "kind": "drive#permission", # This is always drive#permission.
748 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -0400749 "id": "A String", # The ID of the permission.
750 "authKey": "A String", # The authkey parameter required for this permission.
751 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400752 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
753 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -0400754 "role": "A String", # The primary role for this user. Allowed values are:
755 # - owner
756 # - reader
757 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -0400758 "type": "A String", # The account type. Allowed values are:
759 # - user
760 # - group
761 # - domain
762 # - anyone
763 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
764 "A String",
765 ],
766 "selfLink": "A String", # A link back to this permission.
767 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400768 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500769 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -0400770 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400771 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400772 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -0400773}
774
775 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
776 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500777 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
Joe Gregorio37802c32013-08-06 12:24:05 -0400778 visibility: string, The visibility of the new file. This parameter is only relevant when convert=false.
779 Allowed values
780 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
781 PRIVATE - The new file will be visible to only the owner.
Joe Gregorio075572b2012-07-09 16:53:09 -0400782 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500783 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Joe Gregorio075572b2012-07-09 16:53:09 -0400784 timedTextLanguage: string, The language of the timed text.
785 timedTextTrackName: string, The timed text track name.
786 pinned: boolean, Whether to pin the head revision of the uploaded file.
787
788Returns:
789 An object of the form:
790
791 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400792 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio37802c32013-08-06 12:24:05 -0400793 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
794 "appDataContents": True or False, # Whether this file is in the appdata folder.
Joe Gregorio075572b2012-07-09 16:53:09 -0400795 "thumbnailLink": "A String", # A link to the file's thumbnail.
796 "labels": { # A group of labels for the file.
797 "restricted": True or False, # Whether viewers are prevented from downloading this file.
798 "hidden": True or False, # Whether this file is hidden from the user.
799 "viewed": True or False, # Whether this file has been viewed by this user.
800 "starred": True or False, # Whether this file is starred by the user.
801 "trashed": True or False, # Whether this file has been trashed.
802 },
803 "indexableText": { # Indexable text attributes for the file (can only be written)
Joe Gregorio41be8e82013-03-07 10:31:47 -0500804 "text": "A String", # The text to be indexed for this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400805 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400806 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500807 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400808 "writersCanShare": True or False, # Whether writers can share the document with other users.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500809 "owners": [ # The owner(s) of this file.
810 { # The JSON template for a user.
811 "picture": { # The user's profile picture.
812 "url": "A String", # A URL that points to a profile picture of this user.
813 },
814 "kind": "drive#user", # This is always drive#user.
815 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
816 "displayName": "A String", # A plain text displayable name for this user.
817 "permissionId": "A String", # The user's ID as visible in the permissions collection.
818 },
819 ],
820 "id": "A String", # The ID of the file.
821 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
822 "picture": { # The user's profile picture.
823 "url": "A String", # A URL that points to a profile picture of this user.
824 },
825 "kind": "drive#user", # This is always drive#user.
826 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
827 "displayName": "A String", # A plain text displayable name for this user.
828 "permissionId": "A String", # The user's ID as visible in the permissions collection.
829 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400830 "copyable": True or False, # Whether the file can be copied by the current user.
Joe Gregorio075572b2012-07-09 16:53:09 -0400831 "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).
Joe Gregorio52a5c532013-01-24 16:19:07 -0500835 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -0400836 "etag": "A String", # ETag of the file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400837 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -0400838 # Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.
Joe Gregorio075572b2012-07-09 16:53:09 -0400839 { # 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.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -0400848 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -0400849 },
Joe Gregorio52a5c532013-01-24 16:19:07 -0500850 "shared": True or False, # Whether the file has been shared.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500851 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
852 "mimeType": "A String", # The MIME type of the thumbnail.
853 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
854 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400855 "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.
856 "a_key": "A String",
857 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400858 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500859 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -0500860 "exposureTime": 3.14, # The length of the exposure, in seconds.
861 "cameraMake": "A String", # The make of the camera used to create the photo.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500862 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -0500863 "isoSpeed": 42, # The ISO speed used to create the photo.
864 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500865 "exposureMode": "A String", # The exposure mode used to create the photo.
866 "colorSpace": "A String", # The color space of the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400867 "location": { # Geographic location information stored in the image.
868 "latitude": 3.14, # The latitude stored in the image.
869 "altitude": 3.14, # The altitude stored in the image.
870 "longitude": 3.14, # The longitude stored in the image.
871 },
Joe Gregorio52a5c532013-01-24 16:19:07 -0500872 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
873 "height": 42, # The height of the image in pixels.
874 "lens": "A String", # The lens used to create the photo.
875 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
876 "width": 42, # The width of the image in pixels.
877 "meteringMode": "A String", # The metering mode used to create the photo.
878 "flashUsed": True or False, # Whether a flash was used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500879 "aperture": 3.14, # The aperture used to create the photo (f-number).
880 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
Joe Gregorio52a5c532013-01-24 16:19:07 -0500881 "sensor": "A String", # The type of sensor used to create the photo.
882 "whiteBalance": "A String", # The white balance mode used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -0500883 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400884 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400885 "description": "A String", # A short description of the file.
886 "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.
887 "editable": True or False, # Whether the file can be edited by the current user.
888 "kind": "drive#file", # The type of file. This is always drive#file.
889 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
890 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
891 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
892 "properties": [ # The list of properties.
893 { # A key-value pair that is either public or private to an application.
894 "kind": "drive#property", # This is always drive#property.
895 "value": "A String", # The value of this property.
896 "etag": "A String", # ETag of the property.
897 "visibility": "A String", # The visibility of this property.
898 "key": "A String", # The key of this property.
899 "selfLink": "A String", # The link back to this property.
900 },
901 ],
902 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
903 "iconLink": "A String", # A link to the file's icon.
904 "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.
Joe Gregorio075572b2012-07-09 16:53:09 -0400905 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400906 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
Joe Gregorio37802c32013-08-06 12:24:05 -0400907 "title": "A String", # The title of this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400908 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500909 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
910 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400911 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400912 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -0400913 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400914 "kind": "drive#permission", # This is always drive#permission.
915 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -0400916 "id": "A String", # The ID of the permission.
917 "authKey": "A String", # The authkey parameter required for this permission.
918 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400919 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
920 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -0400921 "role": "A String", # The primary role for this user. Allowed values are:
922 # - owner
923 # - reader
924 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -0400925 "type": "A String", # The account type. Allowed values are:
926 # - user
927 # - group
928 # - domain
929 # - anyone
930 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
931 "A String",
932 ],
933 "selfLink": "A String", # A link back to this permission.
934 },
Joe Gregorio37802c32013-08-06 12:24:05 -0400935 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500936 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -0400937 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -0400938 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400939 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -0400940 }</pre>
941</div>
942
943<div class="method">
944 <code class="details" id="list">list(q=None, projection=None, pageToken=None, maxResults=None)</code>
945 <pre>Lists the user's files.
946
947Args:
948 q: string, Query string for searching files.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400949 projection: string, This parameter is deprecated and has no function.
Joe Gregorio075572b2012-07-09 16:53:09 -0400950 Allowed values
Joe Gregorioad8013f2012-08-03 08:44:02 -0400951 BASIC - Deprecated
952 FULL - Deprecated
Joe Gregorio075572b2012-07-09 16:53:09 -0400953 pageToken: string, Page token for files.
954 maxResults: integer, Maximum number of files to return.
955
956Returns:
957 An object of the form:
958
959 { # A list of files.
960 "nextPageToken": "A String", # The page token for the next page of files.
961 "kind": "drive#fileList", # This is always drive#fileList.
962 "items": [ # The actual list of files.
963 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -0400964 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio37802c32013-08-06 12:24:05 -0400965 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
966 "appDataContents": True or False, # Whether this file is in the appdata folder.
Joe Gregorio075572b2012-07-09 16:53:09 -0400967 "thumbnailLink": "A String", # A link to the file's thumbnail.
968 "labels": { # A group of labels for the file.
969 "restricted": True or False, # Whether viewers are prevented from downloading this file.
970 "hidden": True or False, # Whether this file is hidden from the user.
971 "viewed": True or False, # Whether this file has been viewed by this user.
972 "starred": True or False, # Whether this file is starred by the user.
973 "trashed": True or False, # Whether this file has been trashed.
974 },
975 "indexableText": { # Indexable text attributes for the file (can only be written)
Joe Gregorio41be8e82013-03-07 10:31:47 -0500976 "text": "A String", # The text to be indexed for this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400977 },
Joe Gregorioad8013f2012-08-03 08:44:02 -0400978 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500979 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400980 "writersCanShare": True or False, # Whether writers can share the document with other users.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500981 "owners": [ # The owner(s) of this file.
982 { # The JSON template for a user.
983 "picture": { # The user's profile picture.
984 "url": "A String", # A URL that points to a profile picture of this user.
985 },
986 "kind": "drive#user", # This is always drive#user.
987 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
988 "displayName": "A String", # A plain text displayable name for this user.
989 "permissionId": "A String", # The user's ID as visible in the permissions collection.
990 },
991 ],
992 "id": "A String", # The ID of the file.
993 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
994 "picture": { # The user's profile picture.
995 "url": "A String", # A URL that points to a profile picture of this user.
996 },
997 "kind": "drive#user", # This is always drive#user.
998 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
999 "displayName": "A String", # A plain text displayable name for this user.
1000 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1001 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001002 "copyable": True or False, # Whether the file can be copied by the current user.
Joe Gregorio075572b2012-07-09 16:53:09 -04001003 "ownerNames": [ # Name(s) of the owner(s) of this file.
1004 "A String",
1005 ],
1006 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
Joe Gregorio52a5c532013-01-24 16:19:07 -05001007 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04001008 "etag": "A String", # ETag of the file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001009 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -04001010 # Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04001011 { # A reference to a file's parent.
1012 "selfLink": "A String", # A link back to this reference.
1013 "kind": "drive#parentReference", # This is always drive#parentReference.
1014 "id": "A String", # The ID of the parent.
1015 "isRoot": True or False, # Whether or not the parent is the root folder.
1016 "parentLink": "A String", # A link to the parent.
1017 },
1018 ],
1019 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -04001020 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -04001021 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05001022 "shared": True or False, # Whether the file has been shared.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001023 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1024 "mimeType": "A String", # The MIME type of the thumbnail.
1025 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1026 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001027 "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.
1028 "a_key": "A String",
1029 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001030 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001031 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05001032 "exposureTime": 3.14, # The length of the exposure, in seconds.
1033 "cameraMake": "A String", # The make of the camera used to create the photo.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001034 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05001035 "isoSpeed": 42, # The ISO speed used to create the photo.
1036 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001037 "exposureMode": "A String", # The exposure mode used to create the photo.
1038 "colorSpace": "A String", # The color space of the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001039 "location": { # Geographic location information stored in the image.
1040 "latitude": 3.14, # The latitude stored in the image.
1041 "altitude": 3.14, # The altitude stored in the image.
1042 "longitude": 3.14, # The longitude stored in the image.
1043 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05001044 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1045 "height": 42, # The height of the image in pixels.
1046 "lens": "A String", # The lens used to create the photo.
1047 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1048 "width": 42, # The width of the image in pixels.
1049 "meteringMode": "A String", # The metering mode used to create the photo.
1050 "flashUsed": True or False, # Whether a flash was used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001051 "aperture": 3.14, # The aperture used to create the photo (f-number).
1052 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001053 "sensor": "A String", # The type of sensor used to create the photo.
1054 "whiteBalance": "A String", # The white balance mode used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001055 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001056 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001057 "description": "A String", # A short description of the file.
1058 "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.
1059 "editable": True or False, # Whether the file can be edited by the current user.
1060 "kind": "drive#file", # The type of file. This is always drive#file.
1061 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1062 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
1063 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1064 "properties": [ # The list of properties.
1065 { # A key-value pair that is either public or private to an application.
1066 "kind": "drive#property", # This is always drive#property.
1067 "value": "A String", # The value of this property.
1068 "etag": "A String", # ETag of the property.
1069 "visibility": "A String", # The visibility of this property.
1070 "key": "A String", # The key of this property.
1071 "selfLink": "A String", # The link back to this property.
1072 },
1073 ],
1074 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1075 "iconLink": "A String", # A link to the file's icon.
1076 "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.
Joe Gregorio075572b2012-07-09 16:53:09 -04001077 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001078 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
Joe Gregorio37802c32013-08-06 12:24:05 -04001079 "title": "A String", # The title of this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001080 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001081 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1082 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001083 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001084 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -04001085 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001086 "kind": "drive#permission", # This is always drive#permission.
1087 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -04001088 "id": "A String", # The ID of the permission.
1089 "authKey": "A String", # The authkey parameter required for this permission.
1090 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001091 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
1092 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -04001093 "role": "A String", # The primary role for this user. Allowed values are:
1094 # - owner
1095 # - reader
1096 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -04001097 "type": "A String", # The account type. Allowed values are:
1098 # - user
1099 # - group
1100 # - domain
1101 # - anyone
1102 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1103 "A String",
1104 ],
1105 "selfLink": "A String", # A link back to this permission.
1106 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001107 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001108 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04001109 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001110 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001111 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04001112 },
1113 ],
1114 "nextLink": "A String", # A link to the next page of files.
1115 "etag": "A String", # The ETag of the list.
1116 "selfLink": "A String", # A link back to this list.
1117 }</pre>
1118</div>
1119
1120<div class="method">
1121 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1122 <pre>Retrieves the next page of results.
1123
1124Args:
1125 previous_request: The request for the previous page. (required)
1126 previous_response: The response from the request for the previous page. (required)
1127
1128Returns:
1129 A request object that you can call 'execute()' on to request the next
1130 page. Returns None if there are no more items in the collection.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001131 </pre>
Joe Gregorio075572b2012-07-09 16:53:09 -04001132</div>
1133
1134<div class="method">
Joe Gregorio41be8e82013-03-07 10:31:47 -05001135 <code class="details" id="patch">patch(fileId, body, newRevision=None, pinned=None, ocrLanguage=None, ocr=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</code>
Joe Gregorio075572b2012-07-09 16:53:09 -04001136 <pre>Updates file metadata and/or content. This method supports patch semantics.
1137
1138Args:
1139 fileId: string, The ID of the file to update. (required)
1140 body: object, The request body. (required)
1141 The object takes the form of:
1142
1143{ # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001144 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio37802c32013-08-06 12:24:05 -04001145 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1146 "appDataContents": True or False, # Whether this file is in the appdata folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04001147 "thumbnailLink": "A String", # A link to the file's thumbnail.
1148 "labels": { # A group of labels for the file.
1149 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1150 "hidden": True or False, # Whether this file is hidden from the user.
1151 "viewed": True or False, # Whether this file has been viewed by this user.
1152 "starred": True or False, # Whether this file is starred by the user.
1153 "trashed": True or False, # Whether this file has been trashed.
1154 },
1155 "indexableText": { # Indexable text attributes for the file (can only be written)
Joe Gregorio41be8e82013-03-07 10:31:47 -05001156 "text": "A String", # The text to be indexed for this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001157 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001158 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001159 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001160 "writersCanShare": True or False, # Whether writers can share the document with other users.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001161 "owners": [ # The owner(s) of this file.
1162 { # The JSON template for a user.
1163 "picture": { # The user's profile picture.
1164 "url": "A String", # A URL that points to a profile picture of this user.
1165 },
1166 "kind": "drive#user", # This is always drive#user.
1167 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1168 "displayName": "A String", # A plain text displayable name for this user.
1169 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1170 },
1171 ],
1172 "id": "A String", # The ID of the file.
1173 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1174 "picture": { # The user's profile picture.
1175 "url": "A String", # A URL that points to a profile picture of this user.
1176 },
1177 "kind": "drive#user", # This is always drive#user.
1178 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1179 "displayName": "A String", # A plain text displayable name for this user.
1180 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1181 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001182 "copyable": True or False, # Whether the file can be copied by the current user.
Joe Gregorio075572b2012-07-09 16:53:09 -04001183 "ownerNames": [ # Name(s) of the owner(s) of this file.
1184 "A String",
1185 ],
1186 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
Joe Gregorio52a5c532013-01-24 16:19:07 -05001187 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04001188 "etag": "A String", # ETag of the file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001189 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -04001190 # Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04001191 { # A reference to a file's parent.
1192 "selfLink": "A String", # A link back to this reference.
1193 "kind": "drive#parentReference", # This is always drive#parentReference.
1194 "id": "A String", # The ID of the parent.
1195 "isRoot": True or False, # Whether or not the parent is the root folder.
1196 "parentLink": "A String", # A link to the parent.
1197 },
1198 ],
1199 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -04001200 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -04001201 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05001202 "shared": True or False, # Whether the file has been shared.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001203 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1204 "mimeType": "A String", # The MIME type of the thumbnail.
1205 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1206 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001207 "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.
1208 "a_key": "A String",
1209 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001210 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001211 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05001212 "exposureTime": 3.14, # The length of the exposure, in seconds.
1213 "cameraMake": "A String", # The make of the camera used to create the photo.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001214 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05001215 "isoSpeed": 42, # The ISO speed used to create the photo.
1216 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001217 "exposureMode": "A String", # The exposure mode used to create the photo.
1218 "colorSpace": "A String", # The color space of the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001219 "location": { # Geographic location information stored in the image.
1220 "latitude": 3.14, # The latitude stored in the image.
1221 "altitude": 3.14, # The altitude stored in the image.
1222 "longitude": 3.14, # The longitude stored in the image.
1223 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05001224 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1225 "height": 42, # The height of the image in pixels.
1226 "lens": "A String", # The lens used to create the photo.
1227 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1228 "width": 42, # The width of the image in pixels.
1229 "meteringMode": "A String", # The metering mode used to create the photo.
1230 "flashUsed": True or False, # Whether a flash was used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001231 "aperture": 3.14, # The aperture used to create the photo (f-number).
1232 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001233 "sensor": "A String", # The type of sensor used to create the photo.
1234 "whiteBalance": "A String", # The white balance mode used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001235 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001236 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001237 "description": "A String", # A short description of the file.
1238 "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.
1239 "editable": True or False, # Whether the file can be edited by the current user.
1240 "kind": "drive#file", # The type of file. This is always drive#file.
1241 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1242 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
1243 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1244 "properties": [ # The list of properties.
1245 { # A key-value pair that is either public or private to an application.
1246 "kind": "drive#property", # This is always drive#property.
1247 "value": "A String", # The value of this property.
1248 "etag": "A String", # ETag of the property.
1249 "visibility": "A String", # The visibility of this property.
1250 "key": "A String", # The key of this property.
1251 "selfLink": "A String", # The link back to this property.
1252 },
1253 ],
1254 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1255 "iconLink": "A String", # A link to the file's icon.
1256 "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.
Joe Gregorio075572b2012-07-09 16:53:09 -04001257 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001258 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
Joe Gregorio37802c32013-08-06 12:24:05 -04001259 "title": "A String", # The title of this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001260 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001261 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1262 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001263 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001264 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -04001265 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001266 "kind": "drive#permission", # This is always drive#permission.
1267 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -04001268 "id": "A String", # The ID of the permission.
1269 "authKey": "A String", # The authkey parameter required for this permission.
1270 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001271 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
1272 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -04001273 "role": "A String", # The primary role for this user. Allowed values are:
1274 # - owner
1275 # - reader
1276 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -04001277 "type": "A String", # The account type. Allowed values are:
1278 # - user
1279 # - group
1280 # - domain
1281 # - anyone
1282 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1283 "A String",
1284 ],
1285 "selfLink": "A String", # A link back to this permission.
1286 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001287 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001288 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04001289 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001290 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001291 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04001292}
1293
Joe Gregorio41be8e82013-03-07 10:31:47 -05001294 newRevision: boolean, Whether a blob upload should create a new revision. If not set or false, the blob data in the current head revision is replaced. If true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).
Joe Gregorio075572b2012-07-09 16:53:09 -04001295 pinned: boolean, Whether to pin the new revision.
Joe Gregorio075572b2012-07-09 16:53:09 -04001296 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001297 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Joe Gregorio075572b2012-07-09 16:53:09 -04001298 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
1299 timedTextTrackName: string, The timed text track name.
1300 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001301 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
Joe Gregorio075572b2012-07-09 16:53:09 -04001302 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
1303 timedTextLanguage: string, The language of the timed text.
1304
1305Returns:
1306 An object of the form:
1307
1308 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001309 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio37802c32013-08-06 12:24:05 -04001310 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1311 "appDataContents": True or False, # Whether this file is in the appdata folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04001312 "thumbnailLink": "A String", # A link to the file's thumbnail.
1313 "labels": { # A group of labels for the file.
1314 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1315 "hidden": True or False, # Whether this file is hidden from the user.
1316 "viewed": True or False, # Whether this file has been viewed by this user.
1317 "starred": True or False, # Whether this file is starred by the user.
1318 "trashed": True or False, # Whether this file has been trashed.
1319 },
1320 "indexableText": { # Indexable text attributes for the file (can only be written)
Joe Gregorio41be8e82013-03-07 10:31:47 -05001321 "text": "A String", # The text to be indexed for this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001322 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001323 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001324 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001325 "writersCanShare": True or False, # Whether writers can share the document with other users.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001326 "owners": [ # The owner(s) of this file.
1327 { # The JSON template for a user.
1328 "picture": { # The user's profile picture.
1329 "url": "A String", # A URL that points to a profile picture of this user.
1330 },
1331 "kind": "drive#user", # This is always drive#user.
1332 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1333 "displayName": "A String", # A plain text displayable name for this user.
1334 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1335 },
1336 ],
1337 "id": "A String", # The ID of the file.
1338 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1339 "picture": { # The user's profile picture.
1340 "url": "A String", # A URL that points to a profile picture of this user.
1341 },
1342 "kind": "drive#user", # This is always drive#user.
1343 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1344 "displayName": "A String", # A plain text displayable name for this user.
1345 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1346 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001347 "copyable": True or False, # Whether the file can be copied by the current user.
Joe Gregorio075572b2012-07-09 16:53:09 -04001348 "ownerNames": [ # Name(s) of the owner(s) of this file.
1349 "A String",
1350 ],
1351 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
Joe Gregorio52a5c532013-01-24 16:19:07 -05001352 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04001353 "etag": "A String", # ETag of the file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001354 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -04001355 # Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04001356 { # A reference to a file's parent.
1357 "selfLink": "A String", # A link back to this reference.
1358 "kind": "drive#parentReference", # This is always drive#parentReference.
1359 "id": "A String", # The ID of the parent.
1360 "isRoot": True or False, # Whether or not the parent is the root folder.
1361 "parentLink": "A String", # A link to the parent.
1362 },
1363 ],
1364 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -04001365 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -04001366 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05001367 "shared": True or False, # Whether the file has been shared.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001368 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1369 "mimeType": "A String", # The MIME type of the thumbnail.
1370 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1371 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001372 "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.
1373 "a_key": "A String",
1374 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001375 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001376 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05001377 "exposureTime": 3.14, # The length of the exposure, in seconds.
1378 "cameraMake": "A String", # The make of the camera used to create the photo.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001379 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05001380 "isoSpeed": 42, # The ISO speed used to create the photo.
1381 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001382 "exposureMode": "A String", # The exposure mode used to create the photo.
1383 "colorSpace": "A String", # The color space of the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001384 "location": { # Geographic location information stored in the image.
1385 "latitude": 3.14, # The latitude stored in the image.
1386 "altitude": 3.14, # The altitude stored in the image.
1387 "longitude": 3.14, # The longitude stored in the image.
1388 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05001389 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1390 "height": 42, # The height of the image in pixels.
1391 "lens": "A String", # The lens used to create the photo.
1392 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1393 "width": 42, # The width of the image in pixels.
1394 "meteringMode": "A String", # The metering mode used to create the photo.
1395 "flashUsed": True or False, # Whether a flash was used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001396 "aperture": 3.14, # The aperture used to create the photo (f-number).
1397 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001398 "sensor": "A String", # The type of sensor used to create the photo.
1399 "whiteBalance": "A String", # The white balance mode used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001400 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001401 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001402 "description": "A String", # A short description of the file.
1403 "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.
1404 "editable": True or False, # Whether the file can be edited by the current user.
1405 "kind": "drive#file", # The type of file. This is always drive#file.
1406 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1407 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
1408 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1409 "properties": [ # The list of properties.
1410 { # A key-value pair that is either public or private to an application.
1411 "kind": "drive#property", # This is always drive#property.
1412 "value": "A String", # The value of this property.
1413 "etag": "A String", # ETag of the property.
1414 "visibility": "A String", # The visibility of this property.
1415 "key": "A String", # The key of this property.
1416 "selfLink": "A String", # The link back to this property.
1417 },
1418 ],
1419 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1420 "iconLink": "A String", # A link to the file's icon.
1421 "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.
Joe Gregorio075572b2012-07-09 16:53:09 -04001422 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001423 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
Joe Gregorio37802c32013-08-06 12:24:05 -04001424 "title": "A String", # The title of this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001425 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001426 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1427 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001428 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001429 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -04001430 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001431 "kind": "drive#permission", # This is always drive#permission.
1432 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -04001433 "id": "A String", # The ID of the permission.
1434 "authKey": "A String", # The authkey parameter required for this permission.
1435 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001436 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
1437 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -04001438 "role": "A String", # The primary role for this user. Allowed values are:
1439 # - owner
1440 # - reader
1441 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -04001442 "type": "A String", # The account type. Allowed values are:
1443 # - user
1444 # - group
1445 # - domain
1446 # - anyone
1447 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1448 "A String",
1449 ],
1450 "selfLink": "A String", # A link back to this permission.
1451 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001452 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001453 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04001454 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001455 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001456 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04001457 }</pre>
1458</div>
1459
1460<div class="method">
1461 <code class="details" id="touch">touch(fileId)</code>
1462 <pre>Set the file's updated time to the current server time.
1463
1464Args:
1465 fileId: string, The ID of the file to update. (required)
1466
1467Returns:
1468 An object of the form:
1469
1470 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001471 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio37802c32013-08-06 12:24:05 -04001472 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1473 "appDataContents": True or False, # Whether this file is in the appdata folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04001474 "thumbnailLink": "A String", # A link to the file's thumbnail.
1475 "labels": { # A group of labels for the file.
1476 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1477 "hidden": True or False, # Whether this file is hidden from the user.
1478 "viewed": True or False, # Whether this file has been viewed by this user.
1479 "starred": True or False, # Whether this file is starred by the user.
1480 "trashed": True or False, # Whether this file has been trashed.
1481 },
1482 "indexableText": { # Indexable text attributes for the file (can only be written)
Joe Gregorio41be8e82013-03-07 10:31:47 -05001483 "text": "A String", # The text to be indexed for this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001484 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001485 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001486 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001487 "writersCanShare": True or False, # Whether writers can share the document with other users.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001488 "owners": [ # The owner(s) of this file.
1489 { # The JSON template for a user.
1490 "picture": { # The user's profile picture.
1491 "url": "A String", # A URL that points to a profile picture of this user.
1492 },
1493 "kind": "drive#user", # This is always drive#user.
1494 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1495 "displayName": "A String", # A plain text displayable name for this user.
1496 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1497 },
1498 ],
1499 "id": "A String", # The ID of the file.
1500 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1501 "picture": { # The user's profile picture.
1502 "url": "A String", # A URL that points to a profile picture of this user.
1503 },
1504 "kind": "drive#user", # This is always drive#user.
1505 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1506 "displayName": "A String", # A plain text displayable name for this user.
1507 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1508 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001509 "copyable": True or False, # Whether the file can be copied by the current user.
Joe Gregorio075572b2012-07-09 16:53:09 -04001510 "ownerNames": [ # Name(s) of the owner(s) of this file.
1511 "A String",
1512 ],
1513 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
Joe Gregorio52a5c532013-01-24 16:19:07 -05001514 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04001515 "etag": "A String", # ETag of the file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001516 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -04001517 # Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04001518 { # A reference to a file's parent.
1519 "selfLink": "A String", # A link back to this reference.
1520 "kind": "drive#parentReference", # This is always drive#parentReference.
1521 "id": "A String", # The ID of the parent.
1522 "isRoot": True or False, # Whether or not the parent is the root folder.
1523 "parentLink": "A String", # A link to the parent.
1524 },
1525 ],
1526 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -04001527 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -04001528 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05001529 "shared": True or False, # Whether the file has been shared.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001530 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1531 "mimeType": "A String", # The MIME type of the thumbnail.
1532 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1533 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001534 "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.
1535 "a_key": "A String",
1536 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001537 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001538 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05001539 "exposureTime": 3.14, # The length of the exposure, in seconds.
1540 "cameraMake": "A String", # The make of the camera used to create the photo.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001541 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05001542 "isoSpeed": 42, # The ISO speed used to create the photo.
1543 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001544 "exposureMode": "A String", # The exposure mode used to create the photo.
1545 "colorSpace": "A String", # The color space of the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001546 "location": { # Geographic location information stored in the image.
1547 "latitude": 3.14, # The latitude stored in the image.
1548 "altitude": 3.14, # The altitude stored in the image.
1549 "longitude": 3.14, # The longitude stored in the image.
1550 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05001551 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1552 "height": 42, # The height of the image in pixels.
1553 "lens": "A String", # The lens used to create the photo.
1554 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1555 "width": 42, # The width of the image in pixels.
1556 "meteringMode": "A String", # The metering mode used to create the photo.
1557 "flashUsed": True or False, # Whether a flash was used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001558 "aperture": 3.14, # The aperture used to create the photo (f-number).
1559 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001560 "sensor": "A String", # The type of sensor used to create the photo.
1561 "whiteBalance": "A String", # The white balance mode used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001562 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001563 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001564 "description": "A String", # A short description of the file.
1565 "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.
1566 "editable": True or False, # Whether the file can be edited by the current user.
1567 "kind": "drive#file", # The type of file. This is always drive#file.
1568 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1569 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
1570 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1571 "properties": [ # The list of properties.
1572 { # A key-value pair that is either public or private to an application.
1573 "kind": "drive#property", # This is always drive#property.
1574 "value": "A String", # The value of this property.
1575 "etag": "A String", # ETag of the property.
1576 "visibility": "A String", # The visibility of this property.
1577 "key": "A String", # The key of this property.
1578 "selfLink": "A String", # The link back to this property.
1579 },
1580 ],
1581 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1582 "iconLink": "A String", # A link to the file's icon.
1583 "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.
Joe Gregorio075572b2012-07-09 16:53:09 -04001584 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001585 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
Joe Gregorio37802c32013-08-06 12:24:05 -04001586 "title": "A String", # The title of this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001587 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001588 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1589 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001590 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001591 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -04001592 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001593 "kind": "drive#permission", # This is always drive#permission.
1594 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -04001595 "id": "A String", # The ID of the permission.
1596 "authKey": "A String", # The authkey parameter required for this permission.
1597 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001598 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
1599 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -04001600 "role": "A String", # The primary role for this user. Allowed values are:
1601 # - owner
1602 # - reader
1603 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -04001604 "type": "A String", # The account type. Allowed values are:
1605 # - user
1606 # - group
1607 # - domain
1608 # - anyone
1609 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1610 "A String",
1611 ],
1612 "selfLink": "A String", # A link back to this permission.
1613 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001614 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001615 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04001616 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001617 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001618 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04001619 }</pre>
1620</div>
1621
1622<div class="method">
1623 <code class="details" id="trash">trash(fileId)</code>
1624 <pre>Moves a file to the trash.
1625
1626Args:
1627 fileId: string, The ID of the file to trash. (required)
1628
1629Returns:
1630 An object of the form:
1631
1632 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001633 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio37802c32013-08-06 12:24:05 -04001634 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1635 "appDataContents": True or False, # Whether this file is in the appdata folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04001636 "thumbnailLink": "A String", # A link to the file's thumbnail.
1637 "labels": { # A group of labels for the file.
1638 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1639 "hidden": True or False, # Whether this file is hidden from the user.
1640 "viewed": True or False, # Whether this file has been viewed by this user.
1641 "starred": True or False, # Whether this file is starred by the user.
1642 "trashed": True or False, # Whether this file has been trashed.
1643 },
1644 "indexableText": { # Indexable text attributes for the file (can only be written)
Joe Gregorio41be8e82013-03-07 10:31:47 -05001645 "text": "A String", # The text to be indexed for this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001646 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001647 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001648 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001649 "writersCanShare": True or False, # Whether writers can share the document with other users.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001650 "owners": [ # The owner(s) of this file.
1651 { # The JSON template for a user.
1652 "picture": { # The user's profile picture.
1653 "url": "A String", # A URL that points to a profile picture of this user.
1654 },
1655 "kind": "drive#user", # This is always drive#user.
1656 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1657 "displayName": "A String", # A plain text displayable name for this user.
1658 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1659 },
1660 ],
1661 "id": "A String", # The ID of the file.
1662 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1663 "picture": { # The user's profile picture.
1664 "url": "A String", # A URL that points to a profile picture of this user.
1665 },
1666 "kind": "drive#user", # This is always drive#user.
1667 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1668 "displayName": "A String", # A plain text displayable name for this user.
1669 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1670 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001671 "copyable": True or False, # Whether the file can be copied by the current user.
Joe Gregorio075572b2012-07-09 16:53:09 -04001672 "ownerNames": [ # Name(s) of the owner(s) of this file.
1673 "A String",
1674 ],
1675 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
Joe Gregorio52a5c532013-01-24 16:19:07 -05001676 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04001677 "etag": "A String", # ETag of the file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001678 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -04001679 # Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04001680 { # A reference to a file's parent.
1681 "selfLink": "A String", # A link back to this reference.
1682 "kind": "drive#parentReference", # This is always drive#parentReference.
1683 "id": "A String", # The ID of the parent.
1684 "isRoot": True or False, # Whether or not the parent is the root folder.
1685 "parentLink": "A String", # A link to the parent.
1686 },
1687 ],
1688 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -04001689 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -04001690 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05001691 "shared": True or False, # Whether the file has been shared.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001692 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1693 "mimeType": "A String", # The MIME type of the thumbnail.
1694 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1695 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001696 "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.
1697 "a_key": "A String",
1698 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001699 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001700 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05001701 "exposureTime": 3.14, # The length of the exposure, in seconds.
1702 "cameraMake": "A String", # The make of the camera used to create the photo.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001703 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05001704 "isoSpeed": 42, # The ISO speed used to create the photo.
1705 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001706 "exposureMode": "A String", # The exposure mode used to create the photo.
1707 "colorSpace": "A String", # The color space of the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001708 "location": { # Geographic location information stored in the image.
1709 "latitude": 3.14, # The latitude stored in the image.
1710 "altitude": 3.14, # The altitude stored in the image.
1711 "longitude": 3.14, # The longitude stored in the image.
1712 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05001713 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1714 "height": 42, # The height of the image in pixels.
1715 "lens": "A String", # The lens used to create the photo.
1716 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1717 "width": 42, # The width of the image in pixels.
1718 "meteringMode": "A String", # The metering mode used to create the photo.
1719 "flashUsed": True or False, # Whether a flash was used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001720 "aperture": 3.14, # The aperture used to create the photo (f-number).
1721 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001722 "sensor": "A String", # The type of sensor used to create the photo.
1723 "whiteBalance": "A String", # The white balance mode used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001724 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001725 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001726 "description": "A String", # A short description of the file.
1727 "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.
1728 "editable": True or False, # Whether the file can be edited by the current user.
1729 "kind": "drive#file", # The type of file. This is always drive#file.
1730 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1731 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
1732 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1733 "properties": [ # The list of properties.
1734 { # A key-value pair that is either public or private to an application.
1735 "kind": "drive#property", # This is always drive#property.
1736 "value": "A String", # The value of this property.
1737 "etag": "A String", # ETag of the property.
1738 "visibility": "A String", # The visibility of this property.
1739 "key": "A String", # The key of this property.
1740 "selfLink": "A String", # The link back to this property.
1741 },
1742 ],
1743 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1744 "iconLink": "A String", # A link to the file's icon.
1745 "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.
Joe Gregorio075572b2012-07-09 16:53:09 -04001746 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001747 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
Joe Gregorio37802c32013-08-06 12:24:05 -04001748 "title": "A String", # The title of this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001749 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001750 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1751 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001752 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001753 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -04001754 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001755 "kind": "drive#permission", # This is always drive#permission.
1756 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -04001757 "id": "A String", # The ID of the permission.
1758 "authKey": "A String", # The authkey parameter required for this permission.
1759 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001760 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
1761 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -04001762 "role": "A String", # The primary role for this user. Allowed values are:
1763 # - owner
1764 # - reader
1765 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -04001766 "type": "A String", # The account type. Allowed values are:
1767 # - user
1768 # - group
1769 # - domain
1770 # - anyone
1771 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1772 "A String",
1773 ],
1774 "selfLink": "A String", # A link back to this permission.
1775 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001776 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001777 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04001778 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001779 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001780 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04001781 }</pre>
1782</div>
1783
1784<div class="method">
1785 <code class="details" id="untrash">untrash(fileId)</code>
1786 <pre>Restores a file from the trash.
1787
1788Args:
1789 fileId: string, The ID of the file to untrash. (required)
1790
1791Returns:
1792 An object of the form:
1793
1794 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001795 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio37802c32013-08-06 12:24:05 -04001796 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1797 "appDataContents": True or False, # Whether this file is in the appdata folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04001798 "thumbnailLink": "A String", # A link to the file's thumbnail.
1799 "labels": { # A group of labels for the file.
1800 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1801 "hidden": True or False, # Whether this file is hidden from the user.
1802 "viewed": True or False, # Whether this file has been viewed by this user.
1803 "starred": True or False, # Whether this file is starred by the user.
1804 "trashed": True or False, # Whether this file has been trashed.
1805 },
1806 "indexableText": { # Indexable text attributes for the file (can only be written)
Joe Gregorio41be8e82013-03-07 10:31:47 -05001807 "text": "A String", # The text to be indexed for this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001808 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001809 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001810 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001811 "writersCanShare": True or False, # Whether writers can share the document with other users.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001812 "owners": [ # The owner(s) of this file.
1813 { # The JSON template for a user.
1814 "picture": { # The user's profile picture.
1815 "url": "A String", # A URL that points to a profile picture of this user.
1816 },
1817 "kind": "drive#user", # This is always drive#user.
1818 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1819 "displayName": "A String", # A plain text displayable name for this user.
1820 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1821 },
1822 ],
1823 "id": "A String", # The ID of the file.
1824 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1825 "picture": { # The user's profile picture.
1826 "url": "A String", # A URL that points to a profile picture of this user.
1827 },
1828 "kind": "drive#user", # This is always drive#user.
1829 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1830 "displayName": "A String", # A plain text displayable name for this user.
1831 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1832 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001833 "copyable": True or False, # Whether the file can be copied by the current user.
Joe Gregorio075572b2012-07-09 16:53:09 -04001834 "ownerNames": [ # Name(s) of the owner(s) of this file.
1835 "A String",
1836 ],
1837 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
Joe Gregorio52a5c532013-01-24 16:19:07 -05001838 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04001839 "etag": "A String", # ETag of the file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001840 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -04001841 # Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04001842 { # A reference to a file's parent.
1843 "selfLink": "A String", # A link back to this reference.
1844 "kind": "drive#parentReference", # This is always drive#parentReference.
1845 "id": "A String", # The ID of the parent.
1846 "isRoot": True or False, # Whether or not the parent is the root folder.
1847 "parentLink": "A String", # A link to the parent.
1848 },
1849 ],
1850 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -04001851 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -04001852 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05001853 "shared": True or False, # Whether the file has been shared.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001854 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1855 "mimeType": "A String", # The MIME type of the thumbnail.
1856 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
1857 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001858 "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.
1859 "a_key": "A String",
1860 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001861 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001862 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05001863 "exposureTime": 3.14, # The length of the exposure, in seconds.
1864 "cameraMake": "A String", # The make of the camera used to create the photo.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001865 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05001866 "isoSpeed": 42, # The ISO speed used to create the photo.
1867 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001868 "exposureMode": "A String", # The exposure mode used to create the photo.
1869 "colorSpace": "A String", # The color space of the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001870 "location": { # Geographic location information stored in the image.
1871 "latitude": 3.14, # The latitude stored in the image.
1872 "altitude": 3.14, # The altitude stored in the image.
1873 "longitude": 3.14, # The longitude stored in the image.
1874 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05001875 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1876 "height": 42, # The height of the image in pixels.
1877 "lens": "A String", # The lens used to create the photo.
1878 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1879 "width": 42, # The width of the image in pixels.
1880 "meteringMode": "A String", # The metering mode used to create the photo.
1881 "flashUsed": True or False, # Whether a flash was used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001882 "aperture": 3.14, # The aperture used to create the photo (f-number).
1883 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
Joe Gregorio52a5c532013-01-24 16:19:07 -05001884 "sensor": "A String", # The type of sensor used to create the photo.
1885 "whiteBalance": "A String", # The white balance mode used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05001886 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001887 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001888 "description": "A String", # A short description of the file.
1889 "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.
1890 "editable": True or False, # Whether the file can be edited by the current user.
1891 "kind": "drive#file", # The type of file. This is always drive#file.
1892 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
1893 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
1894 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
1895 "properties": [ # The list of properties.
1896 { # A key-value pair that is either public or private to an application.
1897 "kind": "drive#property", # This is always drive#property.
1898 "value": "A String", # The value of this property.
1899 "etag": "A String", # ETag of the property.
1900 "visibility": "A String", # The visibility of this property.
1901 "key": "A String", # The key of this property.
1902 "selfLink": "A String", # The link back to this property.
1903 },
1904 ],
1905 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
1906 "iconLink": "A String", # A link to the file's icon.
1907 "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.
Joe Gregorio075572b2012-07-09 16:53:09 -04001908 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001909 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
Joe Gregorio37802c32013-08-06 12:24:05 -04001910 "title": "A String", # The title of this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001911 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001912 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
1913 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001914 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001915 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -04001916 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001917 "kind": "drive#permission", # This is always drive#permission.
1918 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -04001919 "id": "A String", # The ID of the permission.
1920 "authKey": "A String", # The authkey parameter required for this permission.
1921 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04001922 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
1923 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -04001924 "role": "A String", # The primary role for this user. Allowed values are:
1925 # - owner
1926 # - reader
1927 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -04001928 "type": "A String", # The account type. Allowed values are:
1929 # - user
1930 # - group
1931 # - domain
1932 # - anyone
1933 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1934 "A String",
1935 ],
1936 "selfLink": "A String", # A link back to this permission.
1937 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001938 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001939 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04001940 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04001941 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001942 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04001943 }</pre>
1944</div>
1945
1946<div class="method">
Joe Gregorio41be8e82013-03-07 10:31:47 -05001947 <code class="details" id="update">update(fileId, body=None, newRevision=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</code>
1948 <pre>Updates file metadata and/or content.
Joe Gregorio075572b2012-07-09 16:53:09 -04001949
1950Args:
1951 fileId: string, The ID of the file to update. (required)
1952 body: object, The request body.
1953 The object takes the form of:
1954
1955{ # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04001956 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio37802c32013-08-06 12:24:05 -04001957 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
1958 "appDataContents": True or False, # Whether this file is in the appdata folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04001959 "thumbnailLink": "A String", # A link to the file's thumbnail.
1960 "labels": { # A group of labels for the file.
1961 "restricted": True or False, # Whether viewers are prevented from downloading this file.
1962 "hidden": True or False, # Whether this file is hidden from the user.
1963 "viewed": True or False, # Whether this file has been viewed by this user.
1964 "starred": True or False, # Whether this file is starred by the user.
1965 "trashed": True or False, # Whether this file has been trashed.
1966 },
1967 "indexableText": { # Indexable text attributes for the file (can only be written)
Joe Gregorio41be8e82013-03-07 10:31:47 -05001968 "text": "A String", # The text to be indexed for this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001969 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04001970 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001971 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04001972 "writersCanShare": True or False, # Whether writers can share the document with other users.
Joe Gregorio41be8e82013-03-07 10:31:47 -05001973 "owners": [ # The owner(s) of this file.
1974 { # The JSON template for a user.
1975 "picture": { # The user's profile picture.
1976 "url": "A String", # A URL that points to a profile picture of this user.
1977 },
1978 "kind": "drive#user", # This is always drive#user.
1979 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1980 "displayName": "A String", # A plain text displayable name for this user.
1981 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1982 },
1983 ],
1984 "id": "A String", # The ID of the file.
1985 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1986 "picture": { # The user's profile picture.
1987 "url": "A String", # A URL that points to a profile picture of this user.
1988 },
1989 "kind": "drive#user", # This is always drive#user.
1990 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1991 "displayName": "A String", # A plain text displayable name for this user.
1992 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1993 },
Joe Gregorio37802c32013-08-06 12:24:05 -04001994 "copyable": True or False, # Whether the file can be copied by the current user.
Joe Gregorio075572b2012-07-09 16:53:09 -04001995 "ownerNames": [ # Name(s) of the owner(s) of this file.
1996 "A String",
1997 ],
1998 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
Joe Gregorio52a5c532013-01-24 16:19:07 -05001999 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04002000 "etag": "A String", # ETag of the file.
Joe Gregorio075572b2012-07-09 16:53:09 -04002001 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -04002002 # Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04002003 { # A reference to a file's parent.
2004 "selfLink": "A String", # A link back to this reference.
2005 "kind": "drive#parentReference", # This is always drive#parentReference.
2006 "id": "A String", # The ID of the parent.
2007 "isRoot": True or False, # Whether or not the parent is the root folder.
2008 "parentLink": "A String", # A link to the parent.
2009 },
2010 ],
2011 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -04002012 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -04002013 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05002014 "shared": True or False, # Whether the file has been shared.
Joe Gregoriod67010d2012-11-05 08:57:06 -05002015 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2016 "mimeType": "A String", # The MIME type of the thumbnail.
2017 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2018 },
Joe Gregorio37802c32013-08-06 12:24:05 -04002019 "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.
2020 "a_key": "A String",
2021 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04002022 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregorio52a5c532013-01-24 16:19:07 -05002023 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05002024 "exposureTime": 3.14, # The length of the exposure, in seconds.
2025 "cameraMake": "A String", # The make of the camera used to create the photo.
Joe Gregorio52a5c532013-01-24 16:19:07 -05002026 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05002027 "isoSpeed": 42, # The ISO speed used to create the photo.
2028 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
Joe Gregorio52a5c532013-01-24 16:19:07 -05002029 "exposureMode": "A String", # The exposure mode used to create the photo.
2030 "colorSpace": "A String", # The color space of the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04002031 "location": { # Geographic location information stored in the image.
2032 "latitude": 3.14, # The latitude stored in the image.
2033 "altitude": 3.14, # The altitude stored in the image.
2034 "longitude": 3.14, # The longitude stored in the image.
2035 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05002036 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2037 "height": 42, # The height of the image in pixels.
2038 "lens": "A String", # The lens used to create the photo.
2039 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2040 "width": 42, # The width of the image in pixels.
2041 "meteringMode": "A String", # The metering mode used to create the photo.
2042 "flashUsed": True or False, # Whether a flash was used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05002043 "aperture": 3.14, # The aperture used to create the photo (f-number).
2044 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
Joe Gregorio52a5c532013-01-24 16:19:07 -05002045 "sensor": "A String", # The type of sensor used to create the photo.
2046 "whiteBalance": "A String", # The white balance mode used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05002047 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04002048 },
Joe Gregorio37802c32013-08-06 12:24:05 -04002049 "description": "A String", # A short description of the file.
2050 "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.
2051 "editable": True or False, # Whether the file can be edited by the current user.
2052 "kind": "drive#file", # The type of file. This is always drive#file.
2053 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2054 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
2055 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
2056 "properties": [ # The list of properties.
2057 { # A key-value pair that is either public or private to an application.
2058 "kind": "drive#property", # This is always drive#property.
2059 "value": "A String", # The value of this property.
2060 "etag": "A String", # ETag of the property.
2061 "visibility": "A String", # The visibility of this property.
2062 "key": "A String", # The key of this property.
2063 "selfLink": "A String", # The link back to this property.
2064 },
2065 ],
2066 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2067 "iconLink": "A String", # A link to the file's icon.
2068 "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.
Joe Gregorio075572b2012-07-09 16:53:09 -04002069 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04002070 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
Joe Gregorio37802c32013-08-06 12:24:05 -04002071 "title": "A String", # The title of this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04002072 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio41be8e82013-03-07 10:31:47 -05002073 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2074 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04002075 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04002076 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -04002077 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04002078 "kind": "drive#permission", # This is always drive#permission.
2079 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -04002080 "id": "A String", # The ID of the permission.
2081 "authKey": "A String", # The authkey parameter required for this permission.
2082 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04002083 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
2084 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -04002085 "role": "A String", # The primary role for this user. Allowed values are:
2086 # - owner
2087 # - reader
2088 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -04002089 "type": "A String", # The account type. Allowed values are:
2090 # - user
2091 # - group
2092 # - domain
2093 # - anyone
2094 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2095 "A String",
2096 ],
2097 "selfLink": "A String", # A link back to this permission.
2098 },
Joe Gregorio37802c32013-08-06 12:24:05 -04002099 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio41be8e82013-03-07 10:31:47 -05002100 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04002101 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04002102 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04002103 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04002104}
2105
Joe Gregorio41be8e82013-03-07 10:31:47 -05002106 newRevision: boolean, Whether a blob upload should create a new revision. If not set or false, the blob data in the current head revision is replaced. If true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).
Joe Gregorio075572b2012-07-09 16:53:09 -04002107 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Joe Gregorio075572b2012-07-09 16:53:09 -04002108 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.
Joe Gregoriod67010d2012-11-05 08:57:06 -05002109 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Joe Gregorio075572b2012-07-09 16:53:09 -04002110 pinned: boolean, Whether to pin the new revision.
Joe Gregorio075572b2012-07-09 16:53:09 -04002111 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
2112 timedTextTrackName: string, The timed text track name.
2113 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
Joe Gregorio41be8e82013-03-07 10:31:47 -05002114 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
Joe Gregorio075572b2012-07-09 16:53:09 -04002115 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
2116 timedTextLanguage: string, The language of the timed text.
2117
2118Returns:
2119 An object of the form:
2120
2121 { # The metadata for a file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04002122 "mimeType": "A String", # The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
Joe Gregorio37802c32013-08-06 12:24:05 -04002123 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
2124 "appDataContents": True or False, # Whether this file is in the appdata folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04002125 "thumbnailLink": "A String", # A link to the file's thumbnail.
2126 "labels": { # A group of labels for the file.
2127 "restricted": True or False, # Whether viewers are prevented from downloading this file.
2128 "hidden": True or False, # Whether this file is hidden from the user.
2129 "viewed": True or False, # Whether this file has been viewed by this user.
2130 "starred": True or False, # Whether this file is starred by the user.
2131 "trashed": True or False, # Whether this file has been trashed.
2132 },
2133 "indexableText": { # Indexable text attributes for the file (can only be written)
Joe Gregorio41be8e82013-03-07 10:31:47 -05002134 "text": "A String", # The text to be indexed for this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04002135 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04002136 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed. This will only be populated if the file is trashed.
Joe Gregorio41be8e82013-03-07 10:31:47 -05002137 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04002138 "writersCanShare": True or False, # Whether writers can share the document with other users.
Joe Gregorio41be8e82013-03-07 10:31:47 -05002139 "owners": [ # The owner(s) of this file.
2140 { # The JSON template for a user.
2141 "picture": { # The user's profile picture.
2142 "url": "A String", # A URL that points to a profile picture of this user.
2143 },
2144 "kind": "drive#user", # This is always drive#user.
2145 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2146 "displayName": "A String", # A plain text displayable name for this user.
2147 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2148 },
2149 ],
2150 "id": "A String", # The ID of the file.
2151 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2152 "picture": { # The user's profile picture.
2153 "url": "A String", # A URL that points to a profile picture of this user.
2154 },
2155 "kind": "drive#user", # This is always drive#user.
2156 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2157 "displayName": "A String", # A plain text displayable name for this user.
2158 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2159 },
Joe Gregorio37802c32013-08-06 12:24:05 -04002160 "copyable": True or False, # Whether the file can be copied by the current user.
Joe Gregorio075572b2012-07-09 16:53:09 -04002161 "ownerNames": [ # Name(s) of the owner(s) of this file.
2162 "A String",
2163 ],
2164 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
Joe Gregorio52a5c532013-01-24 16:19:07 -05002165 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04002166 "etag": "A String", # ETag of the file.
Joe Gregorio075572b2012-07-09 16:53:09 -04002167 "parents": [ # Collection of parent folders which contain this file.
Joe Gregorioe7a0c472012-07-12 11:46:04 -04002168 # Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder.
Joe Gregorio075572b2012-07-09 16:53:09 -04002169 { # A reference to a file's parent.
2170 "selfLink": "A String", # A link back to this reference.
2171 "kind": "drive#parentReference", # This is always drive#parentReference.
2172 "id": "A String", # The ID of the parent.
2173 "isRoot": True or False, # Whether or not the parent is the root folder.
2174 "parentLink": "A String", # A link to the parent.
2175 },
2176 ],
2177 "exportLinks": { # Links for exporting Google Docs to specific formats.
Joe Gregoriofa08c2e2012-07-23 16:52:03 -04002178 "a_key": "A String", # A mapping from export format to URL
Joe Gregorio075572b2012-07-09 16:53:09 -04002179 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05002180 "shared": True or False, # Whether the file has been shared.
Joe Gregoriod67010d2012-11-05 08:57:06 -05002181 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2182 "mimeType": "A String", # The MIME type of the thumbnail.
2183 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image.
2184 },
Joe Gregorio37802c32013-08-06 12:24:05 -04002185 "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.
2186 "a_key": "A String",
2187 },
Joe Gregorioad8013f2012-08-03 08:44:02 -04002188 "imageMediaMetadata": { # Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content.
Joe Gregorio52a5c532013-01-24 16:19:07 -05002189 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05002190 "exposureTime": 3.14, # The length of the exposure, in seconds.
2191 "cameraMake": "A String", # The make of the camera used to create the photo.
Joe Gregorio52a5c532013-01-24 16:19:07 -05002192 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
Joe Gregoriod67010d2012-11-05 08:57:06 -05002193 "isoSpeed": 42, # The ISO speed used to create the photo.
2194 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
Joe Gregorio52a5c532013-01-24 16:19:07 -05002195 "exposureMode": "A String", # The exposure mode used to create the photo.
2196 "colorSpace": "A String", # The color space of the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04002197 "location": { # Geographic location information stored in the image.
2198 "latitude": 3.14, # The latitude stored in the image.
2199 "altitude": 3.14, # The altitude stored in the image.
2200 "longitude": 3.14, # The longitude stored in the image.
2201 },
Joe Gregorio52a5c532013-01-24 16:19:07 -05002202 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2203 "height": 42, # The height of the image in pixels.
2204 "lens": "A String", # The lens used to create the photo.
2205 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2206 "width": 42, # The width of the image in pixels.
2207 "meteringMode": "A String", # The metering mode used to create the photo.
2208 "flashUsed": True or False, # Whether a flash was used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05002209 "aperture": 3.14, # The aperture used to create the photo (f-number).
2210 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
Joe Gregorio52a5c532013-01-24 16:19:07 -05002211 "sensor": "A String", # The type of sensor used to create the photo.
2212 "whiteBalance": "A String", # The white balance mode used to create the photo.
Joe Gregoriod67010d2012-11-05 08:57:06 -05002213 "cameraModel": "A String", # The model of the camera used to create the photo.
Joe Gregorioad8013f2012-08-03 08:44:02 -04002214 },
Joe Gregorio37802c32013-08-06 12:24:05 -04002215 "description": "A String", # A short description of the file.
2216 "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.
2217 "editable": True or False, # Whether the file can be edited by the current user.
2218 "kind": "drive#file", # The type of file. This is always drive#file.
2219 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
2220 "fileSize": "A String", # The size of the file in bytes. This is only populated for files with content stored in Drive.
2221 "createdDate": "A String", # Create time for this file (formatted ISO8601 timestamp).
2222 "properties": [ # The list of properties.
2223 { # A key-value pair that is either public or private to an application.
2224 "kind": "drive#property", # This is always drive#property.
2225 "value": "A String", # The value of this property.
2226 "etag": "A String", # ETag of the property.
2227 "visibility": "A String", # The visibility of this property.
2228 "key": "A String", # The key of this property.
2229 "selfLink": "A String", # The link back to this property.
2230 },
2231 ],
2232 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This is populated only for files with content stored in Drive.
2233 "iconLink": "A String", # A link to the file's icon.
2234 "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.
Joe Gregorio075572b2012-07-09 16:53:09 -04002235 "embedLink": "A String", # A link for embedding the file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04002236 "alternateLink": "A String", # A link for opening the file in using a relevant Google editor or viewer.
Joe Gregorio37802c32013-08-06 12:24:05 -04002237 "title": "A String", # The title of this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04002238 "modifiedByMeDate": "A String", # Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
Joe Gregorio41be8e82013-03-07 10:31:47 -05002239 "downloadUrl": "A String", # Short lived download URL for the file. This is only populated for files with content stored in Drive.
2240 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
Joe Gregorio075572b2012-07-09 16:53:09 -04002241 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04002242 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -04002243 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04002244 "kind": "drive#permission", # This is always drive#permission.
2245 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -04002246 "id": "A String", # The ID of the permission.
2247 "authKey": "A String", # The authkey parameter required for this permission.
2248 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -04002249 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
2250 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -04002251 "role": "A String", # The primary role for this user. Allowed values are:
2252 # - owner
2253 # - reader
2254 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -04002255 "type": "A String", # The account type. Allowed values are:
2256 # - user
2257 # - group
2258 # - domain
2259 # - anyone
2260 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2261 "A String",
2262 ],
2263 "selfLink": "A String", # A link back to this permission.
2264 },
Joe Gregorio37802c32013-08-06 12:24:05 -04002265 "originalFilename": "A String", # The original filename if the file was uploaded manually, or the original title if the file was inserted through the API. Note that renames of the title will not change the original filename. This will only be populated on files with content stored in Drive.
Joe Gregorio41be8e82013-03-07 10:31:47 -05002266 "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.
Joe Gregorio37802c32013-08-06 12:24:05 -04002267 "headRevisionId": "A String", # The ID of the file's head revision. This will only be populated for files with content stored in Drive.
Joe Gregorio075572b2012-07-09 16:53:09 -04002268 "selfLink": "A String", # A link back to this file.
Joe Gregorioad8013f2012-08-03 08:44:02 -04002269 "modifiedDate": "A String", # Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
Joe Gregorio075572b2012-07-09 16:53:09 -04002270 }</pre>
2271</div>
2272
Joe Gregorio37802c32013-08-06 12:24:05 -04002273<div class="method">
2274 <code class="details" id="watch">watch(fileId, body, projection=None, updateViewedDate=None)</code>
2275 <pre>Subscribe to changes on a file
2276
2277Args:
2278 fileId: string, The ID for the file in question. (required)
2279 body: object, The request body. (required)
2280 The object takes the form of:
2281
2282{
2283 "resourceUri": "A String", # The canonicalized ID of the watched resource.
2284 "kind": "api#channel", # A channel watching an API resource
2285 "resourceId": "A String", # An opaque id that identifies the resource that is being watched. Stable across different API versions
2286 "token": "A String", # An arbitrary string associated with the channel that is delivered to the target address with each event delivered over this channel.
2287 "params": { # Additional parameters controlling delivery channel behavior
2288 "a_key": "A String", # Declares a new parameter by name.
2289 },
2290 "expiration": "A String", # The expiration instant for this channel if it is defined.
2291 "address": "A String", # The address of the receiving entity where events are delivered. Specific to the channel type.
2292 "type": "A String", # The type of delivery mechanism used by this channel
2293 "id": "A String", # A UUID for the channel
2294 }
2295
2296 projection: string, This parameter is deprecated and has no function.
2297 Allowed values
2298 BASIC - Deprecated
2299 FULL - Deprecated
2300 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
2301
2302Returns:
2303 An object of the form:
2304
2305 {
2306 "resourceUri": "A String", # The canonicalized ID of the watched resource.
2307 "kind": "api#channel", # A channel watching an API resource
2308 "resourceId": "A String", # An opaque id that identifies the resource that is being watched. Stable across different API versions
2309 "token": "A String", # An arbitrary string associated with the channel that is delivered to the target address with each event delivered over this channel.
2310 "params": { # Additional parameters controlling delivery channel behavior
2311 "a_key": "A String", # Declares a new parameter by name.
2312 },
2313 "expiration": "A String", # The expiration instant for this channel if it is defined.
2314 "address": "A String", # The address of the receiving entity where events are delivered. Specific to the channel type.
2315 "type": "A String", # The type of delivery mechanism used by this channel
2316 "id": "A String", # A UUID for the channel
2317 }</pre>
2318</div>
2319
Joe Gregorio075572b2012-07-09 16:53:09 -04002320</body></html>