blob: fd23ad045116f7a69ef786354690fe384c32c4f8 [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="drive_v2.html">Drive API</a> . <a href="drive_v2.files.html">files</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#copy">copy(fileId, body, pinned=None, convert=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None)</a></code></p>
79<p class="firstline">Creates a copy of the specified file.</p>
80<p class="toc_element">
81 <code><a href="#delete">delete(fileId)</a></code></p>
Nathaniel Manista4f877e52015-06-15 16:44:50 +000082<p class="firstline">Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file.</p>
John Asmuth614db982014-04-24 15:46:26 -040083<p class="toc_element">
Craig Citro065b5302014-08-14 00:47:23 -070084 <code><a href="#emptyTrash">emptyTrash()</a></code></p>
85<p class="firstline">Permanently deletes all of the user's trashed files.</p>
86<p class="toc_element">
Takashi Matsuo06694102015-09-11 13:55:40 -070087 <code><a href="#generateIds">generateIds(space=None, maxResults=None)</a></code></p>
88<p class="firstline">Generates a set of file IDs which can be provided in insert requests.</p>
89<p class="toc_element">
Nathaniel Manista4f877e52015-06-15 16:44:50 +000090 <code><a href="#get">get(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
Craig Citroe633be12015-03-02 13:40:36 -080091<p class="firstline">Gets a file's metadata by ID.</p>
92<p class="toc_element">
Nathaniel Manista4f877e52015-06-15 16:44:50 +000093 <code><a href="#get_media">get_media(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040094<p class="firstline">Gets a file's metadata by ID.</p>
95<p class="toc_element">
96 <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>
97<p class="firstline">Insert a new file.</p>
98<p class="toc_element">
Takashi Matsuo06694102015-09-11 13:55:40 -070099 <code><a href="#list">list(orderBy=None, q=None, projection=None, pageToken=None, maxResults=None, spaces=None, corpus=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400100<p class="firstline">Lists the user's files.</p>
101<p class="toc_element">
102 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
103<p class="firstline">Retrieves the next page of results.</p>
104<p class="toc_element">
Takashi Matsuo06694102015-09-11 13:55:40 -0700105 <code><a href="#patch">patch(fileId, body, newRevision=None, modifiedDateBehavior=None, pinned=None, ocrLanguage=None, ocr=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400106<p class="firstline">Updates file metadata and/or content. This method supports patch semantics.</p>
107<p class="toc_element">
108 <code><a href="#touch">touch(fileId)</a></code></p>
109<p class="firstline">Set the file's updated time to the current server time.</p>
110<p class="toc_element">
111 <code><a href="#trash">trash(fileId)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -0700112<p class="firstline">Moves a file to the trash. The currently authenticated user must own the file.</p>
John Asmuth614db982014-04-24 15:46:26 -0400113<p class="toc_element">
114 <code><a href="#untrash">untrash(fileId)</a></code></p>
115<p class="firstline">Restores a file from the trash.</p>
116<p class="toc_element">
Takashi Matsuo06694102015-09-11 13:55:40 -0700117 <code><a href="#update">update(fileId, body=None, newRevision=None, modifiedDateBehavior=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400118<p class="firstline">Updates file metadata and/or content.</p>
119<p class="toc_element">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000120 <code><a href="#watch">watch(fileId, body, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
Craig Citroe633be12015-03-02 13:40:36 -0800121<p class="firstline">Subscribe to changes on a file</p>
122<p class="toc_element">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000123 <code><a href="#watch_media">watch_media(fileId, body, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400124<p class="firstline">Subscribe to changes on a file</p>
125<h3>Method Details</h3>
126<div class="method">
127 <code class="details" id="copy">copy(fileId, body, pinned=None, convert=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None)</code>
128 <pre>Creates a copy of the specified file.
129
130Args:
131 fileId: string, The ID of the file to copy. (required)
132 body: object, The request body. (required)
133 The object takes the form of:
134
135{ # The metadata for a file.
136 "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.
137 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700138 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
139 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000140 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -0400141 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700142 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -0400143 "hidden": True or False, # Deprecated.
144 "viewed": True or False, # Whether this file has been viewed by this user.
145 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000146 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -0400147 },
148 "indexableText": { # Indexable text attributes for the file (can only be written)
149 "text": "A String", # The text to be indexed for this file.
150 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700151 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
John Asmuth614db982014-04-24 15:46:26 -0400152 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
153 "writersCanShare": True or False, # Whether writers can share the document with other users.
154 "owners": [ # The owner(s) of this file.
155 { # The JSON template for a user.
156 "picture": { # The user's profile picture.
157 "url": "A String", # A URL that points to a profile picture of this user.
158 },
159 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400160 "displayName": "A String", # A plain text displayable name for this user.
161 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700162 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
163 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400164 },
165 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700166 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -0400167 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700168 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
169 "picture": { # The user's profile picture.
170 "url": "A String", # A URL that points to a profile picture of this user.
171 },
172 "kind": "drive#user", # This is always drive#user.
173 "displayName": "A String", # A plain text displayable name for this user.
174 "permissionId": "A String", # The user's ID as visible in the permissions collection.
175 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
176 "emailAddress": "A String", # The email address of the user.
177 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700178 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
179 "width": 42, # The width of the video in pixels.
180 "durationMillis": "A String", # The duration of the video in milliseconds.
181 "height": 42, # The height of the video in pixels.
182 },
John Asmuth614db982014-04-24 15:46:26 -0400183 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
184 "picture": { # The user's profile picture.
185 "url": "A String", # A URL that points to a profile picture of this user.
186 },
187 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400188 "displayName": "A String", # A plain text displayable name for this user.
189 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700190 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
191 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400192 },
193 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800194 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Takashi Matsuo06694102015-09-11 13:55:40 -0700195 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400196 "ownerNames": [ # Name(s) of the owner(s) of this file.
197 "A String",
198 ],
199 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
200 "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.
201 "etag": "A String", # ETag of the file.
202 "parents": [ # Collection of parent folders which contain this file.
203 # 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.
204 { # A reference to a file's parent.
205 "selfLink": "A String", # A link back to this reference.
206 "kind": "drive#parentReference", # This is always drive#parentReference.
207 "id": "A String", # The ID of the parent.
208 "isRoot": True or False, # Whether or not the parent is the root folder.
209 "parentLink": "A String", # A link to the parent.
210 },
211 ],
212 "exportLinks": { # Links for exporting Google Docs to specific formats.
213 "a_key": "A String", # A mapping from export format to URL
214 },
215 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700216 "permissions": [ # The list of permissions for users with access to this file.
217 { # A permission for a file.
218 "withLink": True or False, # Whether the link is required for this permission.
219 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
220 "name": "A String", # The name for this permission.
221 "kind": "drive#permission", # This is always drive#permission.
222 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
223 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
224 "authKey": "A String", # The authkey parameter required for this permission.
225 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800226 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -0700227 "photoLink": "A String", # A link to the profile photo, if available.
228 "role": "A String", # The primary role for this user. Allowed values are:
229 # - owner
230 # - reader
231 # - writer
232 "type": "A String", # The account type. Allowed values are:
233 # - user
234 # - group
235 # - domain
236 # - anyone
237 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
238 "A String",
239 ],
240 "selfLink": "A String", # A link back to this permission.
241 },
242 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700243 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -0400244 "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.
245 "a_key": "A String",
246 },
247 "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.
248 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
249 "exposureTime": 3.14, # The length of the exposure, in seconds.
250 "cameraMake": "A String", # The make of the camera used to create the photo.
251 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
252 "isoSpeed": 42, # The ISO speed used to create the photo.
253 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
254 "exposureMode": "A String", # The exposure mode used to create the photo.
255 "colorSpace": "A String", # The color space of the photo.
256 "location": { # Geographic location information stored in the image.
257 "latitude": 3.14, # The latitude stored in the image.
258 "altitude": 3.14, # The altitude stored in the image.
259 "longitude": 3.14, # The longitude stored in the image.
260 },
261 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
262 "height": 42, # The height of the image in pixels.
263 "lens": "A String", # The lens used to create the photo.
264 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
265 "width": 42, # The width of the image in pixels.
266 "meteringMode": "A String", # The metering mode used to create the photo.
267 "flashUsed": True or False, # Whether a flash was used to create the photo.
268 "aperture": 3.14, # The aperture used to create the photo (f-number).
269 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
270 "sensor": "A String", # The type of sensor used to create the photo.
271 "whiteBalance": "A String", # The white balance mode used to create the photo.
272 "cameraModel": "A String", # The model of the camera used to create the photo.
273 },
274 "description": "A String", # A short description of the file.
275 "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.
276 "editable": True or False, # Whether the file can be edited by the current user.
277 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700278 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -0400279 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700280 "fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700281 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400282 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000283 { # A key-value pair attached to a file that is either public or private to an application.
284 # The following limits apply to file properties:
285 # - Maximum of 100 properties total per file
286 # - Maximum of 30 private properties per app
287 # - Maximum of 30 public properties
288 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -0400289 "kind": "drive#property", # This is always drive#property.
290 "value": "A String", # The value of this property.
291 "etag": "A String", # ETag of the property.
292 "visibility": "A String", # The visibility of this property.
293 "key": "A String", # The key of this property.
294 "selfLink": "A String", # The link back to this property.
295 },
296 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700297 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -0400298 "iconLink": "A String", # A link to the file's icon.
299 "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.
300 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700301 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400302 "title": "A String", # The title of this file.
303 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700304 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
305 "mimeType": "A String", # The MIME type of the thumbnail.
306 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
307 },
308 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -0400309 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
310 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700311 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400312 "name": "A String", # The name for this permission.
313 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700314 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
315 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -0400316 "authKey": "A String", # The authkey parameter required for this permission.
317 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800318 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -0400319 "photoLink": "A String", # A link to the profile photo, if available.
320 "role": "A String", # The primary role for this user. Allowed values are:
321 # - owner
322 # - reader
323 # - writer
324 "type": "A String", # The account type. Allowed values are:
325 # - user
326 # - group
327 # - domain
328 # - anyone
329 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
330 "A String",
331 ],
332 "selfLink": "A String", # A link back to this permission.
333 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700334 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000335 "A String",
336 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700337 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
338 "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
339 "fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
340 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -0400341 "selfLink": "A String", # A link back to this file.
342 "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.
343}
344
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700345 pinned: boolean, Whether to pin the head revision of the new copy. A file can have a maximum of 200 pinned revisions.
John Asmuth614db982014-04-24 15:46:26 -0400346 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
347 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.
348 Allowed values
349 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
350 PRIVATE - The new file will be visible to only the owner.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000351 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
John Asmuth614db982014-04-24 15:46:26 -0400352 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
353 timedTextLanguage: string, The language of the timed text.
354 timedTextTrackName: string, The timed text track name.
355
356Returns:
357 An object of the form:
358
359 { # The metadata for a file.
360 "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.
361 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700362 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
363 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000364 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -0400365 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700366 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -0400367 "hidden": True or False, # Deprecated.
368 "viewed": True or False, # Whether this file has been viewed by this user.
369 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000370 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -0400371 },
372 "indexableText": { # Indexable text attributes for the file (can only be written)
373 "text": "A String", # The text to be indexed for this file.
374 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700375 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
John Asmuth614db982014-04-24 15:46:26 -0400376 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
377 "writersCanShare": True or False, # Whether writers can share the document with other users.
378 "owners": [ # The owner(s) of this file.
379 { # The JSON template for a user.
380 "picture": { # The user's profile picture.
381 "url": "A String", # A URL that points to a profile picture of this user.
382 },
383 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400384 "displayName": "A String", # A plain text displayable name for this user.
385 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700386 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
387 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400388 },
389 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700390 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -0400391 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700392 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
393 "picture": { # The user's profile picture.
394 "url": "A String", # A URL that points to a profile picture of this user.
395 },
396 "kind": "drive#user", # This is always drive#user.
397 "displayName": "A String", # A plain text displayable name for this user.
398 "permissionId": "A String", # The user's ID as visible in the permissions collection.
399 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
400 "emailAddress": "A String", # The email address of the user.
401 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700402 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
403 "width": 42, # The width of the video in pixels.
404 "durationMillis": "A String", # The duration of the video in milliseconds.
405 "height": 42, # The height of the video in pixels.
406 },
John Asmuth614db982014-04-24 15:46:26 -0400407 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
408 "picture": { # The user's profile picture.
409 "url": "A String", # A URL that points to a profile picture of this user.
410 },
411 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400412 "displayName": "A String", # A plain text displayable name for this user.
413 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700414 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
415 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400416 },
417 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800418 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Takashi Matsuo06694102015-09-11 13:55:40 -0700419 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400420 "ownerNames": [ # Name(s) of the owner(s) of this file.
421 "A String",
422 ],
423 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
424 "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.
425 "etag": "A String", # ETag of the file.
426 "parents": [ # Collection of parent folders which contain this file.
427 # 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.
428 { # A reference to a file's parent.
429 "selfLink": "A String", # A link back to this reference.
430 "kind": "drive#parentReference", # This is always drive#parentReference.
431 "id": "A String", # The ID of the parent.
432 "isRoot": True or False, # Whether or not the parent is the root folder.
433 "parentLink": "A String", # A link to the parent.
434 },
435 ],
436 "exportLinks": { # Links for exporting Google Docs to specific formats.
437 "a_key": "A String", # A mapping from export format to URL
438 },
439 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700440 "permissions": [ # The list of permissions for users with access to this file.
441 { # A permission for a file.
442 "withLink": True or False, # Whether the link is required for this permission.
443 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
444 "name": "A String", # The name for this permission.
445 "kind": "drive#permission", # This is always drive#permission.
446 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
447 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
448 "authKey": "A String", # The authkey parameter required for this permission.
449 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800450 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -0700451 "photoLink": "A String", # A link to the profile photo, if available.
452 "role": "A String", # The primary role for this user. Allowed values are:
453 # - owner
454 # - reader
455 # - writer
456 "type": "A String", # The account type. Allowed values are:
457 # - user
458 # - group
459 # - domain
460 # - anyone
461 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
462 "A String",
463 ],
464 "selfLink": "A String", # A link back to this permission.
465 },
466 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700467 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -0400468 "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.
469 "a_key": "A String",
470 },
471 "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.
472 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
473 "exposureTime": 3.14, # The length of the exposure, in seconds.
474 "cameraMake": "A String", # The make of the camera used to create the photo.
475 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
476 "isoSpeed": 42, # The ISO speed used to create the photo.
477 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
478 "exposureMode": "A String", # The exposure mode used to create the photo.
479 "colorSpace": "A String", # The color space of the photo.
480 "location": { # Geographic location information stored in the image.
481 "latitude": 3.14, # The latitude stored in the image.
482 "altitude": 3.14, # The altitude stored in the image.
483 "longitude": 3.14, # The longitude stored in the image.
484 },
485 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
486 "height": 42, # The height of the image in pixels.
487 "lens": "A String", # The lens used to create the photo.
488 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
489 "width": 42, # The width of the image in pixels.
490 "meteringMode": "A String", # The metering mode used to create the photo.
491 "flashUsed": True or False, # Whether a flash was used to create the photo.
492 "aperture": 3.14, # The aperture used to create the photo (f-number).
493 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
494 "sensor": "A String", # The type of sensor used to create the photo.
495 "whiteBalance": "A String", # The white balance mode used to create the photo.
496 "cameraModel": "A String", # The model of the camera used to create the photo.
497 },
498 "description": "A String", # A short description of the file.
499 "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.
500 "editable": True or False, # Whether the file can be edited by the current user.
501 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700502 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -0400503 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700504 "fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700505 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400506 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000507 { # A key-value pair attached to a file that is either public or private to an application.
508 # The following limits apply to file properties:
509 # - Maximum of 100 properties total per file
510 # - Maximum of 30 private properties per app
511 # - Maximum of 30 public properties
512 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -0400513 "kind": "drive#property", # This is always drive#property.
514 "value": "A String", # The value of this property.
515 "etag": "A String", # ETag of the property.
516 "visibility": "A String", # The visibility of this property.
517 "key": "A String", # The key of this property.
518 "selfLink": "A String", # The link back to this property.
519 },
520 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700521 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -0400522 "iconLink": "A String", # A link to the file's icon.
523 "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.
524 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700525 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400526 "title": "A String", # The title of this file.
527 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700528 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
529 "mimeType": "A String", # The MIME type of the thumbnail.
530 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
531 },
532 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -0400533 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
534 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700535 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400536 "name": "A String", # The name for this permission.
537 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700538 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
539 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -0400540 "authKey": "A String", # The authkey parameter required for this permission.
541 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800542 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -0400543 "photoLink": "A String", # A link to the profile photo, if available.
544 "role": "A String", # The primary role for this user. Allowed values are:
545 # - owner
546 # - reader
547 # - writer
548 "type": "A String", # The account type. Allowed values are:
549 # - user
550 # - group
551 # - domain
552 # - anyone
553 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
554 "A String",
555 ],
556 "selfLink": "A String", # A link back to this permission.
557 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700558 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000559 "A String",
560 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700561 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
562 "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
563 "fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
564 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -0400565 "selfLink": "A String", # A link back to this file.
566 "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.
567 }</pre>
568</div>
569
570<div class="method">
571 <code class="details" id="delete">delete(fileId)</code>
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000572 <pre>Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file.
John Asmuth614db982014-04-24 15:46:26 -0400573
574Args:
575 fileId: string, The ID of the file to delete. (required)
576</pre>
577</div>
578
579<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -0700580 <code class="details" id="emptyTrash">emptyTrash()</code>
581 <pre>Permanently deletes all of the user's trashed files.
582
583Args:
584</pre>
585</div>
586
587<div class="method">
Takashi Matsuo06694102015-09-11 13:55:40 -0700588 <code class="details" id="generateIds">generateIds(space=None, maxResults=None)</code>
589 <pre>Generates a set of file IDs which can be provided in insert requests.
590
591Args:
592 space: string, The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.
593 maxResults: integer, Maximum number of IDs to return.
594
595Returns:
596 An object of the form:
597
598 { # A list of generated IDs which can be provided in insert requests
599 "kind": "drive#generatedIds", # This is always drive#generatedIds
600 "ids": [ # The IDs generated for the requesting user in the specified space.
601 "A String",
602 ],
603 "space": "A String", # The type of file that can be created with these IDs.
604 }</pre>
605</div>
606
607<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000608 <code class="details" id="get">get(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400609 <pre>Gets a file's metadata by ID.
610
611Args:
612 fileId: string, The ID for the file in question. (required)
613 projection: string, This parameter is deprecated and has no function.
614 Allowed values
615 BASIC - Deprecated
616 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000617 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -0800618 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
John Asmuth614db982014-04-24 15:46:26 -0400619 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
620
621Returns:
622 An object of the form:
623
624 { # The metadata for a file.
625 "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.
626 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700627 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
628 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000629 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -0400630 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700631 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -0400632 "hidden": True or False, # Deprecated.
633 "viewed": True or False, # Whether this file has been viewed by this user.
634 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000635 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -0400636 },
637 "indexableText": { # Indexable text attributes for the file (can only be written)
638 "text": "A String", # The text to be indexed for this file.
639 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700640 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
John Asmuth614db982014-04-24 15:46:26 -0400641 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
642 "writersCanShare": True or False, # Whether writers can share the document with other users.
643 "owners": [ # The owner(s) of this file.
644 { # The JSON template for a user.
645 "picture": { # The user's profile picture.
646 "url": "A String", # A URL that points to a profile picture of this user.
647 },
648 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400649 "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.
Craig Citro065b5302014-08-14 00:47:23 -0700651 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
652 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400653 },
654 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700655 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -0400656 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700657 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
658 "picture": { # The user's profile picture.
659 "url": "A String", # A URL that points to a profile picture of this user.
660 },
661 "kind": "drive#user", # This is always drive#user.
662 "displayName": "A String", # A plain text displayable name for this user.
663 "permissionId": "A String", # The user's ID as visible in the permissions collection.
664 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
665 "emailAddress": "A String", # The email address of the user.
666 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700667 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
668 "width": 42, # The width of the video in pixels.
669 "durationMillis": "A String", # The duration of the video in milliseconds.
670 "height": 42, # The height of the video in pixels.
671 },
John Asmuth614db982014-04-24 15:46:26 -0400672 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
673 "picture": { # The user's profile picture.
674 "url": "A String", # A URL that points to a profile picture of this user.
675 },
676 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400677 "displayName": "A String", # A plain text displayable name for this user.
678 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700679 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
680 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400681 },
682 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800683 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Takashi Matsuo06694102015-09-11 13:55:40 -0700684 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400685 "ownerNames": [ # Name(s) of the owner(s) of this file.
686 "A String",
687 ],
688 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
689 "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.
690 "etag": "A String", # ETag of the file.
691 "parents": [ # Collection of parent folders which contain this file.
692 # 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.
693 { # A reference to a file's parent.
694 "selfLink": "A String", # A link back to this reference.
695 "kind": "drive#parentReference", # This is always drive#parentReference.
696 "id": "A String", # The ID of the parent.
697 "isRoot": True or False, # Whether or not the parent is the root folder.
698 "parentLink": "A String", # A link to the parent.
699 },
700 ],
701 "exportLinks": { # Links for exporting Google Docs to specific formats.
702 "a_key": "A String", # A mapping from export format to URL
703 },
704 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700705 "permissions": [ # The list of permissions for users with access to this file.
706 { # A permission for a file.
707 "withLink": True or False, # Whether the link is required for this permission.
708 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
709 "name": "A String", # The name for this permission.
710 "kind": "drive#permission", # This is always drive#permission.
711 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
712 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
713 "authKey": "A String", # The authkey parameter required for this permission.
714 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800715 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -0700716 "photoLink": "A String", # A link to the profile photo, if available.
717 "role": "A String", # The primary role for this user. Allowed values are:
718 # - owner
719 # - reader
720 # - writer
721 "type": "A String", # The account type. Allowed values are:
722 # - user
723 # - group
724 # - domain
725 # - anyone
726 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
727 "A String",
728 ],
729 "selfLink": "A String", # A link back to this permission.
730 },
731 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700732 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -0400733 "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.
734 "a_key": "A String",
735 },
736 "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.
737 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
738 "exposureTime": 3.14, # The length of the exposure, in seconds.
739 "cameraMake": "A String", # The make of the camera used to create the photo.
740 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
741 "isoSpeed": 42, # The ISO speed used to create the photo.
742 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
743 "exposureMode": "A String", # The exposure mode used to create the photo.
744 "colorSpace": "A String", # The color space of the photo.
745 "location": { # Geographic location information stored in the image.
746 "latitude": 3.14, # The latitude stored in the image.
747 "altitude": 3.14, # The altitude stored in the image.
748 "longitude": 3.14, # The longitude stored in the image.
749 },
750 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
751 "height": 42, # The height of the image in pixels.
752 "lens": "A String", # The lens used to create the photo.
753 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
754 "width": 42, # The width of the image in pixels.
755 "meteringMode": "A String", # The metering mode used to create the photo.
756 "flashUsed": True or False, # Whether a flash was used to create the photo.
757 "aperture": 3.14, # The aperture used to create the photo (f-number).
758 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
759 "sensor": "A String", # The type of sensor used to create the photo.
760 "whiteBalance": "A String", # The white balance mode used to create the photo.
761 "cameraModel": "A String", # The model of the camera used to create the photo.
762 },
763 "description": "A String", # A short description of the file.
764 "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.
765 "editable": True or False, # Whether the file can be edited by the current user.
766 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700767 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -0400768 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700769 "fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700770 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400771 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000772 { # A key-value pair attached to a file that is either public or private to an application.
773 # The following limits apply to file properties:
774 # - Maximum of 100 properties total per file
775 # - Maximum of 30 private properties per app
776 # - Maximum of 30 public properties
777 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -0400778 "kind": "drive#property", # This is always drive#property.
779 "value": "A String", # The value of this property.
780 "etag": "A String", # ETag of the property.
781 "visibility": "A String", # The visibility of this property.
782 "key": "A String", # The key of this property.
783 "selfLink": "A String", # The link back to this property.
784 },
785 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700786 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -0400787 "iconLink": "A String", # A link to the file's icon.
788 "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.
789 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700790 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400791 "title": "A String", # The title of this file.
792 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700793 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
794 "mimeType": "A String", # The MIME type of the thumbnail.
795 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
796 },
797 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -0400798 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
799 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700800 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400801 "name": "A String", # The name for this permission.
802 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -0700803 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
804 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -0400805 "authKey": "A String", # The authkey parameter required for this permission.
806 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800807 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -0400808 "photoLink": "A String", # A link to the profile photo, if available.
809 "role": "A String", # The primary role for this user. Allowed values are:
810 # - owner
811 # - reader
812 # - writer
813 "type": "A String", # The account type. Allowed values are:
814 # - user
815 # - group
816 # - domain
817 # - anyone
818 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
819 "A String",
820 ],
821 "selfLink": "A String", # A link back to this permission.
822 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700823 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000824 "A String",
825 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700826 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
827 "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
828 "fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
829 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -0400830 "selfLink": "A String", # A link back to this file.
831 "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.
832 }</pre>
833</div>
834
835<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000836 <code class="details" id="get_media">get_media(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
Craig Citroe633be12015-03-02 13:40:36 -0800837 <pre>Gets a file's metadata by ID.
838
839Args:
840 fileId: string, The ID for the file in question. (required)
841 projection: string, This parameter is deprecated and has no function.
842 Allowed values
843 BASIC - Deprecated
844 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000845 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -0800846 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
847 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
848
849Returns:
850 The media object as a string.
851
852 </pre>
853</div>
854
855<div class="method">
John Asmuth614db982014-04-24 15:46:26 -0400856 <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>
857 <pre>Insert a new file.
858
859Args:
860 body: object, The request body.
861 The object takes the form of:
862
863{ # The metadata for a file.
864 "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.
865 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700866 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
867 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000868 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -0400869 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700870 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -0400871 "hidden": True or False, # Deprecated.
872 "viewed": True or False, # Whether this file has been viewed by this user.
873 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000874 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -0400875 },
876 "indexableText": { # Indexable text attributes for the file (can only be written)
877 "text": "A String", # The text to be indexed for this file.
878 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700879 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
John Asmuth614db982014-04-24 15:46:26 -0400880 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
881 "writersCanShare": True or False, # Whether writers can share the document with other users.
882 "owners": [ # The owner(s) of this file.
883 { # The JSON template for a user.
884 "picture": { # The user's profile picture.
885 "url": "A String", # A URL that points to a profile picture of this user.
886 },
887 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400888 "displayName": "A String", # A plain text displayable name for this user.
889 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700890 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
891 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400892 },
893 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700894 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -0400895 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -0700896 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
897 "picture": { # The user's profile picture.
898 "url": "A String", # A URL that points to a profile picture of this user.
899 },
900 "kind": "drive#user", # This is always drive#user.
901 "displayName": "A String", # A plain text displayable name for this user.
902 "permissionId": "A String", # The user's ID as visible in the permissions collection.
903 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
904 "emailAddress": "A String", # The email address of the user.
905 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700906 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
907 "width": 42, # The width of the video in pixels.
908 "durationMillis": "A String", # The duration of the video in milliseconds.
909 "height": 42, # The height of the video in pixels.
910 },
John Asmuth614db982014-04-24 15:46:26 -0400911 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
912 "picture": { # The user's profile picture.
913 "url": "A String", # A URL that points to a profile picture of this user.
914 },
915 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400916 "displayName": "A String", # A plain text displayable name for this user.
917 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700918 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
919 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400920 },
921 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800922 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Takashi Matsuo06694102015-09-11 13:55:40 -0700923 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400924 "ownerNames": [ # Name(s) of the owner(s) of this file.
925 "A String",
926 ],
927 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
928 "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.
929 "etag": "A String", # ETag of the file.
930 "parents": [ # Collection of parent folders which contain this file.
931 # 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.
932 { # A reference to a file's parent.
933 "selfLink": "A String", # A link back to this reference.
934 "kind": "drive#parentReference", # This is always drive#parentReference.
935 "id": "A String", # The ID of the parent.
936 "isRoot": True or False, # Whether or not the parent is the root folder.
937 "parentLink": "A String", # A link to the parent.
938 },
939 ],
940 "exportLinks": { # Links for exporting Google Docs to specific formats.
941 "a_key": "A String", # A mapping from export format to URL
942 },
943 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700944 "permissions": [ # The list of permissions for users with access to this file.
945 { # A permission for a file.
946 "withLink": True or False, # Whether the link is required for this permission.
947 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
948 "name": "A String", # The name for this permission.
949 "kind": "drive#permission", # This is always drive#permission.
950 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
951 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
952 "authKey": "A String", # The authkey parameter required for this permission.
953 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800954 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -0700955 "photoLink": "A String", # A link to the profile photo, if available.
956 "role": "A String", # The primary role for this user. Allowed values are:
957 # - owner
958 # - reader
959 # - writer
960 "type": "A String", # The account type. Allowed values are:
961 # - user
962 # - group
963 # - domain
964 # - anyone
965 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
966 "A String",
967 ],
968 "selfLink": "A String", # A link back to this permission.
969 },
970 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700971 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -0400972 "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.
973 "a_key": "A String",
974 },
975 "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.
976 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
977 "exposureTime": 3.14, # The length of the exposure, in seconds.
978 "cameraMake": "A String", # The make of the camera used to create the photo.
979 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
980 "isoSpeed": 42, # The ISO speed used to create the photo.
981 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
982 "exposureMode": "A String", # The exposure mode used to create the photo.
983 "colorSpace": "A String", # The color space of the photo.
984 "location": { # Geographic location information stored in the image.
985 "latitude": 3.14, # The latitude stored in the image.
986 "altitude": 3.14, # The altitude stored in the image.
987 "longitude": 3.14, # The longitude stored in the image.
988 },
989 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
990 "height": 42, # The height of the image in pixels.
991 "lens": "A String", # The lens used to create the photo.
992 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
993 "width": 42, # The width of the image in pixels.
994 "meteringMode": "A String", # The metering mode used to create the photo.
995 "flashUsed": True or False, # Whether a flash was used to create the photo.
996 "aperture": 3.14, # The aperture used to create the photo (f-number).
997 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
998 "sensor": "A String", # The type of sensor used to create the photo.
999 "whiteBalance": "A String", # The white balance mode used to create the photo.
1000 "cameraModel": "A String", # The model of the camera used to create the photo.
1001 },
1002 "description": "A String", # A short description of the file.
1003 "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.
1004 "editable": True or False, # Whether the file can be edited by the current user.
1005 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001006 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04001007 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001008 "fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001009 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001010 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001011 { # A key-value pair attached to a file that is either public or private to an application.
1012 # The following limits apply to file properties:
1013 # - Maximum of 100 properties total per file
1014 # - Maximum of 30 private properties per app
1015 # - Maximum of 30 public properties
1016 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04001017 "kind": "drive#property", # This is always drive#property.
1018 "value": "A String", # The value of this property.
1019 "etag": "A String", # ETag of the property.
1020 "visibility": "A String", # The visibility of this property.
1021 "key": "A String", # The key of this property.
1022 "selfLink": "A String", # The link back to this property.
1023 },
1024 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001025 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04001026 "iconLink": "A String", # A link to the file's icon.
1027 "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.
1028 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001029 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001030 "title": "A String", # The title of this file.
1031 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -07001032 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1033 "mimeType": "A String", # The MIME type of the thumbnail.
1034 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
1035 },
1036 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04001037 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1038 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001039 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04001040 "name": "A String", # The name for this permission.
1041 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001042 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1043 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04001044 "authKey": "A String", # The authkey parameter required for this permission.
1045 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001046 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04001047 "photoLink": "A String", # A link to the profile photo, if available.
1048 "role": "A String", # The primary role for this user. Allowed values are:
1049 # - owner
1050 # - reader
1051 # - writer
1052 "type": "A String", # The account type. Allowed values are:
1053 # - user
1054 # - group
1055 # - domain
1056 # - anyone
1057 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1058 "A String",
1059 ],
1060 "selfLink": "A String", # A link back to this permission.
1061 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001062 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001063 "A String",
1064 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001065 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
1066 "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
1067 "fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
1068 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04001069 "selfLink": "A String", # A link back to this file.
1070 "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.
1071}
1072
1073 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
1074 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
1075 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
1076 visibility: string, The visibility of the new file. This parameter is only relevant when convert=false.
1077 Allowed values
1078 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
1079 PRIVATE - The new file will be visible to only the owner.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001080 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
John Asmuth614db982014-04-24 15:46:26 -04001081 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
1082 timedTextLanguage: string, The language of the timed text.
1083 timedTextTrackName: string, The timed text track name.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001084 pinned: boolean, Whether to pin the head revision of the uploaded file. A file can have a maximum of 200 pinned revisions.
John Asmuth614db982014-04-24 15:46:26 -04001085
1086Returns:
1087 An object of the form:
1088
1089 { # The metadata for a file.
1090 "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.
1091 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001092 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
1093 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001094 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04001095 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001096 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04001097 "hidden": True or False, # Deprecated.
1098 "viewed": True or False, # Whether this file has been viewed by this user.
1099 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001100 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04001101 },
1102 "indexableText": { # Indexable text attributes for the file (can only be written)
1103 "text": "A String", # The text to be indexed for this file.
1104 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001105 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
John Asmuth614db982014-04-24 15:46:26 -04001106 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1107 "writersCanShare": True or False, # Whether writers can share the document with other users.
1108 "owners": [ # The owner(s) of this file.
1109 { # The JSON template for a user.
1110 "picture": { # The user's profile picture.
1111 "url": "A String", # A URL that points to a profile picture of this user.
1112 },
1113 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001114 "displayName": "A String", # A plain text displayable name for this user.
1115 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001116 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1117 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001118 },
1119 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001120 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04001121 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001122 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1123 "picture": { # The user's profile picture.
1124 "url": "A String", # A URL that points to a profile picture of this user.
1125 },
1126 "kind": "drive#user", # This is always drive#user.
1127 "displayName": "A String", # A plain text displayable name for this user.
1128 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1129 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1130 "emailAddress": "A String", # The email address of the user.
1131 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001132 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1133 "width": 42, # The width of the video in pixels.
1134 "durationMillis": "A String", # The duration of the video in milliseconds.
1135 "height": 42, # The height of the video in pixels.
1136 },
John Asmuth614db982014-04-24 15:46:26 -04001137 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1138 "picture": { # The user's profile picture.
1139 "url": "A String", # A URL that points to a profile picture of this user.
1140 },
1141 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001142 "displayName": "A String", # A plain text displayable name for this user.
1143 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001144 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1145 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001146 },
1147 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001148 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Takashi Matsuo06694102015-09-11 13:55:40 -07001149 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001150 "ownerNames": [ # Name(s) of the owner(s) of this file.
1151 "A String",
1152 ],
1153 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1154 "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.
1155 "etag": "A String", # ETag of the file.
1156 "parents": [ # Collection of parent folders which contain this file.
1157 # 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.
1158 { # A reference to a file's parent.
1159 "selfLink": "A String", # A link back to this reference.
1160 "kind": "drive#parentReference", # This is always drive#parentReference.
1161 "id": "A String", # The ID of the parent.
1162 "isRoot": True or False, # Whether or not the parent is the root folder.
1163 "parentLink": "A String", # A link to the parent.
1164 },
1165 ],
1166 "exportLinks": { # Links for exporting Google Docs to specific formats.
1167 "a_key": "A String", # A mapping from export format to URL
1168 },
1169 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001170 "permissions": [ # The list of permissions for users with access to this file.
1171 { # A permission for a file.
1172 "withLink": True or False, # Whether the link is required for this permission.
1173 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
1174 "name": "A String", # The name for this permission.
1175 "kind": "drive#permission", # This is always drive#permission.
1176 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1177 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1178 "authKey": "A String", # The authkey parameter required for this permission.
1179 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001180 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07001181 "photoLink": "A String", # A link to the profile photo, if available.
1182 "role": "A String", # The primary role for this user. Allowed values are:
1183 # - owner
1184 # - reader
1185 # - writer
1186 "type": "A String", # The account type. Allowed values are:
1187 # - user
1188 # - group
1189 # - domain
1190 # - anyone
1191 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1192 "A String",
1193 ],
1194 "selfLink": "A String", # A link back to this permission.
1195 },
1196 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001197 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04001198 "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.
1199 "a_key": "A String",
1200 },
1201 "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.
1202 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1203 "exposureTime": 3.14, # The length of the exposure, in seconds.
1204 "cameraMake": "A String", # The make of the camera used to create the photo.
1205 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1206 "isoSpeed": 42, # The ISO speed used to create the photo.
1207 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1208 "exposureMode": "A String", # The exposure mode used to create the photo.
1209 "colorSpace": "A String", # The color space of the photo.
1210 "location": { # Geographic location information stored in the image.
1211 "latitude": 3.14, # The latitude stored in the image.
1212 "altitude": 3.14, # The altitude stored in the image.
1213 "longitude": 3.14, # The longitude stored in the image.
1214 },
1215 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1216 "height": 42, # The height of the image in pixels.
1217 "lens": "A String", # The lens used to create the photo.
1218 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1219 "width": 42, # The width of the image in pixels.
1220 "meteringMode": "A String", # The metering mode used to create the photo.
1221 "flashUsed": True or False, # Whether a flash was used to create the photo.
1222 "aperture": 3.14, # The aperture used to create the photo (f-number).
1223 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1224 "sensor": "A String", # The type of sensor used to create the photo.
1225 "whiteBalance": "A String", # The white balance mode used to create the photo.
1226 "cameraModel": "A String", # The model of the camera used to create the photo.
1227 },
1228 "description": "A String", # A short description of the file.
1229 "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.
1230 "editable": True or False, # Whether the file can be edited by the current user.
1231 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001232 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04001233 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001234 "fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001235 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001236 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001237 { # A key-value pair attached to a file that is either public or private to an application.
1238 # The following limits apply to file properties:
1239 # - Maximum of 100 properties total per file
1240 # - Maximum of 30 private properties per app
1241 # - Maximum of 30 public properties
1242 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04001243 "kind": "drive#property", # This is always drive#property.
1244 "value": "A String", # The value of this property.
1245 "etag": "A String", # ETag of the property.
1246 "visibility": "A String", # The visibility of this property.
1247 "key": "A String", # The key of this property.
1248 "selfLink": "A String", # The link back to this property.
1249 },
1250 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001251 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04001252 "iconLink": "A String", # A link to the file's icon.
1253 "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.
1254 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001255 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001256 "title": "A String", # The title of this file.
1257 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -07001258 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1259 "mimeType": "A String", # The MIME type of the thumbnail.
1260 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
1261 },
1262 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04001263 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1264 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001265 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04001266 "name": "A String", # The name for this permission.
1267 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001268 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1269 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04001270 "authKey": "A String", # The authkey parameter required for this permission.
1271 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001272 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04001273 "photoLink": "A String", # A link to the profile photo, if available.
1274 "role": "A String", # The primary role for this user. Allowed values are:
1275 # - owner
1276 # - reader
1277 # - writer
1278 "type": "A String", # The account type. Allowed values are:
1279 # - user
1280 # - group
1281 # - domain
1282 # - anyone
1283 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1284 "A String",
1285 ],
1286 "selfLink": "A String", # A link back to this permission.
1287 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001288 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001289 "A String",
1290 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001291 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
1292 "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
1293 "fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
1294 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04001295 "selfLink": "A String", # A link back to this file.
1296 "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.
1297 }</pre>
1298</div>
1299
1300<div class="method">
Takashi Matsuo06694102015-09-11 13:55:40 -07001301 <code class="details" id="list">list(orderBy=None, q=None, projection=None, pageToken=None, maxResults=None, spaces=None, corpus=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04001302 <pre>Lists the user's files.
1303
1304Args:
Takashi Matsuo06694102015-09-11 13:55:40 -07001305 orderBy: string, A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.
John Asmuth614db982014-04-24 15:46:26 -04001306 q: string, Query string for searching files.
1307 projection: string, This parameter is deprecated and has no function.
1308 Allowed values
1309 BASIC - Deprecated
1310 FULL - Deprecated
1311 pageToken: string, Page token for files.
1312 maxResults: integer, Maximum number of files to return.
Takashi Matsuo06694102015-09-11 13:55:40 -07001313 spaces: string, A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.
Craig Citro065b5302014-08-14 00:47:23 -07001314 corpus: string, The body of items (files/documents) to which the query applies.
1315 Allowed values
1316 DEFAULT - The items that the user has accessed.
1317 DOMAIN - Items shared to the user's domain.
John Asmuth614db982014-04-24 15:46:26 -04001318
1319Returns:
1320 An object of the form:
1321
1322 { # A list of files.
1323 "nextPageToken": "A String", # The page token for the next page of files.
1324 "kind": "drive#fileList", # This is always drive#fileList.
1325 "items": [ # The actual list of files.
1326 { # The metadata for a file.
1327 "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.
1328 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001329 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
1330 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001331 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04001332 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001333 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04001334 "hidden": True or False, # Deprecated.
1335 "viewed": True or False, # Whether this file has been viewed by this user.
1336 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001337 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04001338 },
1339 "indexableText": { # Indexable text attributes for the file (can only be written)
1340 "text": "A String", # The text to be indexed for this file.
1341 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001342 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
John Asmuth614db982014-04-24 15:46:26 -04001343 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1344 "writersCanShare": True or False, # Whether writers can share the document with other users.
1345 "owners": [ # The owner(s) of this file.
1346 { # The JSON template for a user.
1347 "picture": { # The user's profile picture.
1348 "url": "A String", # A URL that points to a profile picture of this user.
1349 },
1350 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001351 "displayName": "A String", # A plain text displayable name for this user.
1352 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001353 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1354 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001355 },
1356 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001357 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04001358 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001359 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1360 "picture": { # The user's profile picture.
1361 "url": "A String", # A URL that points to a profile picture of this user.
1362 },
1363 "kind": "drive#user", # This is always drive#user.
1364 "displayName": "A String", # A plain text displayable name for this user.
1365 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1366 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1367 "emailAddress": "A String", # The email address of the user.
1368 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001369 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1370 "width": 42, # The width of the video in pixels.
1371 "durationMillis": "A String", # The duration of the video in milliseconds.
1372 "height": 42, # The height of the video in pixels.
1373 },
John Asmuth614db982014-04-24 15:46:26 -04001374 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1375 "picture": { # The user's profile picture.
1376 "url": "A String", # A URL that points to a profile picture of this user.
1377 },
1378 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001379 "displayName": "A String", # A plain text displayable name for this user.
1380 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001381 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1382 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001383 },
1384 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001385 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Takashi Matsuo06694102015-09-11 13:55:40 -07001386 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001387 "ownerNames": [ # Name(s) of the owner(s) of this file.
1388 "A String",
1389 ],
1390 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1391 "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.
1392 "etag": "A String", # ETag of the file.
1393 "parents": [ # Collection of parent folders which contain this file.
1394 # 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.
1395 { # A reference to a file's parent.
1396 "selfLink": "A String", # A link back to this reference.
1397 "kind": "drive#parentReference", # This is always drive#parentReference.
1398 "id": "A String", # The ID of the parent.
1399 "isRoot": True or False, # Whether or not the parent is the root folder.
1400 "parentLink": "A String", # A link to the parent.
1401 },
1402 ],
1403 "exportLinks": { # Links for exporting Google Docs to specific formats.
1404 "a_key": "A String", # A mapping from export format to URL
1405 },
1406 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001407 "permissions": [ # The list of permissions for users with access to this file.
1408 { # A permission for a file.
1409 "withLink": True or False, # Whether the link is required for this permission.
1410 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
1411 "name": "A String", # The name for this permission.
1412 "kind": "drive#permission", # This is always drive#permission.
1413 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1414 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1415 "authKey": "A String", # The authkey parameter required for this permission.
1416 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001417 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07001418 "photoLink": "A String", # A link to the profile photo, if available.
1419 "role": "A String", # The primary role for this user. Allowed values are:
1420 # - owner
1421 # - reader
1422 # - writer
1423 "type": "A String", # The account type. Allowed values are:
1424 # - user
1425 # - group
1426 # - domain
1427 # - anyone
1428 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1429 "A String",
1430 ],
1431 "selfLink": "A String", # A link back to this permission.
1432 },
1433 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001434 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04001435 "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.
1436 "a_key": "A String",
1437 },
1438 "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.
1439 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1440 "exposureTime": 3.14, # The length of the exposure, in seconds.
1441 "cameraMake": "A String", # The make of the camera used to create the photo.
1442 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1443 "isoSpeed": 42, # The ISO speed used to create the photo.
1444 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1445 "exposureMode": "A String", # The exposure mode used to create the photo.
1446 "colorSpace": "A String", # The color space of the photo.
1447 "location": { # Geographic location information stored in the image.
1448 "latitude": 3.14, # The latitude stored in the image.
1449 "altitude": 3.14, # The altitude stored in the image.
1450 "longitude": 3.14, # The longitude stored in the image.
1451 },
1452 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1453 "height": 42, # The height of the image in pixels.
1454 "lens": "A String", # The lens used to create the photo.
1455 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1456 "width": 42, # The width of the image in pixels.
1457 "meteringMode": "A String", # The metering mode used to create the photo.
1458 "flashUsed": True or False, # Whether a flash was used to create the photo.
1459 "aperture": 3.14, # The aperture used to create the photo (f-number).
1460 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1461 "sensor": "A String", # The type of sensor used to create the photo.
1462 "whiteBalance": "A String", # The white balance mode used to create the photo.
1463 "cameraModel": "A String", # The model of the camera used to create the photo.
1464 },
1465 "description": "A String", # A short description of the file.
1466 "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.
1467 "editable": True or False, # Whether the file can be edited by the current user.
1468 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001469 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04001470 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001471 "fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001472 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001473 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001474 { # A key-value pair attached to a file that is either public or private to an application.
1475 # The following limits apply to file properties:
1476 # - Maximum of 100 properties total per file
1477 # - Maximum of 30 private properties per app
1478 # - Maximum of 30 public properties
1479 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04001480 "kind": "drive#property", # This is always drive#property.
1481 "value": "A String", # The value of this property.
1482 "etag": "A String", # ETag of the property.
1483 "visibility": "A String", # The visibility of this property.
1484 "key": "A String", # The key of this property.
1485 "selfLink": "A String", # The link back to this property.
1486 },
1487 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001488 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04001489 "iconLink": "A String", # A link to the file's icon.
1490 "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.
1491 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001492 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001493 "title": "A String", # The title of this file.
1494 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -07001495 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1496 "mimeType": "A String", # The MIME type of the thumbnail.
1497 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
1498 },
1499 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04001500 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1501 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001502 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04001503 "name": "A String", # The name for this permission.
1504 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001505 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1506 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04001507 "authKey": "A String", # The authkey parameter required for this permission.
1508 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001509 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04001510 "photoLink": "A String", # A link to the profile photo, if available.
1511 "role": "A String", # The primary role for this user. Allowed values are:
1512 # - owner
1513 # - reader
1514 # - writer
1515 "type": "A String", # The account type. Allowed values are:
1516 # - user
1517 # - group
1518 # - domain
1519 # - anyone
1520 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1521 "A String",
1522 ],
1523 "selfLink": "A String", # A link back to this permission.
1524 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001525 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001526 "A String",
1527 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001528 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
1529 "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
1530 "fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
1531 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04001532 "selfLink": "A String", # A link back to this file.
1533 "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.
1534 },
1535 ],
1536 "nextLink": "A String", # A link to the next page of files.
1537 "etag": "A String", # The ETag of the list.
1538 "selfLink": "A String", # A link back to this list.
1539 }</pre>
1540</div>
1541
1542<div class="method">
1543 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1544 <pre>Retrieves the next page of results.
1545
1546Args:
1547 previous_request: The request for the previous page. (required)
1548 previous_response: The response from the request for the previous page. (required)
1549
1550Returns:
1551 A request object that you can call 'execute()' on to request the next
1552 page. Returns None if there are no more items in the collection.
1553 </pre>
1554</div>
1555
1556<div class="method">
Takashi Matsuo06694102015-09-11 13:55:40 -07001557 <code class="details" id="patch">patch(fileId, body, newRevision=None, modifiedDateBehavior=None, pinned=None, ocrLanguage=None, ocr=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04001558 <pre>Updates file metadata and/or content. This method supports patch semantics.
1559
1560Args:
1561 fileId: string, The ID of the file to update. (required)
1562 body: object, The request body. (required)
1563 The object takes the form of:
1564
1565{ # The metadata for a file.
1566 "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.
1567 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001568 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
1569 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001570 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04001571 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001572 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04001573 "hidden": True or False, # Deprecated.
1574 "viewed": True or False, # Whether this file has been viewed by this user.
1575 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001576 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04001577 },
1578 "indexableText": { # Indexable text attributes for the file (can only be written)
1579 "text": "A String", # The text to be indexed for this file.
1580 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001581 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
John Asmuth614db982014-04-24 15:46:26 -04001582 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1583 "writersCanShare": True or False, # Whether writers can share the document with other users.
1584 "owners": [ # The owner(s) of this file.
1585 { # The JSON template for a user.
1586 "picture": { # The user's profile picture.
1587 "url": "A String", # A URL that points to a profile picture of this user.
1588 },
1589 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001590 "displayName": "A String", # A plain text displayable name for this user.
1591 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001592 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1593 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001594 },
1595 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001596 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04001597 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001598 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1599 "picture": { # The user's profile picture.
1600 "url": "A String", # A URL that points to a profile picture of this user.
1601 },
1602 "kind": "drive#user", # This is always drive#user.
1603 "displayName": "A String", # A plain text displayable name for this user.
1604 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1605 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1606 "emailAddress": "A String", # The email address of the user.
1607 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001608 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1609 "width": 42, # The width of the video in pixels.
1610 "durationMillis": "A String", # The duration of the video in milliseconds.
1611 "height": 42, # The height of the video in pixels.
1612 },
John Asmuth614db982014-04-24 15:46:26 -04001613 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1614 "picture": { # The user's profile picture.
1615 "url": "A String", # A URL that points to a profile picture of this user.
1616 },
1617 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001618 "displayName": "A String", # A plain text displayable name for this user.
1619 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001620 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1621 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001622 },
1623 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001624 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Takashi Matsuo06694102015-09-11 13:55:40 -07001625 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001626 "ownerNames": [ # Name(s) of the owner(s) of this file.
1627 "A String",
1628 ],
1629 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1630 "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.
1631 "etag": "A String", # ETag of the file.
1632 "parents": [ # Collection of parent folders which contain this file.
1633 # 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.
1634 { # A reference to a file's parent.
1635 "selfLink": "A String", # A link back to this reference.
1636 "kind": "drive#parentReference", # This is always drive#parentReference.
1637 "id": "A String", # The ID of the parent.
1638 "isRoot": True or False, # Whether or not the parent is the root folder.
1639 "parentLink": "A String", # A link to the parent.
1640 },
1641 ],
1642 "exportLinks": { # Links for exporting Google Docs to specific formats.
1643 "a_key": "A String", # A mapping from export format to URL
1644 },
1645 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001646 "permissions": [ # The list of permissions for users with access to this file.
1647 { # A permission for a file.
1648 "withLink": True or False, # Whether the link is required for this permission.
1649 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
1650 "name": "A String", # The name for this permission.
1651 "kind": "drive#permission", # This is always drive#permission.
1652 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1653 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1654 "authKey": "A String", # The authkey parameter required for this permission.
1655 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001656 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07001657 "photoLink": "A String", # A link to the profile photo, if available.
1658 "role": "A String", # The primary role for this user. Allowed values are:
1659 # - owner
1660 # - reader
1661 # - writer
1662 "type": "A String", # The account type. Allowed values are:
1663 # - user
1664 # - group
1665 # - domain
1666 # - anyone
1667 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1668 "A String",
1669 ],
1670 "selfLink": "A String", # A link back to this permission.
1671 },
1672 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001673 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04001674 "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.
1675 "a_key": "A String",
1676 },
1677 "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.
1678 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1679 "exposureTime": 3.14, # The length of the exposure, in seconds.
1680 "cameraMake": "A String", # The make of the camera used to create the photo.
1681 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1682 "isoSpeed": 42, # The ISO speed used to create the photo.
1683 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1684 "exposureMode": "A String", # The exposure mode used to create the photo.
1685 "colorSpace": "A String", # The color space of the photo.
1686 "location": { # Geographic location information stored in the image.
1687 "latitude": 3.14, # The latitude stored in the image.
1688 "altitude": 3.14, # The altitude stored in the image.
1689 "longitude": 3.14, # The longitude stored in the image.
1690 },
1691 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1692 "height": 42, # The height of the image in pixels.
1693 "lens": "A String", # The lens used to create the photo.
1694 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1695 "width": 42, # The width of the image in pixels.
1696 "meteringMode": "A String", # The metering mode used to create the photo.
1697 "flashUsed": True or False, # Whether a flash was used to create the photo.
1698 "aperture": 3.14, # The aperture used to create the photo (f-number).
1699 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1700 "sensor": "A String", # The type of sensor used to create the photo.
1701 "whiteBalance": "A String", # The white balance mode used to create the photo.
1702 "cameraModel": "A String", # The model of the camera used to create the photo.
1703 },
1704 "description": "A String", # A short description of the file.
1705 "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.
1706 "editable": True or False, # Whether the file can be edited by the current user.
1707 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001708 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04001709 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001710 "fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001711 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001712 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001713 { # A key-value pair attached to a file that is either public or private to an application.
1714 # The following limits apply to file properties:
1715 # - Maximum of 100 properties total per file
1716 # - Maximum of 30 private properties per app
1717 # - Maximum of 30 public properties
1718 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04001719 "kind": "drive#property", # This is always drive#property.
1720 "value": "A String", # The value of this property.
1721 "etag": "A String", # ETag of the property.
1722 "visibility": "A String", # The visibility of this property.
1723 "key": "A String", # The key of this property.
1724 "selfLink": "A String", # The link back to this property.
1725 },
1726 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001727 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04001728 "iconLink": "A String", # A link to the file's icon.
1729 "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.
1730 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001731 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001732 "title": "A String", # The title of this file.
1733 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -07001734 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1735 "mimeType": "A String", # The MIME type of the thumbnail.
1736 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
1737 },
1738 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04001739 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1740 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001741 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04001742 "name": "A String", # The name for this permission.
1743 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001744 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1745 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04001746 "authKey": "A String", # The authkey parameter required for this permission.
1747 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001748 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04001749 "photoLink": "A String", # A link to the profile photo, if available.
1750 "role": "A String", # The primary role for this user. Allowed values are:
1751 # - owner
1752 # - reader
1753 # - writer
1754 "type": "A String", # The account type. Allowed values are:
1755 # - user
1756 # - group
1757 # - domain
1758 # - anyone
1759 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1760 "A String",
1761 ],
1762 "selfLink": "A String", # A link back to this permission.
1763 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001764 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001765 "A String",
1766 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001767 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
1768 "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
1769 "fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
1770 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04001771 "selfLink": "A String", # A link back to this file.
1772 "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.
1773}
1774
Takashi Matsuo06694102015-09-11 13:55:40 -07001775 newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center.
1776 modifiedDateBehavior: string, Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.
1777 Allowed values
1778 fromBody - Set modifiedDate to the value provided in the body of the request. No change if no value was provided.
1779 fromBodyIfNeeded - Set modifiedDate to the value provided in the body of the request depending on other contents of the update.
1780 fromBodyOrNow - Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.
1781 noChange - Maintain the previous value of modifiedDate.
1782 now - Set modifiedDate to the current time.
1783 nowIfNeeded - Set modifiedDate to the current time depending on contents of the update.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001784 pinned: boolean, Whether to pin the new revision. A file can have a maximum of 200 pinned revisions.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001785 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
John Asmuth614db982014-04-24 15:46:26 -04001786 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Craig Citro065b5302014-08-14 00:47:23 -07001787 addParents: string, Comma-separated list of parent IDs to add.
1788 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04001789 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
1790 timedTextTrackName: string, The timed text track name.
Takashi Matsuo06694102015-09-11 13:55:40 -07001791 convert: boolean, This parameter is deprecated and has no function.
John Asmuth614db982014-04-24 15:46:26 -04001792 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
1793 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
1794 timedTextLanguage: string, The language of the timed text.
1795
1796Returns:
1797 An object of the form:
1798
1799 { # The metadata for a file.
1800 "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.
1801 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001802 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
1803 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001804 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04001805 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001806 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04001807 "hidden": True or False, # Deprecated.
1808 "viewed": True or False, # Whether this file has been viewed by this user.
1809 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001810 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04001811 },
1812 "indexableText": { # Indexable text attributes for the file (can only be written)
1813 "text": "A String", # The text to be indexed for this file.
1814 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001815 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
John Asmuth614db982014-04-24 15:46:26 -04001816 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1817 "writersCanShare": True or False, # Whether writers can share the document with other users.
1818 "owners": [ # The owner(s) of this file.
1819 { # The JSON template for a user.
1820 "picture": { # The user's profile picture.
1821 "url": "A String", # A URL that points to a profile picture of this user.
1822 },
1823 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001824 "displayName": "A String", # A plain text displayable name for this user.
1825 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001826 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1827 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001828 },
1829 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001830 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04001831 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07001832 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
1833 "picture": { # The user's profile picture.
1834 "url": "A String", # A URL that points to a profile picture of this user.
1835 },
1836 "kind": "drive#user", # This is always drive#user.
1837 "displayName": "A String", # A plain text displayable name for this user.
1838 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1839 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1840 "emailAddress": "A String", # The email address of the user.
1841 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001842 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1843 "width": 42, # The width of the video in pixels.
1844 "durationMillis": "A String", # The duration of the video in milliseconds.
1845 "height": 42, # The height of the video in pixels.
1846 },
John Asmuth614db982014-04-24 15:46:26 -04001847 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
1848 "picture": { # The user's profile picture.
1849 "url": "A String", # A URL that points to a profile picture of this user.
1850 },
1851 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001852 "displayName": "A String", # A plain text displayable name for this user.
1853 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001854 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1855 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001856 },
1857 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001858 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Takashi Matsuo06694102015-09-11 13:55:40 -07001859 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001860 "ownerNames": [ # Name(s) of the owner(s) of this file.
1861 "A String",
1862 ],
1863 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1864 "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.
1865 "etag": "A String", # ETag of the file.
1866 "parents": [ # Collection of parent folders which contain this file.
1867 # 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.
1868 { # A reference to a file's parent.
1869 "selfLink": "A String", # A link back to this reference.
1870 "kind": "drive#parentReference", # This is always drive#parentReference.
1871 "id": "A String", # The ID of the parent.
1872 "isRoot": True or False, # Whether or not the parent is the root folder.
1873 "parentLink": "A String", # A link to the parent.
1874 },
1875 ],
1876 "exportLinks": { # Links for exporting Google Docs to specific formats.
1877 "a_key": "A String", # A mapping from export format to URL
1878 },
1879 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001880 "permissions": [ # The list of permissions for users with access to this file.
1881 { # A permission for a file.
1882 "withLink": True or False, # Whether the link is required for this permission.
1883 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
1884 "name": "A String", # The name for this permission.
1885 "kind": "drive#permission", # This is always drive#permission.
1886 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1887 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1888 "authKey": "A String", # The authkey parameter required for this permission.
1889 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001890 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07001891 "photoLink": "A String", # A link to the profile photo, if available.
1892 "role": "A String", # The primary role for this user. Allowed values are:
1893 # - owner
1894 # - reader
1895 # - writer
1896 "type": "A String", # The account type. Allowed values are:
1897 # - user
1898 # - group
1899 # - domain
1900 # - anyone
1901 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1902 "A String",
1903 ],
1904 "selfLink": "A String", # A link back to this permission.
1905 },
1906 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001907 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04001908 "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.
1909 "a_key": "A String",
1910 },
1911 "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.
1912 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1913 "exposureTime": 3.14, # The length of the exposure, in seconds.
1914 "cameraMake": "A String", # The make of the camera used to create the photo.
1915 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1916 "isoSpeed": 42, # The ISO speed used to create the photo.
1917 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1918 "exposureMode": "A String", # The exposure mode used to create the photo.
1919 "colorSpace": "A String", # The color space of the photo.
1920 "location": { # Geographic location information stored in the image.
1921 "latitude": 3.14, # The latitude stored in the image.
1922 "altitude": 3.14, # The altitude stored in the image.
1923 "longitude": 3.14, # The longitude stored in the image.
1924 },
1925 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1926 "height": 42, # The height of the image in pixels.
1927 "lens": "A String", # The lens used to create the photo.
1928 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1929 "width": 42, # The width of the image in pixels.
1930 "meteringMode": "A String", # The metering mode used to create the photo.
1931 "flashUsed": True or False, # Whether a flash was used to create the photo.
1932 "aperture": 3.14, # The aperture used to create the photo (f-number).
1933 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1934 "sensor": "A String", # The type of sensor used to create the photo.
1935 "whiteBalance": "A String", # The white balance mode used to create the photo.
1936 "cameraModel": "A String", # The model of the camera used to create the photo.
1937 },
1938 "description": "A String", # A short description of the file.
1939 "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.
1940 "editable": True or False, # Whether the file can be edited by the current user.
1941 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001942 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04001943 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001944 "fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001945 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001946 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001947 { # A key-value pair attached to a file that is either public or private to an application.
1948 # The following limits apply to file properties:
1949 # - Maximum of 100 properties total per file
1950 # - Maximum of 30 private properties per app
1951 # - Maximum of 30 public properties
1952 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04001953 "kind": "drive#property", # This is always drive#property.
1954 "value": "A String", # The value of this property.
1955 "etag": "A String", # ETag of the property.
1956 "visibility": "A String", # The visibility of this property.
1957 "key": "A String", # The key of this property.
1958 "selfLink": "A String", # The link back to this property.
1959 },
1960 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001961 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04001962 "iconLink": "A String", # A link to the file's icon.
1963 "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.
1964 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001965 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001966 "title": "A String", # The title of this file.
1967 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -07001968 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1969 "mimeType": "A String", # The MIME type of the thumbnail.
1970 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
1971 },
1972 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04001973 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1974 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001975 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04001976 "name": "A String", # The name for this permission.
1977 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07001978 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
1979 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04001980 "authKey": "A String", # The authkey parameter required for this permission.
1981 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001982 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04001983 "photoLink": "A String", # A link to the profile photo, if available.
1984 "role": "A String", # The primary role for this user. Allowed values are:
1985 # - owner
1986 # - reader
1987 # - writer
1988 "type": "A String", # The account type. Allowed values are:
1989 # - user
1990 # - group
1991 # - domain
1992 # - anyone
1993 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1994 "A String",
1995 ],
1996 "selfLink": "A String", # A link back to this permission.
1997 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001998 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001999 "A String",
2000 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002001 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
2002 "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
2003 "fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
2004 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04002005 "selfLink": "A String", # A link back to this file.
2006 "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.
2007 }</pre>
2008</div>
2009
2010<div class="method">
2011 <code class="details" id="touch">touch(fileId)</code>
2012 <pre>Set the file's updated time to the current server time.
2013
2014Args:
2015 fileId: string, The ID of the file to update. (required)
2016
2017Returns:
2018 An object of the form:
2019
2020 { # The metadata for a file.
2021 "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.
2022 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002023 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
2024 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002025 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04002026 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002027 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04002028 "hidden": True or False, # Deprecated.
2029 "viewed": True or False, # Whether this file has been viewed by this user.
2030 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002031 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04002032 },
2033 "indexableText": { # Indexable text attributes for the file (can only be written)
2034 "text": "A String", # The text to be indexed for this file.
2035 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002036 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
John Asmuth614db982014-04-24 15:46:26 -04002037 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2038 "writersCanShare": True or False, # Whether writers can share the document with other users.
2039 "owners": [ # The owner(s) of this file.
2040 { # The JSON template for a user.
2041 "picture": { # The user's profile picture.
2042 "url": "A String", # A URL that points to a profile picture of this user.
2043 },
2044 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002045 "displayName": "A String", # A plain text displayable name for this user.
2046 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002047 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2048 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002049 },
2050 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002051 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04002052 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002053 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2054 "picture": { # The user's profile picture.
2055 "url": "A String", # A URL that points to a profile picture of this user.
2056 },
2057 "kind": "drive#user", # This is always drive#user.
2058 "displayName": "A String", # A plain text displayable name for this user.
2059 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2060 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2061 "emailAddress": "A String", # The email address of the user.
2062 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002063 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2064 "width": 42, # The width of the video in pixels.
2065 "durationMillis": "A String", # The duration of the video in milliseconds.
2066 "height": 42, # The height of the video in pixels.
2067 },
John Asmuth614db982014-04-24 15:46:26 -04002068 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2069 "picture": { # The user's profile picture.
2070 "url": "A String", # A URL that points to a profile picture of this user.
2071 },
2072 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002073 "displayName": "A String", # A plain text displayable name for this user.
2074 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002075 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2076 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002077 },
2078 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002079 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Takashi Matsuo06694102015-09-11 13:55:40 -07002080 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002081 "ownerNames": [ # Name(s) of the owner(s) of this file.
2082 "A String",
2083 ],
2084 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2085 "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.
2086 "etag": "A String", # ETag of the file.
2087 "parents": [ # Collection of parent folders which contain this file.
2088 # 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.
2089 { # A reference to a file's parent.
2090 "selfLink": "A String", # A link back to this reference.
2091 "kind": "drive#parentReference", # This is always drive#parentReference.
2092 "id": "A String", # The ID of the parent.
2093 "isRoot": True or False, # Whether or not the parent is the root folder.
2094 "parentLink": "A String", # A link to the parent.
2095 },
2096 ],
2097 "exportLinks": { # Links for exporting Google Docs to specific formats.
2098 "a_key": "A String", # A mapping from export format to URL
2099 },
2100 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002101 "permissions": [ # The list of permissions for users with access to this file.
2102 { # A permission for a file.
2103 "withLink": True or False, # Whether the link is required for this permission.
2104 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
2105 "name": "A String", # The name for this permission.
2106 "kind": "drive#permission", # This is always drive#permission.
2107 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2108 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2109 "authKey": "A String", # The authkey parameter required for this permission.
2110 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002111 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07002112 "photoLink": "A String", # A link to the profile photo, if available.
2113 "role": "A String", # The primary role for this user. Allowed values are:
2114 # - owner
2115 # - reader
2116 # - writer
2117 "type": "A String", # The account type. Allowed values are:
2118 # - user
2119 # - group
2120 # - domain
2121 # - anyone
2122 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2123 "A String",
2124 ],
2125 "selfLink": "A String", # A link back to this permission.
2126 },
2127 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002128 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04002129 "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.
2130 "a_key": "A String",
2131 },
2132 "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.
2133 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2134 "exposureTime": 3.14, # The length of the exposure, in seconds.
2135 "cameraMake": "A String", # The make of the camera used to create the photo.
2136 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2137 "isoSpeed": 42, # The ISO speed used to create the photo.
2138 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2139 "exposureMode": "A String", # The exposure mode used to create the photo.
2140 "colorSpace": "A String", # The color space of the photo.
2141 "location": { # Geographic location information stored in the image.
2142 "latitude": 3.14, # The latitude stored in the image.
2143 "altitude": 3.14, # The altitude stored in the image.
2144 "longitude": 3.14, # The longitude stored in the image.
2145 },
2146 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2147 "height": 42, # The height of the image in pixels.
2148 "lens": "A String", # The lens used to create the photo.
2149 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2150 "width": 42, # The width of the image in pixels.
2151 "meteringMode": "A String", # The metering mode used to create the photo.
2152 "flashUsed": True or False, # Whether a flash was used to create the photo.
2153 "aperture": 3.14, # The aperture used to create the photo (f-number).
2154 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2155 "sensor": "A String", # The type of sensor used to create the photo.
2156 "whiteBalance": "A String", # The white balance mode used to create the photo.
2157 "cameraModel": "A String", # The model of the camera used to create the photo.
2158 },
2159 "description": "A String", # A short description of the file.
2160 "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.
2161 "editable": True or False, # Whether the file can be edited by the current user.
2162 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002163 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002164 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002165 "fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002166 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002167 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002168 { # A key-value pair attached to a file that is either public or private to an application.
2169 # The following limits apply to file properties:
2170 # - Maximum of 100 properties total per file
2171 # - Maximum of 30 private properties per app
2172 # - Maximum of 30 public properties
2173 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04002174 "kind": "drive#property", # This is always drive#property.
2175 "value": "A String", # The value of this property.
2176 "etag": "A String", # ETag of the property.
2177 "visibility": "A String", # The visibility of this property.
2178 "key": "A String", # The key of this property.
2179 "selfLink": "A String", # The link back to this property.
2180 },
2181 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002182 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04002183 "iconLink": "A String", # A link to the file's icon.
2184 "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.
2185 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002186 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002187 "title": "A String", # The title of this file.
2188 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -07002189 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2190 "mimeType": "A String", # The MIME type of the thumbnail.
2191 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2192 },
2193 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002194 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2195 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002196 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04002197 "name": "A String", # The name for this permission.
2198 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002199 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2200 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04002201 "authKey": "A String", # The authkey parameter required for this permission.
2202 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002203 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04002204 "photoLink": "A String", # A link to the profile photo, if available.
2205 "role": "A String", # The primary role for this user. Allowed values are:
2206 # - owner
2207 # - reader
2208 # - writer
2209 "type": "A String", # The account type. Allowed values are:
2210 # - user
2211 # - group
2212 # - domain
2213 # - anyone
2214 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2215 "A String",
2216 ],
2217 "selfLink": "A String", # A link back to this permission.
2218 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002219 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002220 "A String",
2221 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002222 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
2223 "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
2224 "fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
2225 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04002226 "selfLink": "A String", # A link back to this file.
2227 "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.
2228 }</pre>
2229</div>
2230
2231<div class="method">
2232 <code class="details" id="trash">trash(fileId)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -07002233 <pre>Moves a file to the trash. The currently authenticated user must own the file.
John Asmuth614db982014-04-24 15:46:26 -04002234
2235Args:
2236 fileId: string, The ID of the file to trash. (required)
2237
2238Returns:
2239 An object of the form:
2240
2241 { # The metadata for a file.
2242 "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.
2243 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002244 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
2245 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002246 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04002247 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002248 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04002249 "hidden": True or False, # Deprecated.
2250 "viewed": True or False, # Whether this file has been viewed by this user.
2251 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002252 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04002253 },
2254 "indexableText": { # Indexable text attributes for the file (can only be written)
2255 "text": "A String", # The text to be indexed for this file.
2256 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002257 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
John Asmuth614db982014-04-24 15:46:26 -04002258 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2259 "writersCanShare": True or False, # Whether writers can share the document with other users.
2260 "owners": [ # The owner(s) of this file.
2261 { # The JSON template for a user.
2262 "picture": { # The user's profile picture.
2263 "url": "A String", # A URL that points to a profile picture of this user.
2264 },
2265 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002266 "displayName": "A String", # A plain text displayable name for this user.
2267 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002268 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2269 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002270 },
2271 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002272 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04002273 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002274 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2275 "picture": { # The user's profile picture.
2276 "url": "A String", # A URL that points to a profile picture of this user.
2277 },
2278 "kind": "drive#user", # This is always drive#user.
2279 "displayName": "A String", # A plain text displayable name for this user.
2280 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2281 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2282 "emailAddress": "A String", # The email address of the user.
2283 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002284 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2285 "width": 42, # The width of the video in pixels.
2286 "durationMillis": "A String", # The duration of the video in milliseconds.
2287 "height": 42, # The height of the video in pixels.
2288 },
John Asmuth614db982014-04-24 15:46:26 -04002289 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2290 "picture": { # The user's profile picture.
2291 "url": "A String", # A URL that points to a profile picture of this user.
2292 },
2293 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002294 "displayName": "A String", # A plain text displayable name for this user.
2295 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002296 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2297 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002298 },
2299 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002300 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Takashi Matsuo06694102015-09-11 13:55:40 -07002301 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002302 "ownerNames": [ # Name(s) of the owner(s) of this file.
2303 "A String",
2304 ],
2305 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2306 "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.
2307 "etag": "A String", # ETag of the file.
2308 "parents": [ # Collection of parent folders which contain this file.
2309 # 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.
2310 { # A reference to a file's parent.
2311 "selfLink": "A String", # A link back to this reference.
2312 "kind": "drive#parentReference", # This is always drive#parentReference.
2313 "id": "A String", # The ID of the parent.
2314 "isRoot": True or False, # Whether or not the parent is the root folder.
2315 "parentLink": "A String", # A link to the parent.
2316 },
2317 ],
2318 "exportLinks": { # Links for exporting Google Docs to specific formats.
2319 "a_key": "A String", # A mapping from export format to URL
2320 },
2321 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002322 "permissions": [ # The list of permissions for users with access to this file.
2323 { # A permission for a file.
2324 "withLink": True or False, # Whether the link is required for this permission.
2325 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
2326 "name": "A String", # The name for this permission.
2327 "kind": "drive#permission", # This is always drive#permission.
2328 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2329 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2330 "authKey": "A String", # The authkey parameter required for this permission.
2331 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002332 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07002333 "photoLink": "A String", # A link to the profile photo, if available.
2334 "role": "A String", # The primary role for this user. Allowed values are:
2335 # - owner
2336 # - reader
2337 # - writer
2338 "type": "A String", # The account type. Allowed values are:
2339 # - user
2340 # - group
2341 # - domain
2342 # - anyone
2343 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2344 "A String",
2345 ],
2346 "selfLink": "A String", # A link back to this permission.
2347 },
2348 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002349 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04002350 "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.
2351 "a_key": "A String",
2352 },
2353 "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.
2354 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2355 "exposureTime": 3.14, # The length of the exposure, in seconds.
2356 "cameraMake": "A String", # The make of the camera used to create the photo.
2357 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2358 "isoSpeed": 42, # The ISO speed used to create the photo.
2359 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2360 "exposureMode": "A String", # The exposure mode used to create the photo.
2361 "colorSpace": "A String", # The color space of the photo.
2362 "location": { # Geographic location information stored in the image.
2363 "latitude": 3.14, # The latitude stored in the image.
2364 "altitude": 3.14, # The altitude stored in the image.
2365 "longitude": 3.14, # The longitude stored in the image.
2366 },
2367 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2368 "height": 42, # The height of the image in pixels.
2369 "lens": "A String", # The lens used to create the photo.
2370 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2371 "width": 42, # The width of the image in pixels.
2372 "meteringMode": "A String", # The metering mode used to create the photo.
2373 "flashUsed": True or False, # Whether a flash was used to create the photo.
2374 "aperture": 3.14, # The aperture used to create the photo (f-number).
2375 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2376 "sensor": "A String", # The type of sensor used to create the photo.
2377 "whiteBalance": "A String", # The white balance mode used to create the photo.
2378 "cameraModel": "A String", # The model of the camera used to create the photo.
2379 },
2380 "description": "A String", # A short description of the file.
2381 "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.
2382 "editable": True or False, # Whether the file can be edited by the current user.
2383 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002384 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002385 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002386 "fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002387 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002388 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002389 { # A key-value pair attached to a file that is either public or private to an application.
2390 # The following limits apply to file properties:
2391 # - Maximum of 100 properties total per file
2392 # - Maximum of 30 private properties per app
2393 # - Maximum of 30 public properties
2394 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04002395 "kind": "drive#property", # This is always drive#property.
2396 "value": "A String", # The value of this property.
2397 "etag": "A String", # ETag of the property.
2398 "visibility": "A String", # The visibility of this property.
2399 "key": "A String", # The key of this property.
2400 "selfLink": "A String", # The link back to this property.
2401 },
2402 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002403 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04002404 "iconLink": "A String", # A link to the file's icon.
2405 "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.
2406 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002407 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002408 "title": "A String", # The title of this file.
2409 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -07002410 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2411 "mimeType": "A String", # The MIME type of the thumbnail.
2412 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2413 },
2414 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002415 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2416 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002417 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04002418 "name": "A String", # The name for this permission.
2419 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002420 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2421 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04002422 "authKey": "A String", # The authkey parameter required for this permission.
2423 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002424 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04002425 "photoLink": "A String", # A link to the profile photo, if available.
2426 "role": "A String", # The primary role for this user. Allowed values are:
2427 # - owner
2428 # - reader
2429 # - writer
2430 "type": "A String", # The account type. Allowed values are:
2431 # - user
2432 # - group
2433 # - domain
2434 # - anyone
2435 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2436 "A String",
2437 ],
2438 "selfLink": "A String", # A link back to this permission.
2439 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002440 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002441 "A String",
2442 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002443 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
2444 "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
2445 "fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
2446 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04002447 "selfLink": "A String", # A link back to this file.
2448 "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.
2449 }</pre>
2450</div>
2451
2452<div class="method">
2453 <code class="details" id="untrash">untrash(fileId)</code>
2454 <pre>Restores a file from the trash.
2455
2456Args:
2457 fileId: string, The ID of the file to untrash. (required)
2458
2459Returns:
2460 An object of the form:
2461
2462 { # The metadata for a file.
2463 "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.
2464 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002465 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
2466 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002467 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04002468 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002469 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04002470 "hidden": True or False, # Deprecated.
2471 "viewed": True or False, # Whether this file has been viewed by this user.
2472 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002473 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04002474 },
2475 "indexableText": { # Indexable text attributes for the file (can only be written)
2476 "text": "A String", # The text to be indexed for this file.
2477 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002478 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
John Asmuth614db982014-04-24 15:46:26 -04002479 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2480 "writersCanShare": True or False, # Whether writers can share the document with other users.
2481 "owners": [ # The owner(s) of this file.
2482 { # The JSON template for a user.
2483 "picture": { # The user's profile picture.
2484 "url": "A String", # A URL that points to a profile picture of this user.
2485 },
2486 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002487 "displayName": "A String", # A plain text displayable name for this user.
2488 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002489 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2490 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002491 },
2492 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002493 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04002494 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002495 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2496 "picture": { # The user's profile picture.
2497 "url": "A String", # A URL that points to a profile picture of this user.
2498 },
2499 "kind": "drive#user", # This is always drive#user.
2500 "displayName": "A String", # A plain text displayable name for this user.
2501 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2502 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2503 "emailAddress": "A String", # The email address of the user.
2504 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002505 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2506 "width": 42, # The width of the video in pixels.
2507 "durationMillis": "A String", # The duration of the video in milliseconds.
2508 "height": 42, # The height of the video in pixels.
2509 },
John Asmuth614db982014-04-24 15:46:26 -04002510 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2511 "picture": { # The user's profile picture.
2512 "url": "A String", # A URL that points to a profile picture of this user.
2513 },
2514 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002515 "displayName": "A String", # A plain text displayable name for this user.
2516 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002517 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2518 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002519 },
2520 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002521 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Takashi Matsuo06694102015-09-11 13:55:40 -07002522 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002523 "ownerNames": [ # Name(s) of the owner(s) of this file.
2524 "A String",
2525 ],
2526 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2527 "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.
2528 "etag": "A String", # ETag of the file.
2529 "parents": [ # Collection of parent folders which contain this file.
2530 # 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.
2531 { # A reference to a file's parent.
2532 "selfLink": "A String", # A link back to this reference.
2533 "kind": "drive#parentReference", # This is always drive#parentReference.
2534 "id": "A String", # The ID of the parent.
2535 "isRoot": True or False, # Whether or not the parent is the root folder.
2536 "parentLink": "A String", # A link to the parent.
2537 },
2538 ],
2539 "exportLinks": { # Links for exporting Google Docs to specific formats.
2540 "a_key": "A String", # A mapping from export format to URL
2541 },
2542 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002543 "permissions": [ # The list of permissions for users with access to this file.
2544 { # A permission for a file.
2545 "withLink": True or False, # Whether the link is required for this permission.
2546 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
2547 "name": "A String", # The name for this permission.
2548 "kind": "drive#permission", # This is always drive#permission.
2549 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2550 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2551 "authKey": "A String", # The authkey parameter required for this permission.
2552 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002553 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07002554 "photoLink": "A String", # A link to the profile photo, if available.
2555 "role": "A String", # The primary role for this user. Allowed values are:
2556 # - owner
2557 # - reader
2558 # - writer
2559 "type": "A String", # The account type. Allowed values are:
2560 # - user
2561 # - group
2562 # - domain
2563 # - anyone
2564 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2565 "A String",
2566 ],
2567 "selfLink": "A String", # A link back to this permission.
2568 },
2569 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002570 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04002571 "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.
2572 "a_key": "A String",
2573 },
2574 "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.
2575 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2576 "exposureTime": 3.14, # The length of the exposure, in seconds.
2577 "cameraMake": "A String", # The make of the camera used to create the photo.
2578 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2579 "isoSpeed": 42, # The ISO speed used to create the photo.
2580 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2581 "exposureMode": "A String", # The exposure mode used to create the photo.
2582 "colorSpace": "A String", # The color space of the photo.
2583 "location": { # Geographic location information stored in the image.
2584 "latitude": 3.14, # The latitude stored in the image.
2585 "altitude": 3.14, # The altitude stored in the image.
2586 "longitude": 3.14, # The longitude stored in the image.
2587 },
2588 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2589 "height": 42, # The height of the image in pixels.
2590 "lens": "A String", # The lens used to create the photo.
2591 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2592 "width": 42, # The width of the image in pixels.
2593 "meteringMode": "A String", # The metering mode used to create the photo.
2594 "flashUsed": True or False, # Whether a flash was used to create the photo.
2595 "aperture": 3.14, # The aperture used to create the photo (f-number).
2596 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2597 "sensor": "A String", # The type of sensor used to create the photo.
2598 "whiteBalance": "A String", # The white balance mode used to create the photo.
2599 "cameraModel": "A String", # The model of the camera used to create the photo.
2600 },
2601 "description": "A String", # A short description of the file.
2602 "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.
2603 "editable": True or False, # Whether the file can be edited by the current user.
2604 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002605 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002606 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002607 "fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002608 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002609 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002610 { # A key-value pair attached to a file that is either public or private to an application.
2611 # The following limits apply to file properties:
2612 # - Maximum of 100 properties total per file
2613 # - Maximum of 30 private properties per app
2614 # - Maximum of 30 public properties
2615 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04002616 "kind": "drive#property", # This is always drive#property.
2617 "value": "A String", # The value of this property.
2618 "etag": "A String", # ETag of the property.
2619 "visibility": "A String", # The visibility of this property.
2620 "key": "A String", # The key of this property.
2621 "selfLink": "A String", # The link back to this property.
2622 },
2623 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002624 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04002625 "iconLink": "A String", # A link to the file's icon.
2626 "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.
2627 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002628 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002629 "title": "A String", # The title of this file.
2630 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -07002631 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2632 "mimeType": "A String", # The MIME type of the thumbnail.
2633 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2634 },
2635 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002636 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2637 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002638 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04002639 "name": "A String", # The name for this permission.
2640 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002641 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2642 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04002643 "authKey": "A String", # The authkey parameter required for this permission.
2644 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002645 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04002646 "photoLink": "A String", # A link to the profile photo, if available.
2647 "role": "A String", # The primary role for this user. Allowed values are:
2648 # - owner
2649 # - reader
2650 # - writer
2651 "type": "A String", # The account type. Allowed values are:
2652 # - user
2653 # - group
2654 # - domain
2655 # - anyone
2656 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2657 "A String",
2658 ],
2659 "selfLink": "A String", # A link back to this permission.
2660 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002661 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002662 "A String",
2663 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002664 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
2665 "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
2666 "fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
2667 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04002668 "selfLink": "A String", # A link back to this file.
2669 "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.
2670 }</pre>
2671</div>
2672
2673<div class="method">
Takashi Matsuo06694102015-09-11 13:55:40 -07002674 <code class="details" id="update">update(fileId, body=None, newRevision=None, modifiedDateBehavior=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, addParents=None, removeParents=None, updateViewedDate=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, setModifiedDate=None, timedTextLanguage=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04002675 <pre>Updates file metadata and/or content.
2676
2677Args:
2678 fileId: string, The ID of the file to update. (required)
2679 body: object, The request body.
2680 The object takes the form of:
2681
2682{ # The metadata for a file.
2683 "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.
2684 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002685 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
2686 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002687 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04002688 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002689 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04002690 "hidden": True or False, # Deprecated.
2691 "viewed": True or False, # Whether this file has been viewed by this user.
2692 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002693 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04002694 },
2695 "indexableText": { # Indexable text attributes for the file (can only be written)
2696 "text": "A String", # The text to be indexed for this file.
2697 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002698 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
John Asmuth614db982014-04-24 15:46:26 -04002699 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2700 "writersCanShare": True or False, # Whether writers can share the document with other users.
2701 "owners": [ # The owner(s) of this file.
2702 { # The JSON template for a user.
2703 "picture": { # The user's profile picture.
2704 "url": "A String", # A URL that points to a profile picture of this user.
2705 },
2706 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002707 "displayName": "A String", # A plain text displayable name for this user.
2708 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002709 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2710 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002711 },
2712 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002713 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04002714 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002715 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2716 "picture": { # The user's profile picture.
2717 "url": "A String", # A URL that points to a profile picture of this user.
2718 },
2719 "kind": "drive#user", # This is always drive#user.
2720 "displayName": "A String", # A plain text displayable name for this user.
2721 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2722 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2723 "emailAddress": "A String", # The email address of the user.
2724 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002725 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2726 "width": 42, # The width of the video in pixels.
2727 "durationMillis": "A String", # The duration of the video in milliseconds.
2728 "height": 42, # The height of the video in pixels.
2729 },
John Asmuth614db982014-04-24 15:46:26 -04002730 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2731 "picture": { # The user's profile picture.
2732 "url": "A String", # A URL that points to a profile picture of this user.
2733 },
2734 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002735 "displayName": "A String", # A plain text displayable name for this user.
2736 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002737 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2738 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002739 },
2740 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002741 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Takashi Matsuo06694102015-09-11 13:55:40 -07002742 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002743 "ownerNames": [ # Name(s) of the owner(s) of this file.
2744 "A String",
2745 ],
2746 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2747 "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.
2748 "etag": "A String", # ETag of the file.
2749 "parents": [ # Collection of parent folders which contain this file.
2750 # 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.
2751 { # A reference to a file's parent.
2752 "selfLink": "A String", # A link back to this reference.
2753 "kind": "drive#parentReference", # This is always drive#parentReference.
2754 "id": "A String", # The ID of the parent.
2755 "isRoot": True or False, # Whether or not the parent is the root folder.
2756 "parentLink": "A String", # A link to the parent.
2757 },
2758 ],
2759 "exportLinks": { # Links for exporting Google Docs to specific formats.
2760 "a_key": "A String", # A mapping from export format to URL
2761 },
2762 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002763 "permissions": [ # The list of permissions for users with access to this file.
2764 { # A permission for a file.
2765 "withLink": True or False, # Whether the link is required for this permission.
2766 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
2767 "name": "A String", # The name for this permission.
2768 "kind": "drive#permission", # This is always drive#permission.
2769 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2770 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2771 "authKey": "A String", # The authkey parameter required for this permission.
2772 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002773 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07002774 "photoLink": "A String", # A link to the profile photo, if available.
2775 "role": "A String", # The primary role for this user. Allowed values are:
2776 # - owner
2777 # - reader
2778 # - writer
2779 "type": "A String", # The account type. Allowed values are:
2780 # - user
2781 # - group
2782 # - domain
2783 # - anyone
2784 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2785 "A String",
2786 ],
2787 "selfLink": "A String", # A link back to this permission.
2788 },
2789 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002790 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04002791 "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.
2792 "a_key": "A String",
2793 },
2794 "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.
2795 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2796 "exposureTime": 3.14, # The length of the exposure, in seconds.
2797 "cameraMake": "A String", # The make of the camera used to create the photo.
2798 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2799 "isoSpeed": 42, # The ISO speed used to create the photo.
2800 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2801 "exposureMode": "A String", # The exposure mode used to create the photo.
2802 "colorSpace": "A String", # The color space of the photo.
2803 "location": { # Geographic location information stored in the image.
2804 "latitude": 3.14, # The latitude stored in the image.
2805 "altitude": 3.14, # The altitude stored in the image.
2806 "longitude": 3.14, # The longitude stored in the image.
2807 },
2808 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2809 "height": 42, # The height of the image in pixels.
2810 "lens": "A String", # The lens used to create the photo.
2811 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2812 "width": 42, # The width of the image in pixels.
2813 "meteringMode": "A String", # The metering mode used to create the photo.
2814 "flashUsed": True or False, # Whether a flash was used to create the photo.
2815 "aperture": 3.14, # The aperture used to create the photo (f-number).
2816 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2817 "sensor": "A String", # The type of sensor used to create the photo.
2818 "whiteBalance": "A String", # The white balance mode used to create the photo.
2819 "cameraModel": "A String", # The model of the camera used to create the photo.
2820 },
2821 "description": "A String", # A short description of the file.
2822 "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.
2823 "editable": True or False, # Whether the file can be edited by the current user.
2824 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002825 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002826 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002827 "fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002828 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002829 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002830 { # A key-value pair attached to a file that is either public or private to an application.
2831 # The following limits apply to file properties:
2832 # - Maximum of 100 properties total per file
2833 # - Maximum of 30 private properties per app
2834 # - Maximum of 30 public properties
2835 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04002836 "kind": "drive#property", # This is always drive#property.
2837 "value": "A String", # The value of this property.
2838 "etag": "A String", # ETag of the property.
2839 "visibility": "A String", # The visibility of this property.
2840 "key": "A String", # The key of this property.
2841 "selfLink": "A String", # The link back to this property.
2842 },
2843 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002844 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04002845 "iconLink": "A String", # A link to the file's icon.
2846 "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.
2847 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002848 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002849 "title": "A String", # The title of this file.
2850 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -07002851 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2852 "mimeType": "A String", # The MIME type of the thumbnail.
2853 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2854 },
2855 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002856 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2857 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002858 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04002859 "name": "A String", # The name for this permission.
2860 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07002861 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
2862 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04002863 "authKey": "A String", # The authkey parameter required for this permission.
2864 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002865 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04002866 "photoLink": "A String", # A link to the profile photo, if available.
2867 "role": "A String", # The primary role for this user. Allowed values are:
2868 # - owner
2869 # - reader
2870 # - writer
2871 "type": "A String", # The account type. Allowed values are:
2872 # - user
2873 # - group
2874 # - domain
2875 # - anyone
2876 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2877 "A String",
2878 ],
2879 "selfLink": "A String", # A link back to this permission.
2880 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002881 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002882 "A String",
2883 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002884 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
2885 "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
2886 "fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
2887 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04002888 "selfLink": "A String", # A link back to this file.
2889 "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.
2890}
2891
Takashi Matsuo06694102015-09-11 13:55:40 -07002892 newRevision: boolean, Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center.
2893 modifiedDateBehavior: string, Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.
2894 Allowed values
2895 fromBody - Set modifiedDate to the value provided in the body of the request. No change if no value was provided.
2896 fromBodyIfNeeded - Set modifiedDate to the value provided in the body of the request depending on other contents of the update.
2897 fromBodyOrNow - Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.
2898 noChange - Maintain the previous value of modifiedDate.
2899 now - Set modifiedDate to the current time.
2900 nowIfNeeded - Set modifiedDate to the current time depending on contents of the update.
John Asmuth614db982014-04-24 15:46:26 -04002901 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002902 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
John Asmuth614db982014-04-24 15:46:26 -04002903 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002904 pinned: boolean, Whether to pin the new revision. A file can have a maximum of 200 pinned revisions.
Craig Citro065b5302014-08-14 00:47:23 -07002905 addParents: string, Comma-separated list of parent IDs to add.
2906 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04002907 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
2908 timedTextTrackName: string, The timed text track name.
Takashi Matsuo06694102015-09-11 13:55:40 -07002909 convert: boolean, This parameter is deprecated and has no function.
John Asmuth614db982014-04-24 15:46:26 -04002910 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
2911 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
2912 timedTextLanguage: string, The language of the timed text.
2913
2914Returns:
2915 An object of the form:
2916
2917 { # The metadata for a file.
2918 "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.
2919 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002920 "version": "A String", # A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
2921 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002922 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours.
John Asmuth614db982014-04-24 15:46:26 -04002923 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002924 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04002925 "hidden": True or False, # Deprecated.
2926 "viewed": True or False, # Whether this file has been viewed by this user.
2927 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002928 "trashed": True or False, # Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
John Asmuth614db982014-04-24 15:46:26 -04002929 },
2930 "indexableText": { # Indexable text attributes for the file (can only be written)
2931 "text": "A String", # The text to be indexed for this file.
2932 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002933 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
John Asmuth614db982014-04-24 15:46:26 -04002934 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2935 "writersCanShare": True or False, # Whether writers can share the document with other users.
2936 "owners": [ # The owner(s) of this file.
2937 { # The JSON template for a user.
2938 "picture": { # The user's profile picture.
2939 "url": "A String", # A URL that points to a profile picture of this user.
2940 },
2941 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002942 "displayName": "A String", # A plain text displayable name for this user.
2943 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002944 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2945 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002946 },
2947 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002948 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04002949 "id": "A String", # The ID of the file.
Craig Citro065b5302014-08-14 00:47:23 -07002950 "sharingUser": { # The JSON template for a user. # User that shared the item with the current user, if available.
2951 "picture": { # The user's profile picture.
2952 "url": "A String", # A URL that points to a profile picture of this user.
2953 },
2954 "kind": "drive#user", # This is always drive#user.
2955 "displayName": "A String", # A plain text displayable name for this user.
2956 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2957 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2958 "emailAddress": "A String", # The email address of the user.
2959 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002960 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2961 "width": 42, # The width of the video in pixels.
2962 "durationMillis": "A String", # The duration of the video in milliseconds.
2963 "height": 42, # The height of the video in pixels.
2964 },
John Asmuth614db982014-04-24 15:46:26 -04002965 "lastModifyingUser": { # The JSON template for a user. # The last user to modify this file.
2966 "picture": { # The user's profile picture.
2967 "url": "A String", # A URL that points to a profile picture of this user.
2968 },
2969 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002970 "displayName": "A String", # A plain text displayable name for this user.
2971 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002972 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2973 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002974 },
2975 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002976 "folderColorRgb": "A String", # Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
Takashi Matsuo06694102015-09-11 13:55:40 -07002977 "markedViewedByMeDate": "A String", # Time this file was explicitly marked viewed by the user (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002978 "ownerNames": [ # Name(s) of the owner(s) of this file.
2979 "A String",
2980 ],
2981 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2982 "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.
2983 "etag": "A String", # ETag of the file.
2984 "parents": [ # Collection of parent folders which contain this file.
2985 # 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.
2986 { # A reference to a file's parent.
2987 "selfLink": "A String", # A link back to this reference.
2988 "kind": "drive#parentReference", # This is always drive#parentReference.
2989 "id": "A String", # The ID of the parent.
2990 "isRoot": True or False, # Whether or not the parent is the root folder.
2991 "parentLink": "A String", # A link to the parent.
2992 },
2993 ],
2994 "exportLinks": { # Links for exporting Google Docs to specific formats.
2995 "a_key": "A String", # A mapping from export format to URL
2996 },
2997 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002998 "permissions": [ # The list of permissions for users with access to this file.
2999 { # A permission for a file.
3000 "withLink": True or False, # Whether the link is required for this permission.
3001 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
3002 "name": "A String", # The name for this permission.
3003 "kind": "drive#permission", # This is always drive#permission.
3004 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
3005 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
3006 "authKey": "A String", # The authkey parameter required for this permission.
3007 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08003008 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Craig Citro065b5302014-08-14 00:47:23 -07003009 "photoLink": "A String", # A link to the profile photo, if available.
3010 "role": "A String", # The primary role for this user. Allowed values are:
3011 # - owner
3012 # - reader
3013 # - writer
3014 "type": "A String", # The account type. Allowed values are:
3015 # - user
3016 # - group
3017 # - domain
3018 # - anyone
3019 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
3020 "A String",
3021 ],
3022 "selfLink": "A String", # A link back to this permission.
3023 },
3024 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07003025 "fullFileExtension": "A String", # The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04003026 "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.
3027 "a_key": "A String",
3028 },
3029 "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.
3030 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
3031 "exposureTime": 3.14, # The length of the exposure, in seconds.
3032 "cameraMake": "A String", # The make of the camera used to create the photo.
3033 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
3034 "isoSpeed": 42, # The ISO speed used to create the photo.
3035 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
3036 "exposureMode": "A String", # The exposure mode used to create the photo.
3037 "colorSpace": "A String", # The color space of the photo.
3038 "location": { # Geographic location information stored in the image.
3039 "latitude": 3.14, # The latitude stored in the image.
3040 "altitude": 3.14, # The altitude stored in the image.
3041 "longitude": 3.14, # The longitude stored in the image.
3042 },
3043 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
3044 "height": 42, # The height of the image in pixels.
3045 "lens": "A String", # The lens used to create the photo.
3046 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
3047 "width": 42, # The width of the image in pixels.
3048 "meteringMode": "A String", # The metering mode used to create the photo.
3049 "flashUsed": True or False, # Whether a flash was used to create the photo.
3050 "aperture": 3.14, # The aperture used to create the photo (f-number).
3051 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
3052 "sensor": "A String", # The type of sensor used to create the photo.
3053 "whiteBalance": "A String", # The white balance mode used to create the photo.
3054 "cameraModel": "A String", # The model of the camera used to create the photo.
3055 },
3056 "description": "A String", # A short description of the file.
3057 "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.
3058 "editable": True or False, # Whether the file can be edited by the current user.
3059 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07003060 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04003061 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07003062 "fileSize": "A String", # The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07003063 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04003064 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003065 { # A key-value pair attached to a file that is either public or private to an application.
3066 # The following limits apply to file properties:
3067 # - Maximum of 100 properties total per file
3068 # - Maximum of 30 private properties per app
3069 # - Maximum of 30 public properties
3070 # - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property.
John Asmuth614db982014-04-24 15:46:26 -04003071 "kind": "drive#property", # This is always drive#property.
3072 "value": "A String", # The value of this property.
3073 "etag": "A String", # ETag of the property.
3074 "visibility": "A String", # The visibility of this property.
3075 "key": "A String", # The key of this property.
3076 "selfLink": "A String", # The link back to this property.
3077 },
3078 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07003079 "md5Checksum": "A String", # An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04003080 "iconLink": "A String", # A link to the file's icon.
3081 "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.
3082 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07003083 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04003084 "title": "A String", # The title of this file.
3085 "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.
Takashi Matsuo06694102015-09-11 13:55:40 -07003086 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
3087 "mimeType": "A String", # The MIME type of the thumbnail.
3088 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
3089 },
3090 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04003091 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
3092 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07003093 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -04003094 "name": "A String", # The name for this permission.
3095 "kind": "drive#permission", # This is always drive#permission.
Craig Citro065b5302014-08-14 00:47:23 -07003096 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
3097 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified.
John Asmuth614db982014-04-24 15:46:26 -04003098 "authKey": "A String", # The authkey parameter required for this permission.
3099 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08003100 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
John Asmuth614db982014-04-24 15:46:26 -04003101 "photoLink": "A String", # A link to the profile photo, if available.
3102 "role": "A String", # The primary role for this user. Allowed values are:
3103 # - owner
3104 # - reader
3105 # - writer
3106 "type": "A String", # The account type. Allowed values are:
3107 # - user
3108 # - group
3109 # - domain
3110 # - anyone
3111 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
3112 "A String",
3113 ],
3114 "selfLink": "A String", # A link back to this permission.
3115 },
Takashi Matsuo06694102015-09-11 13:55:40 -07003116 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003117 "A String",
3118 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07003119 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
3120 "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 field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
3121 "fileExtension": "A String", # The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
3122 "headRevisionId": "A String", # The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files.
John Asmuth614db982014-04-24 15:46:26 -04003123 "selfLink": "A String", # A link back to this file.
3124 "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.
3125 }</pre>
3126</div>
3127
3128<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003129 <code class="details" id="watch">watch(fileId, body, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04003130 <pre>Subscribe to changes on a file
3131
3132Args:
3133 fileId: string, The ID for the file in question. (required)
3134 body: object, The request body. (required)
3135 The object takes the form of:
3136
3137{ # An notification channel used to watch for resource changes.
3138 "resourceUri": "A String", # A version-specific identifier for the watched resource.
3139 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
3140 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
3141 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
3142 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
3143 "params": { # Additional parameters controlling delivery channel behavior. Optional.
3144 "a_key": "A String", # Declares a new parameter by name.
3145 },
3146 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
3147 "address": "A String", # The address where notifications are delivered for this channel.
3148 "type": "A String", # The type of delivery mechanism used for this channel.
3149 "id": "A String", # A UUID or similar unique string that identifies this channel.
3150 }
3151
3152 projection: string, This parameter is deprecated and has no function.
3153 Allowed values
3154 BASIC - Deprecated
3155 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003156 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -08003157 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
John Asmuth614db982014-04-24 15:46:26 -04003158 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
3159
3160Returns:
3161 An object of the form:
3162
3163 { # An notification channel used to watch for resource changes.
3164 "resourceUri": "A String", # A version-specific identifier for the watched resource.
3165 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
3166 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
3167 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
3168 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
3169 "params": { # Additional parameters controlling delivery channel behavior. Optional.
3170 "a_key": "A String", # Declares a new parameter by name.
3171 },
3172 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
3173 "address": "A String", # The address where notifications are delivered for this channel.
3174 "type": "A String", # The type of delivery mechanism used for this channel.
3175 "id": "A String", # A UUID or similar unique string that identifies this channel.
3176 }</pre>
3177</div>
3178
Craig Citroe633be12015-03-02 13:40:36 -08003179<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003180 <code class="details" id="watch_media">watch_media(fileId, body, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
Craig Citroe633be12015-03-02 13:40:36 -08003181 <pre>Subscribe to changes on a file
3182
3183Args:
3184 fileId: string, The ID for the file in question. (required)
3185 body: object, The request body. (required)
3186 The object takes the form of:
3187
3188{ # An notification channel used to watch for resource changes.
3189 "resourceUri": "A String", # A version-specific identifier for the watched resource.
3190 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
3191 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
3192 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
3193 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
3194 "params": { # Additional parameters controlling delivery channel behavior. Optional.
3195 "a_key": "A String", # Declares a new parameter by name.
3196 },
3197 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
3198 "address": "A String", # The address where notifications are delivered for this channel.
3199 "type": "A String", # The type of delivery mechanism used for this channel.
3200 "id": "A String", # A UUID or similar unique string that identifies this channel.
3201 }
3202
3203 projection: string, This parameter is deprecated and has no function.
3204 Allowed values
3205 BASIC - Deprecated
3206 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003207 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -08003208 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
3209 updateViewedDate: boolean, Whether to update the view date after successfully retrieving the file.
3210
3211Returns:
3212 The media object as a string.
3213
3214 </pre>
3215</div>
3216
John Asmuth614db982014-04-24 15:46:26 -04003217</body></html>