blob: 9de4c2cb564dd6f6997f59b16a5fb7463d04a618 [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">
Sai Cheemalapatidf613972016-10-21 13:59:49 -070087 <code><a href="#export">export(fileId, mimeType)</a></code></p>
88<p class="firstline">Exports a Google Doc to the requested MIME type and returns the exported content.</p>
89<p class="toc_element">
90 <code><a href="#export_media">export_media(fileId, mimeType)</a></code></p>
91<p class="firstline">Exports a Google Doc to the requested MIME type and returns the exported content.</p>
92<p class="toc_element">
Takashi Matsuo06694102015-09-11 13:55:40 -070093 <code><a href="#generateIds">generateIds(space=None, maxResults=None)</a></code></p>
94<p class="firstline">Generates a set of file IDs which can be provided in insert requests.</p>
95<p class="toc_element">
Nathaniel Manista4f877e52015-06-15 16:44:50 +000096 <code><a href="#get">get(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</a></code></p>
Craig Citroe633be12015-03-02 13:40:36 -080097<p class="firstline">Gets a file's metadata by ID.</p>
98<p class="toc_element">
Nathaniel Manista4f877e52015-06-15 16:44:50 +000099 <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 -0400100<p class="firstline">Gets a file's metadata by ID.</p>
101<p class="toc_element">
102 <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>
103<p class="firstline">Insert a new file.</p>
104<p class="toc_element">
Takashi Matsuo06694102015-09-11 13:55:40 -0700105 <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 -0400106<p class="firstline">Lists the user's files.</p>
107<p class="toc_element">
108 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
109<p class="firstline">Retrieves the next page of results.</p>
110<p class="toc_element">
Takashi Matsuo06694102015-09-11 13:55:40 -0700111 <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 -0400112<p class="firstline">Updates file metadata and/or content. This method supports patch semantics.</p>
113<p class="toc_element">
114 <code><a href="#touch">touch(fileId)</a></code></p>
115<p class="firstline">Set the file's updated time to the current server time.</p>
116<p class="toc_element">
117 <code><a href="#trash">trash(fileId)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -0700118<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 -0400119<p class="toc_element">
120 <code><a href="#untrash">untrash(fileId)</a></code></p>
121<p class="firstline">Restores a file from the trash.</p>
122<p class="toc_element">
Takashi Matsuo06694102015-09-11 13:55:40 -0700123 <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 -0400124<p class="firstline">Updates file metadata and/or content.</p>
125<p class="toc_element">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000126 <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 -0800127<p class="firstline">Subscribe to changes on a file</p>
128<p class="toc_element">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000129 <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 -0400130<p class="firstline">Subscribe to changes on a file</p>
131<h3>Method Details</h3>
132<div class="method">
133 <code class="details" id="copy">copy(fileId, body, pinned=None, convert=None, visibility=None, ocrLanguage=None, ocr=None, timedTextLanguage=None, timedTextTrackName=None)</code>
134 <pre>Creates a copy of the specified file.
135
136Args:
137 fileId: string, The ID of the file to copy. (required)
138 body: object, The request body. (required)
139 The object takes the form of:
140
141{ # The metadata for a file.
142 "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.
143 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700144 "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.
145 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000146 "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 -0400147 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700148 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -0400149 "hidden": True or False, # Deprecated.
150 "viewed": True or False, # Whether this file has been viewed by this user.
151 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000152 "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 -0400153 },
154 "indexableText": { # Indexable text attributes for the file (can only be written)
155 "text": "A String", # The text to be indexed for this file.
156 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700157 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700158 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -0400159 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
160 "writersCanShare": True or False, # Whether writers can share the document with other users.
161 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700162 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -0400163 "picture": { # The user's profile picture.
164 "url": "A String", # A URL that points to a profile picture of this user.
165 },
166 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400167 "displayName": "A String", # A plain text displayable name for this user.
168 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700169 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
170 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400171 },
172 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700173 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -0400174 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700175 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700176 "picture": { # The user's profile picture.
177 "url": "A String", # A URL that points to a profile picture of this user.
178 },
179 "kind": "drive#user", # This is always drive#user.
180 "displayName": "A String", # A plain text displayable name for this user.
181 "permissionId": "A String", # The user's ID as visible in the permissions collection.
182 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
183 "emailAddress": "A String", # The email address of the user.
184 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700185 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
186 "width": 42, # The width of the video in pixels.
187 "durationMillis": "A String", # The duration of the video in milliseconds.
188 "height": 42, # The height of the video in pixels.
189 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700190 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -0400191 "picture": { # The user's profile picture.
192 "url": "A String", # A URL that points to a profile picture of this user.
193 },
194 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400195 "displayName": "A String", # A plain text displayable name for this user.
196 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700197 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
198 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400199 },
200 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800201 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700202 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400203 "ownerNames": [ # Name(s) of the owner(s) of this file.
204 "A String",
205 ],
206 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
207 "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.
208 "etag": "A String", # ETag of the file.
209 "parents": [ # Collection of parent folders which contain this file.
210 # 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.
211 { # A reference to a file's parent.
212 "selfLink": "A String", # A link back to this reference.
213 "kind": "drive#parentReference", # This is always drive#parentReference.
214 "id": "A String", # The ID of the parent.
215 "isRoot": True or False, # Whether or not the parent is the root folder.
216 "parentLink": "A String", # A link to the parent.
217 },
218 ],
219 "exportLinks": { # Links for exporting Google Docs to specific formats.
220 "a_key": "A String", # A mapping from export format to URL
221 },
222 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700223 "permissions": [ # The list of permissions for users with access to this file.
224 { # A permission for a file.
225 "withLink": True or False, # Whether the link is required for this permission.
226 "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.
227 "name": "A String", # The name for this permission.
228 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700229 "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 unless the permission type anyone, in which case both id and value are ignored.
230 "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 unless the permission type anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -0700231 "authKey": "A String", # The authkey parameter required for this permission.
232 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800233 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700234 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -0700235 "role": "A String", # The primary role for this user. Allowed values are:
236 # - owner
237 # - reader
238 # - writer
239 "type": "A String", # The account type. Allowed values are:
240 # - user
241 # - group
242 # - domain
243 # - anyone
244 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
245 "A String",
246 ],
247 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700248 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700249 },
250 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700251 "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 -0400252 "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.
253 "a_key": "A String",
254 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700255 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
John Asmuth614db982014-04-24 15:46:26 -0400256 "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.
257 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
258 "exposureTime": 3.14, # The length of the exposure, in seconds.
259 "cameraMake": "A String", # The make of the camera used to create the photo.
260 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
261 "isoSpeed": 42, # The ISO speed used to create the photo.
262 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
263 "exposureMode": "A String", # The exposure mode used to create the photo.
264 "colorSpace": "A String", # The color space of the photo.
265 "location": { # Geographic location information stored in the image.
266 "latitude": 3.14, # The latitude stored in the image.
267 "altitude": 3.14, # The altitude stored in the image.
268 "longitude": 3.14, # The longitude stored in the image.
269 },
270 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
271 "height": 42, # The height of the image in pixels.
272 "lens": "A String", # The lens used to create the photo.
273 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
274 "width": 42, # The width of the image in pixels.
275 "meteringMode": "A String", # The metering mode used to create the photo.
276 "flashUsed": True or False, # Whether a flash was used to create the photo.
277 "aperture": 3.14, # The aperture used to create the photo (f-number).
278 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
279 "sensor": "A String", # The type of sensor used to create the photo.
280 "whiteBalance": "A String", # The white balance mode used to create the photo.
281 "cameraModel": "A String", # The model of the camera used to create the photo.
282 },
283 "description": "A String", # A short description of the file.
284 "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.
285 "editable": True or False, # Whether the file can be edited by the current user.
286 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700287 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -0400288 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700289 "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 -0700290 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400291 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000292 { # A key-value pair attached to a file that is either public or private to an application.
293 # The following limits apply to file properties:
294 # - Maximum of 100 properties total per file
295 # - Maximum of 30 private properties per app
296 # - Maximum of 30 public properties
297 # - 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 -0400298 "kind": "drive#property", # This is always drive#property.
299 "value": "A String", # The value of this property.
300 "etag": "A String", # ETag of the property.
301 "visibility": "A String", # The visibility of this property.
302 "key": "A String", # The key of this property.
303 "selfLink": "A String", # The link back to this property.
304 },
305 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700306 "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 -0400307 "iconLink": "A String", # A link to the file's icon.
308 "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.
309 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700310 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400311 "title": "A String", # The title of this file.
312 "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 -0700313 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
314 "mimeType": "A String", # The MIME type of the thumbnail.
315 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
316 },
317 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -0400318 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
319 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700320 "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 -0400321 "name": "A String", # The name for this permission.
322 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700323 "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 unless the permission type anyone, in which case both id and value are ignored.
324 "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 unless the permission type anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400325 "authKey": "A String", # The authkey parameter required for this permission.
326 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800327 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700328 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -0400329 "role": "A String", # The primary role for this user. Allowed values are:
330 # - owner
331 # - reader
332 # - writer
333 "type": "A String", # The account type. Allowed values are:
334 # - user
335 # - group
336 # - domain
337 # - anyone
338 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
339 "A String",
340 ],
341 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700342 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400343 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700344 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000345 "A String",
346 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700347 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700348 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
Takashi Matsuo06694102015-09-11 13:55:40 -0700349 "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.
350 "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 -0400351 "selfLink": "A String", # A link back to this file.
352 "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.
353}
354
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700355 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 -0400356 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
357 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.
358 Allowed values
359 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
360 PRIVATE - The new file will be visible to only the owner.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000361 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 -0400362 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
363 timedTextLanguage: string, The language of the timed text.
364 timedTextTrackName: string, The timed text track name.
365
366Returns:
367 An object of the form:
368
369 { # The metadata for a file.
370 "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.
371 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700372 "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.
373 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000374 "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 -0400375 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700376 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -0400377 "hidden": True or False, # Deprecated.
378 "viewed": True or False, # Whether this file has been viewed by this user.
379 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000380 "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 -0400381 },
382 "indexableText": { # Indexable text attributes for the file (can only be written)
383 "text": "A String", # The text to be indexed for this file.
384 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700385 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700386 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -0400387 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
388 "writersCanShare": True or False, # Whether writers can share the document with other users.
389 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700390 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -0400391 "picture": { # The user's profile picture.
392 "url": "A String", # A URL that points to a profile picture of this user.
393 },
394 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400395 "displayName": "A String", # A plain text displayable name for this user.
396 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700397 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
398 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400399 },
400 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700401 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -0400402 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700403 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700404 "picture": { # The user's profile picture.
405 "url": "A String", # A URL that points to a profile picture of this user.
406 },
407 "kind": "drive#user", # This is always drive#user.
408 "displayName": "A String", # A plain text displayable name for this user.
409 "permissionId": "A String", # The user's ID as visible in the permissions collection.
410 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
411 "emailAddress": "A String", # The email address of the user.
412 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700413 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
414 "width": 42, # The width of the video in pixels.
415 "durationMillis": "A String", # The duration of the video in milliseconds.
416 "height": 42, # The height of the video in pixels.
417 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700418 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -0400419 "picture": { # The user's profile picture.
420 "url": "A String", # A URL that points to a profile picture of this user.
421 },
422 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400423 "displayName": "A String", # A plain text displayable name for this user.
424 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700425 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
426 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400427 },
428 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800429 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700430 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400431 "ownerNames": [ # Name(s) of the owner(s) of this file.
432 "A String",
433 ],
434 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
435 "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.
436 "etag": "A String", # ETag of the file.
437 "parents": [ # Collection of parent folders which contain this file.
438 # 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.
439 { # A reference to a file's parent.
440 "selfLink": "A String", # A link back to this reference.
441 "kind": "drive#parentReference", # This is always drive#parentReference.
442 "id": "A String", # The ID of the parent.
443 "isRoot": True or False, # Whether or not the parent is the root folder.
444 "parentLink": "A String", # A link to the parent.
445 },
446 ],
447 "exportLinks": { # Links for exporting Google Docs to specific formats.
448 "a_key": "A String", # A mapping from export format to URL
449 },
450 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700451 "permissions": [ # The list of permissions for users with access to this file.
452 { # A permission for a file.
453 "withLink": True or False, # Whether the link is required for this permission.
454 "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.
455 "name": "A String", # The name for this permission.
456 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700457 "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 unless the permission type anyone, in which case both id and value are ignored.
458 "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 unless the permission type anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -0700459 "authKey": "A String", # The authkey parameter required for this permission.
460 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800461 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700462 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -0700463 "role": "A String", # The primary role for this user. Allowed values are:
464 # - owner
465 # - reader
466 # - writer
467 "type": "A String", # The account type. Allowed values are:
468 # - user
469 # - group
470 # - domain
471 # - anyone
472 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
473 "A String",
474 ],
475 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700476 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700477 },
478 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700479 "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 -0400480 "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.
481 "a_key": "A String",
482 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700483 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
John Asmuth614db982014-04-24 15:46:26 -0400484 "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.
485 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
486 "exposureTime": 3.14, # The length of the exposure, in seconds.
487 "cameraMake": "A String", # The make of the camera used to create the photo.
488 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
489 "isoSpeed": 42, # The ISO speed used to create the photo.
490 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
491 "exposureMode": "A String", # The exposure mode used to create the photo.
492 "colorSpace": "A String", # The color space of the photo.
493 "location": { # Geographic location information stored in the image.
494 "latitude": 3.14, # The latitude stored in the image.
495 "altitude": 3.14, # The altitude stored in the image.
496 "longitude": 3.14, # The longitude stored in the image.
497 },
498 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
499 "height": 42, # The height of the image in pixels.
500 "lens": "A String", # The lens used to create the photo.
501 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
502 "width": 42, # The width of the image in pixels.
503 "meteringMode": "A String", # The metering mode used to create the photo.
504 "flashUsed": True or False, # Whether a flash was used to create the photo.
505 "aperture": 3.14, # The aperture used to create the photo (f-number).
506 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
507 "sensor": "A String", # The type of sensor used to create the photo.
508 "whiteBalance": "A String", # The white balance mode used to create the photo.
509 "cameraModel": "A String", # The model of the camera used to create the photo.
510 },
511 "description": "A String", # A short description of the file.
512 "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.
513 "editable": True or False, # Whether the file can be edited by the current user.
514 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700515 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -0400516 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700517 "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 -0700518 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400519 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000520 { # A key-value pair attached to a file that is either public or private to an application.
521 # The following limits apply to file properties:
522 # - Maximum of 100 properties total per file
523 # - Maximum of 30 private properties per app
524 # - Maximum of 30 public properties
525 # - 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 -0400526 "kind": "drive#property", # This is always drive#property.
527 "value": "A String", # The value of this property.
528 "etag": "A String", # ETag of the property.
529 "visibility": "A String", # The visibility of this property.
530 "key": "A String", # The key of this property.
531 "selfLink": "A String", # The link back to this property.
532 },
533 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700534 "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 -0400535 "iconLink": "A String", # A link to the file's icon.
536 "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.
537 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700538 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400539 "title": "A String", # The title of this file.
540 "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 -0700541 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
542 "mimeType": "A String", # The MIME type of the thumbnail.
543 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
544 },
545 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -0400546 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
547 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700548 "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 -0400549 "name": "A String", # The name for this permission.
550 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700551 "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 unless the permission type anyone, in which case both id and value are ignored.
552 "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 unless the permission type anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400553 "authKey": "A String", # The authkey parameter required for this permission.
554 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800555 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700556 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -0400557 "role": "A String", # The primary role for this user. Allowed values are:
558 # - owner
559 # - reader
560 # - writer
561 "type": "A String", # The account type. Allowed values are:
562 # - user
563 # - group
564 # - domain
565 # - anyone
566 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
567 "A String",
568 ],
569 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700570 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400571 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700572 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000573 "A String",
574 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700575 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700576 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
Takashi Matsuo06694102015-09-11 13:55:40 -0700577 "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.
578 "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 -0400579 "selfLink": "A String", # A link back to this file.
580 "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.
581 }</pre>
582</div>
583
584<div class="method">
585 <code class="details" id="delete">delete(fileId)</code>
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000586 <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 -0400587
588Args:
589 fileId: string, The ID of the file to delete. (required)
590</pre>
591</div>
592
593<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -0700594 <code class="details" id="emptyTrash">emptyTrash()</code>
595 <pre>Permanently deletes all of the user's trashed files.
596
597Args:
598</pre>
599</div>
600
601<div class="method">
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700602 <code class="details" id="export">export(fileId, mimeType)</code>
603 <pre>Exports a Google Doc to the requested MIME type and returns the exported content.
604
605Args:
606 fileId: string, The ID of the file. (required)
607 mimeType: string, The MIME type of the format requested for this export. (required)
608</pre>
609</div>
610
611<div class="method">
612 <code class="details" id="export_media">export_media(fileId, mimeType)</code>
613 <pre>Exports a Google Doc to the requested MIME type and returns the exported content.
614
615Args:
616 fileId: string, The ID of the file. (required)
617 mimeType: string, The MIME type of the format requested for this export. (required)
618</pre>
619</div>
620
621<div class="method">
Takashi Matsuo06694102015-09-11 13:55:40 -0700622 <code class="details" id="generateIds">generateIds(space=None, maxResults=None)</code>
623 <pre>Generates a set of file IDs which can be provided in insert requests.
624
625Args:
626 space: string, The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.
627 maxResults: integer, Maximum number of IDs to return.
628
629Returns:
630 An object of the form:
631
632 { # A list of generated IDs which can be provided in insert requests
633 "kind": "drive#generatedIds", # This is always drive#generatedIds
634 "ids": [ # The IDs generated for the requesting user in the specified space.
635 "A String",
636 ],
637 "space": "A String", # The type of file that can be created with these IDs.
638 }</pre>
639</div>
640
641<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000642 <code class="details" id="get">get(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400643 <pre>Gets a file's metadata by ID.
644
645Args:
646 fileId: string, The ID for the file in question. (required)
647 projection: string, This parameter is deprecated and has no function.
648 Allowed values
649 BASIC - Deprecated
650 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000651 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -0800652 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700653 updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.
John Asmuth614db982014-04-24 15:46:26 -0400654
655Returns:
656 An object of the form:
657
658 { # The metadata for a file.
659 "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.
660 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700661 "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.
662 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000663 "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 -0400664 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700665 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -0400666 "hidden": True or False, # Deprecated.
667 "viewed": True or False, # Whether this file has been viewed by this user.
668 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000669 "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 -0400670 },
671 "indexableText": { # Indexable text attributes for the file (can only be written)
672 "text": "A String", # The text to be indexed for this file.
673 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700674 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700675 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -0400676 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
677 "writersCanShare": True or False, # Whether writers can share the document with other users.
678 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700679 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -0400680 "picture": { # The user's profile picture.
681 "url": "A String", # A URL that points to a profile picture of this user.
682 },
683 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400684 "displayName": "A String", # A plain text displayable name for this user.
685 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700686 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
687 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400688 },
689 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700690 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -0400691 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700692 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700693 "picture": { # The user's profile picture.
694 "url": "A String", # A URL that points to a profile picture of this user.
695 },
696 "kind": "drive#user", # This is always drive#user.
697 "displayName": "A String", # A plain text displayable name for this user.
698 "permissionId": "A String", # The user's ID as visible in the permissions collection.
699 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
700 "emailAddress": "A String", # The email address of the user.
701 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700702 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
703 "width": 42, # The width of the video in pixels.
704 "durationMillis": "A String", # The duration of the video in milliseconds.
705 "height": 42, # The height of the video in pixels.
706 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700707 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -0400708 "picture": { # The user's profile picture.
709 "url": "A String", # A URL that points to a profile picture of this user.
710 },
711 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400712 "displayName": "A String", # A plain text displayable name for this user.
713 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700714 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
715 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400716 },
717 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800718 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700719 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400720 "ownerNames": [ # Name(s) of the owner(s) of this file.
721 "A String",
722 ],
723 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
724 "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.
725 "etag": "A String", # ETag of the file.
726 "parents": [ # Collection of parent folders which contain this file.
727 # 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.
728 { # A reference to a file's parent.
729 "selfLink": "A String", # A link back to this reference.
730 "kind": "drive#parentReference", # This is always drive#parentReference.
731 "id": "A String", # The ID of the parent.
732 "isRoot": True or False, # Whether or not the parent is the root folder.
733 "parentLink": "A String", # A link to the parent.
734 },
735 ],
736 "exportLinks": { # Links for exporting Google Docs to specific formats.
737 "a_key": "A String", # A mapping from export format to URL
738 },
739 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700740 "permissions": [ # The list of permissions for users with access to this file.
741 { # A permission for a file.
742 "withLink": True or False, # Whether the link is required for this permission.
743 "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.
744 "name": "A String", # The name for this permission.
745 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700746 "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 unless the permission type anyone, in which case both id and value are ignored.
747 "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 unless the permission type anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -0700748 "authKey": "A String", # The authkey parameter required for this permission.
749 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800750 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700751 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -0700752 "role": "A String", # The primary role for this user. Allowed values are:
753 # - owner
754 # - reader
755 # - writer
756 "type": "A String", # The account type. Allowed values are:
757 # - user
758 # - group
759 # - domain
760 # - anyone
761 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
762 "A String",
763 ],
764 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700765 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700766 },
767 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700768 "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 -0400769 "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.
770 "a_key": "A String",
771 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700772 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
John Asmuth614db982014-04-24 15:46:26 -0400773 "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.
774 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
775 "exposureTime": 3.14, # The length of the exposure, in seconds.
776 "cameraMake": "A String", # The make of the camera used to create the photo.
777 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
778 "isoSpeed": 42, # The ISO speed used to create the photo.
779 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
780 "exposureMode": "A String", # The exposure mode used to create the photo.
781 "colorSpace": "A String", # The color space of the photo.
782 "location": { # Geographic location information stored in the image.
783 "latitude": 3.14, # The latitude stored in the image.
784 "altitude": 3.14, # The altitude stored in the image.
785 "longitude": 3.14, # The longitude stored in the image.
786 },
787 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
788 "height": 42, # The height of the image in pixels.
789 "lens": "A String", # The lens used to create the photo.
790 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
791 "width": 42, # The width of the image in pixels.
792 "meteringMode": "A String", # The metering mode used to create the photo.
793 "flashUsed": True or False, # Whether a flash was used to create the photo.
794 "aperture": 3.14, # The aperture used to create the photo (f-number).
795 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
796 "sensor": "A String", # The type of sensor used to create the photo.
797 "whiteBalance": "A String", # The white balance mode used to create the photo.
798 "cameraModel": "A String", # The model of the camera used to create the photo.
799 },
800 "description": "A String", # A short description of the file.
801 "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.
802 "editable": True or False, # Whether the file can be edited by the current user.
803 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700804 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -0400805 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700806 "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 -0700807 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400808 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000809 { # A key-value pair attached to a file that is either public or private to an application.
810 # The following limits apply to file properties:
811 # - Maximum of 100 properties total per file
812 # - Maximum of 30 private properties per app
813 # - Maximum of 30 public properties
814 # - 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 -0400815 "kind": "drive#property", # This is always drive#property.
816 "value": "A String", # The value of this property.
817 "etag": "A String", # ETag of the property.
818 "visibility": "A String", # The visibility of this property.
819 "key": "A String", # The key of this property.
820 "selfLink": "A String", # The link back to this property.
821 },
822 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700823 "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 -0400824 "iconLink": "A String", # A link to the file's icon.
825 "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.
826 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700827 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400828 "title": "A String", # The title of this file.
829 "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 -0700830 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
831 "mimeType": "A String", # The MIME type of the thumbnail.
832 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
833 },
834 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -0400835 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
836 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700837 "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 -0400838 "name": "A String", # The name for this permission.
839 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700840 "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 unless the permission type anyone, in which case both id and value are ignored.
841 "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 unless the permission type anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400842 "authKey": "A String", # The authkey parameter required for this permission.
843 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800844 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700845 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -0400846 "role": "A String", # The primary role for this user. Allowed values are:
847 # - owner
848 # - reader
849 # - writer
850 "type": "A String", # The account type. Allowed values are:
851 # - user
852 # - group
853 # - domain
854 # - anyone
855 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
856 "A String",
857 ],
858 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700859 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400860 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700861 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000862 "A String",
863 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700864 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700865 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
Takashi Matsuo06694102015-09-11 13:55:40 -0700866 "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.
867 "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 -0400868 "selfLink": "A String", # A link back to this file.
869 "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.
870 }</pre>
871</div>
872
873<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000874 <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 -0800875 <pre>Gets a file's metadata by ID.
876
877Args:
878 fileId: string, The ID for the file in question. (required)
879 projection: string, This parameter is deprecated and has no function.
880 Allowed values
881 BASIC - Deprecated
882 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000883 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -0800884 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700885 updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.
Craig Citroe633be12015-03-02 13:40:36 -0800886
887Returns:
888 The media object as a string.
889
890 </pre>
891</div>
892
893<div class="method">
John Asmuth614db982014-04-24 15:46:26 -0400894 <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>
895 <pre>Insert a new file.
896
897Args:
898 body: object, The request body.
899 The object takes the form of:
900
901{ # The metadata for a file.
902 "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.
903 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700904 "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.
905 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000906 "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 -0400907 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700908 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -0400909 "hidden": True or False, # Deprecated.
910 "viewed": True or False, # Whether this file has been viewed by this user.
911 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000912 "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 -0400913 },
914 "indexableText": { # Indexable text attributes for the file (can only be written)
915 "text": "A String", # The text to be indexed for this file.
916 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700917 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700918 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -0400919 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
920 "writersCanShare": True or False, # Whether writers can share the document with other users.
921 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700922 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -0400923 "picture": { # The user's profile picture.
924 "url": "A String", # A URL that points to a profile picture of this user.
925 },
926 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400927 "displayName": "A String", # A plain text displayable name for this user.
928 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700929 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
930 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400931 },
932 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700933 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -0400934 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700935 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700936 "picture": { # The user's profile picture.
937 "url": "A String", # A URL that points to a profile picture of this user.
938 },
939 "kind": "drive#user", # This is always drive#user.
940 "displayName": "A String", # A plain text displayable name for this user.
941 "permissionId": "A String", # The user's ID as visible in the permissions collection.
942 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
943 "emailAddress": "A String", # The email address of the user.
944 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700945 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
946 "width": 42, # The width of the video in pixels.
947 "durationMillis": "A String", # The duration of the video in milliseconds.
948 "height": 42, # The height of the video in pixels.
949 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700950 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -0400951 "picture": { # The user's profile picture.
952 "url": "A String", # A URL that points to a profile picture of this user.
953 },
954 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400955 "displayName": "A String", # A plain text displayable name for this user.
956 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700957 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
958 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400959 },
960 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800961 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700962 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400963 "ownerNames": [ # Name(s) of the owner(s) of this file.
964 "A String",
965 ],
966 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
967 "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.
968 "etag": "A String", # ETag of the file.
969 "parents": [ # Collection of parent folders which contain this file.
970 # 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.
971 { # A reference to a file's parent.
972 "selfLink": "A String", # A link back to this reference.
973 "kind": "drive#parentReference", # This is always drive#parentReference.
974 "id": "A String", # The ID of the parent.
975 "isRoot": True or False, # Whether or not the parent is the root folder.
976 "parentLink": "A String", # A link to the parent.
977 },
978 ],
979 "exportLinks": { # Links for exporting Google Docs to specific formats.
980 "a_key": "A String", # A mapping from export format to URL
981 },
982 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700983 "permissions": [ # The list of permissions for users with access to this file.
984 { # A permission for a file.
985 "withLink": True or False, # Whether the link is required for this permission.
986 "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.
987 "name": "A String", # The name for this permission.
988 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700989 "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 unless the permission type anyone, in which case both id and value are ignored.
990 "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 unless the permission type anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -0700991 "authKey": "A String", # The authkey parameter required for this permission.
992 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800993 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700994 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -0700995 "role": "A String", # The primary role for this user. Allowed values are:
996 # - owner
997 # - reader
998 # - writer
999 "type": "A String", # The account type. Allowed values are:
1000 # - user
1001 # - group
1002 # - domain
1003 # - anyone
1004 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1005 "A String",
1006 ],
1007 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001008 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001009 },
1010 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001011 "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 -04001012 "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.
1013 "a_key": "A String",
1014 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001015 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
John Asmuth614db982014-04-24 15:46:26 -04001016 "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.
1017 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1018 "exposureTime": 3.14, # The length of the exposure, in seconds.
1019 "cameraMake": "A String", # The make of the camera used to create the photo.
1020 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1021 "isoSpeed": 42, # The ISO speed used to create the photo.
1022 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1023 "exposureMode": "A String", # The exposure mode used to create the photo.
1024 "colorSpace": "A String", # The color space of the photo.
1025 "location": { # Geographic location information stored in the image.
1026 "latitude": 3.14, # The latitude stored in the image.
1027 "altitude": 3.14, # The altitude stored in the image.
1028 "longitude": 3.14, # The longitude stored in the image.
1029 },
1030 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1031 "height": 42, # The height of the image in pixels.
1032 "lens": "A String", # The lens used to create the photo.
1033 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1034 "width": 42, # The width of the image in pixels.
1035 "meteringMode": "A String", # The metering mode used to create the photo.
1036 "flashUsed": True or False, # Whether a flash was used to create the photo.
1037 "aperture": 3.14, # The aperture used to create the photo (f-number).
1038 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1039 "sensor": "A String", # The type of sensor used to create the photo.
1040 "whiteBalance": "A String", # The white balance mode used to create the photo.
1041 "cameraModel": "A String", # The model of the camera used to create the photo.
1042 },
1043 "description": "A String", # A short description of the file.
1044 "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.
1045 "editable": True or False, # Whether the file can be edited by the current user.
1046 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001047 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04001048 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001049 "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 -07001050 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001051 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001052 { # A key-value pair attached to a file that is either public or private to an application.
1053 # The following limits apply to file properties:
1054 # - Maximum of 100 properties total per file
1055 # - Maximum of 30 private properties per app
1056 # - Maximum of 30 public properties
1057 # - 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 -04001058 "kind": "drive#property", # This is always drive#property.
1059 "value": "A String", # The value of this property.
1060 "etag": "A String", # ETag of the property.
1061 "visibility": "A String", # The visibility of this property.
1062 "key": "A String", # The key of this property.
1063 "selfLink": "A String", # The link back to this property.
1064 },
1065 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001066 "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 -04001067 "iconLink": "A String", # A link to the file's icon.
1068 "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.
1069 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001070 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001071 "title": "A String", # The title of this file.
1072 "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 -07001073 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1074 "mimeType": "A String", # The MIME type of the thumbnail.
1075 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
1076 },
1077 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04001078 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1079 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001080 "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 -04001081 "name": "A String", # The name for this permission.
1082 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001083 "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 unless the permission type anyone, in which case both id and value are ignored.
1084 "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 unless the permission type anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04001085 "authKey": "A String", # The authkey parameter required for this permission.
1086 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001087 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001088 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04001089 "role": "A String", # The primary role for this user. Allowed values are:
1090 # - owner
1091 # - reader
1092 # - writer
1093 "type": "A String", # The account type. Allowed values are:
1094 # - user
1095 # - group
1096 # - domain
1097 # - anyone
1098 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1099 "A String",
1100 ],
1101 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001102 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04001103 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001104 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001105 "A String",
1106 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001107 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001108 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
Takashi Matsuo06694102015-09-11 13:55:40 -07001109 "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.
1110 "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 -04001111 "selfLink": "A String", # A link back to this file.
1112 "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.
1113}
1114
1115 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
1116 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
1117 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
1118 visibility: string, The visibility of the new file. This parameter is only relevant when convert=false.
1119 Allowed values
1120 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
1121 PRIVATE - The new file will be visible to only the owner.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001122 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 -04001123 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
1124 timedTextLanguage: string, The language of the timed text.
1125 timedTextTrackName: string, The timed text track name.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001126 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 -04001127
1128Returns:
1129 An object of the form:
1130
1131 { # The metadata for a file.
1132 "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.
1133 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001134 "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.
1135 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001136 "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 -04001137 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001138 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04001139 "hidden": True or False, # Deprecated.
1140 "viewed": True or False, # Whether this file has been viewed by this user.
1141 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001142 "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 -04001143 },
1144 "indexableText": { # Indexable text attributes for the file (can only be written)
1145 "text": "A String", # The text to be indexed for this file.
1146 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001147 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001148 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04001149 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1150 "writersCanShare": True or False, # Whether writers can share the document with other users.
1151 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001152 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04001153 "picture": { # The user's profile picture.
1154 "url": "A String", # A URL that points to a profile picture of this user.
1155 },
1156 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001157 "displayName": "A String", # A plain text displayable name for this user.
1158 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001159 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1160 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001161 },
1162 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001163 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04001164 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001165 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001166 "picture": { # The user's profile picture.
1167 "url": "A String", # A URL that points to a profile picture of this user.
1168 },
1169 "kind": "drive#user", # This is always drive#user.
1170 "displayName": "A String", # A plain text displayable name for this user.
1171 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1172 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1173 "emailAddress": "A String", # The email address of the user.
1174 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001175 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1176 "width": 42, # The width of the video in pixels.
1177 "durationMillis": "A String", # The duration of the video in milliseconds.
1178 "height": 42, # The height of the video in pixels.
1179 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001180 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04001181 "picture": { # The user's profile picture.
1182 "url": "A String", # A URL that points to a profile picture of this user.
1183 },
1184 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001185 "displayName": "A String", # A plain text displayable name for this user.
1186 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001187 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1188 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001189 },
1190 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001191 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001192 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04001193 "ownerNames": [ # Name(s) of the owner(s) of this file.
1194 "A String",
1195 ],
1196 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1197 "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.
1198 "etag": "A String", # ETag of the file.
1199 "parents": [ # Collection of parent folders which contain this file.
1200 # 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.
1201 { # A reference to a file's parent.
1202 "selfLink": "A String", # A link back to this reference.
1203 "kind": "drive#parentReference", # This is always drive#parentReference.
1204 "id": "A String", # The ID of the parent.
1205 "isRoot": True or False, # Whether or not the parent is the root folder.
1206 "parentLink": "A String", # A link to the parent.
1207 },
1208 ],
1209 "exportLinks": { # Links for exporting Google Docs to specific formats.
1210 "a_key": "A String", # A mapping from export format to URL
1211 },
1212 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001213 "permissions": [ # The list of permissions for users with access to this file.
1214 { # A permission for a file.
1215 "withLink": True or False, # Whether the link is required for this permission.
1216 "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.
1217 "name": "A String", # The name for this permission.
1218 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001219 "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 unless the permission type anyone, in which case both id and value are ignored.
1220 "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 unless the permission type anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07001221 "authKey": "A String", # The authkey parameter required for this permission.
1222 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001223 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001224 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07001225 "role": "A String", # The primary role for this user. Allowed values are:
1226 # - owner
1227 # - reader
1228 # - writer
1229 "type": "A String", # The account type. Allowed values are:
1230 # - user
1231 # - group
1232 # - domain
1233 # - anyone
1234 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1235 "A String",
1236 ],
1237 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001238 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001239 },
1240 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001241 "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 -04001242 "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.
1243 "a_key": "A String",
1244 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001245 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
John Asmuth614db982014-04-24 15:46:26 -04001246 "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.
1247 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1248 "exposureTime": 3.14, # The length of the exposure, in seconds.
1249 "cameraMake": "A String", # The make of the camera used to create the photo.
1250 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1251 "isoSpeed": 42, # The ISO speed used to create the photo.
1252 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1253 "exposureMode": "A String", # The exposure mode used to create the photo.
1254 "colorSpace": "A String", # The color space of the photo.
1255 "location": { # Geographic location information stored in the image.
1256 "latitude": 3.14, # The latitude stored in the image.
1257 "altitude": 3.14, # The altitude stored in the image.
1258 "longitude": 3.14, # The longitude stored in the image.
1259 },
1260 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1261 "height": 42, # The height of the image in pixels.
1262 "lens": "A String", # The lens used to create the photo.
1263 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1264 "width": 42, # The width of the image in pixels.
1265 "meteringMode": "A String", # The metering mode used to create the photo.
1266 "flashUsed": True or False, # Whether a flash was used to create the photo.
1267 "aperture": 3.14, # The aperture used to create the photo (f-number).
1268 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1269 "sensor": "A String", # The type of sensor used to create the photo.
1270 "whiteBalance": "A String", # The white balance mode used to create the photo.
1271 "cameraModel": "A String", # The model of the camera used to create the photo.
1272 },
1273 "description": "A String", # A short description of the file.
1274 "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.
1275 "editable": True or False, # Whether the file can be edited by the current user.
1276 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001277 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04001278 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001279 "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 -07001280 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001281 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001282 { # A key-value pair attached to a file that is either public or private to an application.
1283 # The following limits apply to file properties:
1284 # - Maximum of 100 properties total per file
1285 # - Maximum of 30 private properties per app
1286 # - Maximum of 30 public properties
1287 # - 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 -04001288 "kind": "drive#property", # This is always drive#property.
1289 "value": "A String", # The value of this property.
1290 "etag": "A String", # ETag of the property.
1291 "visibility": "A String", # The visibility of this property.
1292 "key": "A String", # The key of this property.
1293 "selfLink": "A String", # The link back to this property.
1294 },
1295 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001296 "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 -04001297 "iconLink": "A String", # A link to the file's icon.
1298 "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.
1299 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001300 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001301 "title": "A String", # The title of this file.
1302 "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 -07001303 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1304 "mimeType": "A String", # The MIME type of the thumbnail.
1305 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
1306 },
1307 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04001308 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1309 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001310 "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 -04001311 "name": "A String", # The name for this permission.
1312 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001313 "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 unless the permission type anyone, in which case both id and value are ignored.
1314 "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 unless the permission type anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04001315 "authKey": "A String", # The authkey parameter required for this permission.
1316 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001317 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001318 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04001319 "role": "A String", # The primary role for this user. Allowed values are:
1320 # - owner
1321 # - reader
1322 # - writer
1323 "type": "A String", # The account type. Allowed values are:
1324 # - user
1325 # - group
1326 # - domain
1327 # - anyone
1328 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1329 "A String",
1330 ],
1331 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001332 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04001333 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001334 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001335 "A String",
1336 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001337 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001338 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
Takashi Matsuo06694102015-09-11 13:55:40 -07001339 "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.
1340 "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 -04001341 "selfLink": "A String", # A link back to this file.
1342 "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.
1343 }</pre>
1344</div>
1345
1346<div class="method">
Takashi Matsuo06694102015-09-11 13:55:40 -07001347 <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 -04001348 <pre>Lists the user's files.
1349
1350Args:
Takashi Matsuo06694102015-09-11 13:55:40 -07001351 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 -04001352 q: string, Query string for searching files.
1353 projection: string, This parameter is deprecated and has no function.
1354 Allowed values
1355 BASIC - Deprecated
1356 FULL - Deprecated
1357 pageToken: string, Page token for files.
1358 maxResults: integer, Maximum number of files to return.
Takashi Matsuo06694102015-09-11 13:55:40 -07001359 spaces: string, A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.
Craig Citro065b5302014-08-14 00:47:23 -07001360 corpus: string, The body of items (files/documents) to which the query applies.
1361 Allowed values
1362 DEFAULT - The items that the user has accessed.
1363 DOMAIN - Items shared to the user's domain.
John Asmuth614db982014-04-24 15:46:26 -04001364
1365Returns:
1366 An object of the form:
1367
1368 { # A list of files.
1369 "nextPageToken": "A String", # The page token for the next page of files.
1370 "kind": "drive#fileList", # This is always drive#fileList.
1371 "items": [ # The actual list of files.
1372 { # The metadata for a file.
1373 "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.
1374 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001375 "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.
1376 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001377 "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 -04001378 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001379 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04001380 "hidden": True or False, # Deprecated.
1381 "viewed": True or False, # Whether this file has been viewed by this user.
1382 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001383 "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 -04001384 },
1385 "indexableText": { # Indexable text attributes for the file (can only be written)
1386 "text": "A String", # The text to be indexed for this file.
1387 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001388 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001389 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04001390 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1391 "writersCanShare": True or False, # Whether writers can share the document with other users.
1392 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001393 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04001394 "picture": { # The user's profile picture.
1395 "url": "A String", # A URL that points to a profile picture of this user.
1396 },
1397 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001398 "displayName": "A String", # A plain text displayable name for this user.
1399 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001400 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1401 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001402 },
1403 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001404 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04001405 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001406 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001407 "picture": { # The user's profile picture.
1408 "url": "A String", # A URL that points to a profile picture of this user.
1409 },
1410 "kind": "drive#user", # This is always drive#user.
1411 "displayName": "A String", # A plain text displayable name for this user.
1412 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1413 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1414 "emailAddress": "A String", # The email address of the user.
1415 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001416 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1417 "width": 42, # The width of the video in pixels.
1418 "durationMillis": "A String", # The duration of the video in milliseconds.
1419 "height": 42, # The height of the video in pixels.
1420 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001421 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04001422 "picture": { # The user's profile picture.
1423 "url": "A String", # A URL that points to a profile picture of this user.
1424 },
1425 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001426 "displayName": "A String", # A plain text displayable name for this user.
1427 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001428 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1429 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001430 },
1431 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001432 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001433 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04001434 "ownerNames": [ # Name(s) of the owner(s) of this file.
1435 "A String",
1436 ],
1437 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1438 "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.
1439 "etag": "A String", # ETag of the file.
1440 "parents": [ # Collection of parent folders which contain this file.
1441 # 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.
1442 { # A reference to a file's parent.
1443 "selfLink": "A String", # A link back to this reference.
1444 "kind": "drive#parentReference", # This is always drive#parentReference.
1445 "id": "A String", # The ID of the parent.
1446 "isRoot": True or False, # Whether or not the parent is the root folder.
1447 "parentLink": "A String", # A link to the parent.
1448 },
1449 ],
1450 "exportLinks": { # Links for exporting Google Docs to specific formats.
1451 "a_key": "A String", # A mapping from export format to URL
1452 },
1453 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001454 "permissions": [ # The list of permissions for users with access to this file.
1455 { # A permission for a file.
1456 "withLink": True or False, # Whether the link is required for this permission.
1457 "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.
1458 "name": "A String", # The name for this permission.
1459 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001460 "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 unless the permission type anyone, in which case both id and value are ignored.
1461 "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 unless the permission type anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07001462 "authKey": "A String", # The authkey parameter required for this permission.
1463 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001464 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001465 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07001466 "role": "A String", # The primary role for this user. Allowed values are:
1467 # - owner
1468 # - reader
1469 # - writer
1470 "type": "A String", # The account type. Allowed values are:
1471 # - user
1472 # - group
1473 # - domain
1474 # - anyone
1475 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1476 "A String",
1477 ],
1478 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001479 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001480 },
1481 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001482 "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 -04001483 "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.
1484 "a_key": "A String",
1485 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001486 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
John Asmuth614db982014-04-24 15:46:26 -04001487 "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.
1488 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1489 "exposureTime": 3.14, # The length of the exposure, in seconds.
1490 "cameraMake": "A String", # The make of the camera used to create the photo.
1491 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1492 "isoSpeed": 42, # The ISO speed used to create the photo.
1493 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1494 "exposureMode": "A String", # The exposure mode used to create the photo.
1495 "colorSpace": "A String", # The color space of the photo.
1496 "location": { # Geographic location information stored in the image.
1497 "latitude": 3.14, # The latitude stored in the image.
1498 "altitude": 3.14, # The altitude stored in the image.
1499 "longitude": 3.14, # The longitude stored in the image.
1500 },
1501 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1502 "height": 42, # The height of the image in pixels.
1503 "lens": "A String", # The lens used to create the photo.
1504 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1505 "width": 42, # The width of the image in pixels.
1506 "meteringMode": "A String", # The metering mode used to create the photo.
1507 "flashUsed": True or False, # Whether a flash was used to create the photo.
1508 "aperture": 3.14, # The aperture used to create the photo (f-number).
1509 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1510 "sensor": "A String", # The type of sensor used to create the photo.
1511 "whiteBalance": "A String", # The white balance mode used to create the photo.
1512 "cameraModel": "A String", # The model of the camera used to create the photo.
1513 },
1514 "description": "A String", # A short description of the file.
1515 "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.
1516 "editable": True or False, # Whether the file can be edited by the current user.
1517 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001518 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04001519 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001520 "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 -07001521 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001522 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001523 { # A key-value pair attached to a file that is either public or private to an application.
1524 # The following limits apply to file properties:
1525 # - Maximum of 100 properties total per file
1526 # - Maximum of 30 private properties per app
1527 # - Maximum of 30 public properties
1528 # - 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 -04001529 "kind": "drive#property", # This is always drive#property.
1530 "value": "A String", # The value of this property.
1531 "etag": "A String", # ETag of the property.
1532 "visibility": "A String", # The visibility of this property.
1533 "key": "A String", # The key of this property.
1534 "selfLink": "A String", # The link back to this property.
1535 },
1536 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001537 "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 -04001538 "iconLink": "A String", # A link to the file's icon.
1539 "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.
1540 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001541 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001542 "title": "A String", # The title of this file.
1543 "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 -07001544 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1545 "mimeType": "A String", # The MIME type of the thumbnail.
1546 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
1547 },
1548 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04001549 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1550 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001551 "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 -04001552 "name": "A String", # The name for this permission.
1553 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001554 "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 unless the permission type anyone, in which case both id and value are ignored.
1555 "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 unless the permission type anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04001556 "authKey": "A String", # The authkey parameter required for this permission.
1557 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001558 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001559 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04001560 "role": "A String", # The primary role for this user. Allowed values are:
1561 # - owner
1562 # - reader
1563 # - writer
1564 "type": "A String", # The account type. Allowed values are:
1565 # - user
1566 # - group
1567 # - domain
1568 # - anyone
1569 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1570 "A String",
1571 ],
1572 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001573 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04001574 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001575 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001576 "A String",
1577 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001578 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001579 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
Takashi Matsuo06694102015-09-11 13:55:40 -07001580 "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.
1581 "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 -04001582 "selfLink": "A String", # A link back to this file.
1583 "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.
1584 },
1585 ],
1586 "nextLink": "A String", # A link to the next page of files.
1587 "etag": "A String", # The ETag of the list.
1588 "selfLink": "A String", # A link back to this list.
1589 }</pre>
1590</div>
1591
1592<div class="method">
1593 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1594 <pre>Retrieves the next page of results.
1595
1596Args:
1597 previous_request: The request for the previous page. (required)
1598 previous_response: The response from the request for the previous page. (required)
1599
1600Returns:
1601 A request object that you can call 'execute()' on to request the next
1602 page. Returns None if there are no more items in the collection.
1603 </pre>
1604</div>
1605
1606<div class="method">
Takashi Matsuo06694102015-09-11 13:55:40 -07001607 <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 -04001608 <pre>Updates file metadata and/or content. This method supports patch semantics.
1609
1610Args:
1611 fileId: string, The ID of the file to update. (required)
1612 body: object, The request body. (required)
1613 The object takes the form of:
1614
1615{ # The metadata for a file.
1616 "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.
1617 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001618 "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.
1619 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001620 "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 -04001621 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001622 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04001623 "hidden": True or False, # Deprecated.
1624 "viewed": True or False, # Whether this file has been viewed by this user.
1625 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001626 "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 -04001627 },
1628 "indexableText": { # Indexable text attributes for the file (can only be written)
1629 "text": "A String", # The text to be indexed for this file.
1630 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001631 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001632 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04001633 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1634 "writersCanShare": True or False, # Whether writers can share the document with other users.
1635 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001636 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04001637 "picture": { # The user's profile picture.
1638 "url": "A String", # A URL that points to a profile picture of this user.
1639 },
1640 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001641 "displayName": "A String", # A plain text displayable name for this user.
1642 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001643 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1644 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001645 },
1646 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001647 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04001648 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001649 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001650 "picture": { # The user's profile picture.
1651 "url": "A String", # A URL that points to a profile picture of this user.
1652 },
1653 "kind": "drive#user", # This is always drive#user.
1654 "displayName": "A String", # A plain text displayable name for this user.
1655 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1656 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1657 "emailAddress": "A String", # The email address of the user.
1658 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001659 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1660 "width": 42, # The width of the video in pixels.
1661 "durationMillis": "A String", # The duration of the video in milliseconds.
1662 "height": 42, # The height of the video in pixels.
1663 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001664 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04001665 "picture": { # The user's profile picture.
1666 "url": "A String", # A URL that points to a profile picture of this user.
1667 },
1668 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001669 "displayName": "A String", # A plain text displayable name for this user.
1670 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001671 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1672 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001673 },
1674 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001675 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001676 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04001677 "ownerNames": [ # Name(s) of the owner(s) of this file.
1678 "A String",
1679 ],
1680 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1681 "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.
1682 "etag": "A String", # ETag of the file.
1683 "parents": [ # Collection of parent folders which contain this file.
1684 # 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.
1685 { # A reference to a file's parent.
1686 "selfLink": "A String", # A link back to this reference.
1687 "kind": "drive#parentReference", # This is always drive#parentReference.
1688 "id": "A String", # The ID of the parent.
1689 "isRoot": True or False, # Whether or not the parent is the root folder.
1690 "parentLink": "A String", # A link to the parent.
1691 },
1692 ],
1693 "exportLinks": { # Links for exporting Google Docs to specific formats.
1694 "a_key": "A String", # A mapping from export format to URL
1695 },
1696 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001697 "permissions": [ # The list of permissions for users with access to this file.
1698 { # A permission for a file.
1699 "withLink": True or False, # Whether the link is required for this permission.
1700 "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.
1701 "name": "A String", # The name for this permission.
1702 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001703 "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 unless the permission type anyone, in which case both id and value are ignored.
1704 "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 unless the permission type anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07001705 "authKey": "A String", # The authkey parameter required for this permission.
1706 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001707 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001708 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07001709 "role": "A String", # The primary role for this user. Allowed values are:
1710 # - owner
1711 # - reader
1712 # - writer
1713 "type": "A String", # The account type. Allowed values are:
1714 # - user
1715 # - group
1716 # - domain
1717 # - anyone
1718 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1719 "A String",
1720 ],
1721 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001722 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001723 },
1724 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001725 "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 -04001726 "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.
1727 "a_key": "A String",
1728 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001729 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
John Asmuth614db982014-04-24 15:46:26 -04001730 "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.
1731 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1732 "exposureTime": 3.14, # The length of the exposure, in seconds.
1733 "cameraMake": "A String", # The make of the camera used to create the photo.
1734 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1735 "isoSpeed": 42, # The ISO speed used to create the photo.
1736 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1737 "exposureMode": "A String", # The exposure mode used to create the photo.
1738 "colorSpace": "A String", # The color space of the photo.
1739 "location": { # Geographic location information stored in the image.
1740 "latitude": 3.14, # The latitude stored in the image.
1741 "altitude": 3.14, # The altitude stored in the image.
1742 "longitude": 3.14, # The longitude stored in the image.
1743 },
1744 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1745 "height": 42, # The height of the image in pixels.
1746 "lens": "A String", # The lens used to create the photo.
1747 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1748 "width": 42, # The width of the image in pixels.
1749 "meteringMode": "A String", # The metering mode used to create the photo.
1750 "flashUsed": True or False, # Whether a flash was used to create the photo.
1751 "aperture": 3.14, # The aperture used to create the photo (f-number).
1752 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1753 "sensor": "A String", # The type of sensor used to create the photo.
1754 "whiteBalance": "A String", # The white balance mode used to create the photo.
1755 "cameraModel": "A String", # The model of the camera used to create the photo.
1756 },
1757 "description": "A String", # A short description of the file.
1758 "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.
1759 "editable": True or False, # Whether the file can be edited by the current user.
1760 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001761 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04001762 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001763 "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 -07001764 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001765 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001766 { # A key-value pair attached to a file that is either public or private to an application.
1767 # The following limits apply to file properties:
1768 # - Maximum of 100 properties total per file
1769 # - Maximum of 30 private properties per app
1770 # - Maximum of 30 public properties
1771 # - 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 -04001772 "kind": "drive#property", # This is always drive#property.
1773 "value": "A String", # The value of this property.
1774 "etag": "A String", # ETag of the property.
1775 "visibility": "A String", # The visibility of this property.
1776 "key": "A String", # The key of this property.
1777 "selfLink": "A String", # The link back to this property.
1778 },
1779 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001780 "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 -04001781 "iconLink": "A String", # A link to the file's icon.
1782 "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.
1783 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001784 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001785 "title": "A String", # The title of this file.
1786 "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 -07001787 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
1788 "mimeType": "A String", # The MIME type of the thumbnail.
1789 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
1790 },
1791 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04001792 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1793 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001794 "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 -04001795 "name": "A String", # The name for this permission.
1796 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001797 "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 unless the permission type anyone, in which case both id and value are ignored.
1798 "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 unless the permission type anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04001799 "authKey": "A String", # The authkey parameter required for this permission.
1800 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001801 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001802 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04001803 "role": "A String", # The primary role for this user. Allowed values are:
1804 # - owner
1805 # - reader
1806 # - writer
1807 "type": "A String", # The account type. Allowed values are:
1808 # - user
1809 # - group
1810 # - domain
1811 # - anyone
1812 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1813 "A String",
1814 ],
1815 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001816 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04001817 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001818 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001819 "A String",
1820 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001821 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001822 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
Takashi Matsuo06694102015-09-11 13:55:40 -07001823 "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.
1824 "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 -04001825 "selfLink": "A String", # A link back to this file.
1826 "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.
1827}
1828
Takashi Matsuo06694102015-09-11 13:55:40 -07001829 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.
1830 modifiedDateBehavior: string, Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.
1831 Allowed values
1832 fromBody - Set modifiedDate to the value provided in the body of the request. No change if no value was provided.
1833 fromBodyIfNeeded - Set modifiedDate to the value provided in the body of the request depending on other contents of the update.
1834 fromBodyOrNow - Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.
1835 noChange - Maintain the previous value of modifiedDate.
1836 now - Set modifiedDate to the current time.
1837 nowIfNeeded - Set modifiedDate to the current time depending on contents of the update.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001838 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 +00001839 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 -04001840 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Craig Citro065b5302014-08-14 00:47:23 -07001841 addParents: string, Comma-separated list of parent IDs to add.
1842 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04001843 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
1844 timedTextTrackName: string, The timed text track name.
Takashi Matsuo06694102015-09-11 13:55:40 -07001845 convert: boolean, This parameter is deprecated and has no function.
John Asmuth614db982014-04-24 15:46:26 -04001846 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
1847 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
1848 timedTextLanguage: string, The language of the timed text.
1849
1850Returns:
1851 An object of the form:
1852
1853 { # The metadata for a file.
1854 "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.
1855 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001856 "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.
1857 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001858 "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 -04001859 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001860 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04001861 "hidden": True or False, # Deprecated.
1862 "viewed": True or False, # Whether this file has been viewed by this user.
1863 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001864 "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 -04001865 },
1866 "indexableText": { # Indexable text attributes for the file (can only be written)
1867 "text": "A String", # The text to be indexed for this file.
1868 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001869 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001870 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04001871 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1872 "writersCanShare": True or False, # Whether writers can share the document with other users.
1873 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001874 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04001875 "picture": { # The user's profile picture.
1876 "url": "A String", # A URL that points to a profile picture of this user.
1877 },
1878 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001879 "displayName": "A String", # A plain text displayable name for this user.
1880 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001881 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1882 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001883 },
1884 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001885 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04001886 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001887 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001888 "picture": { # The user's profile picture.
1889 "url": "A String", # A URL that points to a profile picture of this user.
1890 },
1891 "kind": "drive#user", # This is always drive#user.
1892 "displayName": "A String", # A plain text displayable name for this user.
1893 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1894 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1895 "emailAddress": "A String", # The email address of the user.
1896 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001897 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1898 "width": 42, # The width of the video in pixels.
1899 "durationMillis": "A String", # The duration of the video in milliseconds.
1900 "height": 42, # The height of the video in pixels.
1901 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001902 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04001903 "picture": { # The user's profile picture.
1904 "url": "A String", # A URL that points to a profile picture of this user.
1905 },
1906 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001907 "displayName": "A String", # A plain text displayable name for this user.
1908 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001909 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1910 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001911 },
1912 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001913 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001914 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04001915 "ownerNames": [ # Name(s) of the owner(s) of this file.
1916 "A String",
1917 ],
1918 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1919 "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.
1920 "etag": "A String", # ETag of the file.
1921 "parents": [ # Collection of parent folders which contain this file.
1922 # 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.
1923 { # A reference to a file's parent.
1924 "selfLink": "A String", # A link back to this reference.
1925 "kind": "drive#parentReference", # This is always drive#parentReference.
1926 "id": "A String", # The ID of the parent.
1927 "isRoot": True or False, # Whether or not the parent is the root folder.
1928 "parentLink": "A String", # A link to the parent.
1929 },
1930 ],
1931 "exportLinks": { # Links for exporting Google Docs to specific formats.
1932 "a_key": "A String", # A mapping from export format to URL
1933 },
1934 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001935 "permissions": [ # The list of permissions for users with access to this file.
1936 { # A permission for a file.
1937 "withLink": True or False, # Whether the link is required for this permission.
1938 "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.
1939 "name": "A String", # The name for this permission.
1940 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001941 "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 unless the permission type anyone, in which case both id and value are ignored.
1942 "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 unless the permission type anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07001943 "authKey": "A String", # The authkey parameter required for this permission.
1944 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001945 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001946 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07001947 "role": "A String", # The primary role for this user. Allowed values are:
1948 # - owner
1949 # - reader
1950 # - writer
1951 "type": "A String", # The account type. Allowed values are:
1952 # - user
1953 # - group
1954 # - domain
1955 # - anyone
1956 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1957 "A String",
1958 ],
1959 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001960 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001961 },
1962 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001963 "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 -04001964 "openWithLinks": { # A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
1965 "a_key": "A String",
1966 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001967 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
John Asmuth614db982014-04-24 15:46:26 -04001968 "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.
1969 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1970 "exposureTime": 3.14, # The length of the exposure, in seconds.
1971 "cameraMake": "A String", # The make of the camera used to create the photo.
1972 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1973 "isoSpeed": 42, # The ISO speed used to create the photo.
1974 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1975 "exposureMode": "A String", # The exposure mode used to create the photo.
1976 "colorSpace": "A String", # The color space of the photo.
1977 "location": { # Geographic location information stored in the image.
1978 "latitude": 3.14, # The latitude stored in the image.
1979 "altitude": 3.14, # The altitude stored in the image.
1980 "longitude": 3.14, # The longitude stored in the image.
1981 },
1982 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1983 "height": 42, # The height of the image in pixels.
1984 "lens": "A String", # The lens used to create the photo.
1985 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1986 "width": 42, # The width of the image in pixels.
1987 "meteringMode": "A String", # The metering mode used to create the photo.
1988 "flashUsed": True or False, # Whether a flash was used to create the photo.
1989 "aperture": 3.14, # The aperture used to create the photo (f-number).
1990 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1991 "sensor": "A String", # The type of sensor used to create the photo.
1992 "whiteBalance": "A String", # The white balance mode used to create the photo.
1993 "cameraModel": "A String", # The model of the camera used to create the photo.
1994 },
1995 "description": "A String", # A short description of the file.
1996 "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.
1997 "editable": True or False, # Whether the file can be edited by the current user.
1998 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001999 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002000 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002001 "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 -07002002 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002003 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002004 { # A key-value pair attached to a file that is either public or private to an application.
2005 # The following limits apply to file properties:
2006 # - Maximum of 100 properties total per file
2007 # - Maximum of 30 private properties per app
2008 # - Maximum of 30 public properties
2009 # - 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 -04002010 "kind": "drive#property", # This is always drive#property.
2011 "value": "A String", # The value of this property.
2012 "etag": "A String", # ETag of the property.
2013 "visibility": "A String", # The visibility of this property.
2014 "key": "A String", # The key of this property.
2015 "selfLink": "A String", # The link back to this property.
2016 },
2017 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002018 "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 -04002019 "iconLink": "A String", # A link to the file's icon.
2020 "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.
2021 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002022 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002023 "title": "A String", # The title of this file.
2024 "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 -07002025 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2026 "mimeType": "A String", # The MIME type of the thumbnail.
2027 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2028 },
2029 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002030 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2031 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002032 "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 -04002033 "name": "A String", # The name for this permission.
2034 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002035 "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 unless the permission type anyone, in which case both id and value are ignored.
2036 "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 unless the permission type anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04002037 "authKey": "A String", # The authkey parameter required for this permission.
2038 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002039 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002040 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04002041 "role": "A String", # The primary role for this user. Allowed values are:
2042 # - owner
2043 # - reader
2044 # - writer
2045 "type": "A String", # The account type. Allowed values are:
2046 # - user
2047 # - group
2048 # - domain
2049 # - anyone
2050 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2051 "A String",
2052 ],
2053 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002054 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04002055 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002056 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002057 "A String",
2058 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002059 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002060 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
Takashi Matsuo06694102015-09-11 13:55:40 -07002061 "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.
2062 "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 -04002063 "selfLink": "A String", # A link back to this file.
2064 "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.
2065 }</pre>
2066</div>
2067
2068<div class="method">
2069 <code class="details" id="touch">touch(fileId)</code>
2070 <pre>Set the file's updated time to the current server time.
2071
2072Args:
2073 fileId: string, The ID of the file to update. (required)
2074
2075Returns:
2076 An object of the form:
2077
2078 { # The metadata for a file.
2079 "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.
2080 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002081 "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.
2082 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002083 "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 -04002084 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002085 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04002086 "hidden": True or False, # Deprecated.
2087 "viewed": True or False, # Whether this file has been viewed by this user.
2088 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002089 "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 -04002090 },
2091 "indexableText": { # Indexable text attributes for the file (can only be written)
2092 "text": "A String", # The text to be indexed for this file.
2093 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002094 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002095 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04002096 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2097 "writersCanShare": True or False, # Whether writers can share the document with other users.
2098 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002099 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04002100 "picture": { # The user's profile picture.
2101 "url": "A String", # A URL that points to a profile picture of this user.
2102 },
2103 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002104 "displayName": "A String", # A plain text displayable name for this user.
2105 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002106 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2107 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002108 },
2109 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002110 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04002111 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002112 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002113 "picture": { # The user's profile picture.
2114 "url": "A String", # A URL that points to a profile picture of this user.
2115 },
2116 "kind": "drive#user", # This is always drive#user.
2117 "displayName": "A String", # A plain text displayable name for this user.
2118 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2119 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2120 "emailAddress": "A String", # The email address of the user.
2121 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002122 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2123 "width": 42, # The width of the video in pixels.
2124 "durationMillis": "A String", # The duration of the video in milliseconds.
2125 "height": 42, # The height of the video in pixels.
2126 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002127 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04002128 "picture": { # The user's profile picture.
2129 "url": "A String", # A URL that points to a profile picture of this user.
2130 },
2131 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002132 "displayName": "A String", # A plain text displayable name for this user.
2133 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002134 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2135 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002136 },
2137 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002138 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002139 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04002140 "ownerNames": [ # Name(s) of the owner(s) of this file.
2141 "A String",
2142 ],
2143 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2144 "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.
2145 "etag": "A String", # ETag of the file.
2146 "parents": [ # Collection of parent folders which contain this file.
2147 # 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.
2148 { # A reference to a file's parent.
2149 "selfLink": "A String", # A link back to this reference.
2150 "kind": "drive#parentReference", # This is always drive#parentReference.
2151 "id": "A String", # The ID of the parent.
2152 "isRoot": True or False, # Whether or not the parent is the root folder.
2153 "parentLink": "A String", # A link to the parent.
2154 },
2155 ],
2156 "exportLinks": { # Links for exporting Google Docs to specific formats.
2157 "a_key": "A String", # A mapping from export format to URL
2158 },
2159 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002160 "permissions": [ # The list of permissions for users with access to this file.
2161 { # A permission for a file.
2162 "withLink": True or False, # Whether the link is required for this permission.
2163 "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.
2164 "name": "A String", # The name for this permission.
2165 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002166 "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 unless the permission type anyone, in which case both id and value are ignored.
2167 "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 unless the permission type anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07002168 "authKey": "A String", # The authkey parameter required for this permission.
2169 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002170 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002171 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07002172 "role": "A String", # The primary role for this user. Allowed values are:
2173 # - owner
2174 # - reader
2175 # - writer
2176 "type": "A String", # The account type. Allowed values are:
2177 # - user
2178 # - group
2179 # - domain
2180 # - anyone
2181 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2182 "A String",
2183 ],
2184 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002185 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002186 },
2187 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002188 "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 -04002189 "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.
2190 "a_key": "A String",
2191 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002192 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
John Asmuth614db982014-04-24 15:46:26 -04002193 "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.
2194 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2195 "exposureTime": 3.14, # The length of the exposure, in seconds.
2196 "cameraMake": "A String", # The make of the camera used to create the photo.
2197 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2198 "isoSpeed": 42, # The ISO speed used to create the photo.
2199 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2200 "exposureMode": "A String", # The exposure mode used to create the photo.
2201 "colorSpace": "A String", # The color space of the photo.
2202 "location": { # Geographic location information stored in the image.
2203 "latitude": 3.14, # The latitude stored in the image.
2204 "altitude": 3.14, # The altitude stored in the image.
2205 "longitude": 3.14, # The longitude stored in the image.
2206 },
2207 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2208 "height": 42, # The height of the image in pixels.
2209 "lens": "A String", # The lens used to create the photo.
2210 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2211 "width": 42, # The width of the image in pixels.
2212 "meteringMode": "A String", # The metering mode used to create the photo.
2213 "flashUsed": True or False, # Whether a flash was used to create the photo.
2214 "aperture": 3.14, # The aperture used to create the photo (f-number).
2215 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2216 "sensor": "A String", # The type of sensor used to create the photo.
2217 "whiteBalance": "A String", # The white balance mode used to create the photo.
2218 "cameraModel": "A String", # The model of the camera used to create the photo.
2219 },
2220 "description": "A String", # A short description of the file.
2221 "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.
2222 "editable": True or False, # Whether the file can be edited by the current user.
2223 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002224 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002225 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002226 "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 -07002227 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002228 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002229 { # A key-value pair attached to a file that is either public or private to an application.
2230 # The following limits apply to file properties:
2231 # - Maximum of 100 properties total per file
2232 # - Maximum of 30 private properties per app
2233 # - Maximum of 30 public properties
2234 # - 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 -04002235 "kind": "drive#property", # This is always drive#property.
2236 "value": "A String", # The value of this property.
2237 "etag": "A String", # ETag of the property.
2238 "visibility": "A String", # The visibility of this property.
2239 "key": "A String", # The key of this property.
2240 "selfLink": "A String", # The link back to this property.
2241 },
2242 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002243 "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 -04002244 "iconLink": "A String", # A link to the file's icon.
2245 "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.
2246 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002247 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002248 "title": "A String", # The title of this file.
2249 "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 -07002250 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2251 "mimeType": "A String", # The MIME type of the thumbnail.
2252 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2253 },
2254 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002255 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2256 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002257 "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 -04002258 "name": "A String", # The name for this permission.
2259 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002260 "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 unless the permission type anyone, in which case both id and value are ignored.
2261 "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 unless the permission type anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04002262 "authKey": "A String", # The authkey parameter required for this permission.
2263 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002264 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002265 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04002266 "role": "A String", # The primary role for this user. Allowed values are:
2267 # - owner
2268 # - reader
2269 # - writer
2270 "type": "A String", # The account type. Allowed values are:
2271 # - user
2272 # - group
2273 # - domain
2274 # - anyone
2275 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2276 "A String",
2277 ],
2278 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002279 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04002280 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002281 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002282 "A String",
2283 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002284 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002285 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
Takashi Matsuo06694102015-09-11 13:55:40 -07002286 "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.
2287 "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 -04002288 "selfLink": "A String", # A link back to this file.
2289 "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.
2290 }</pre>
2291</div>
2292
2293<div class="method">
2294 <code class="details" id="trash">trash(fileId)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -07002295 <pre>Moves a file to the trash. The currently authenticated user must own the file.
John Asmuth614db982014-04-24 15:46:26 -04002296
2297Args:
2298 fileId: string, The ID of the file to trash. (required)
2299
2300Returns:
2301 An object of the form:
2302
2303 { # The metadata for a file.
2304 "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.
2305 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002306 "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.
2307 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002308 "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 -04002309 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002310 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04002311 "hidden": True or False, # Deprecated.
2312 "viewed": True or False, # Whether this file has been viewed by this user.
2313 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002314 "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 -04002315 },
2316 "indexableText": { # Indexable text attributes for the file (can only be written)
2317 "text": "A String", # The text to be indexed for this file.
2318 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002319 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002320 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04002321 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2322 "writersCanShare": True or False, # Whether writers can share the document with other users.
2323 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002324 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04002325 "picture": { # The user's profile picture.
2326 "url": "A String", # A URL that points to a profile picture of this user.
2327 },
2328 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002329 "displayName": "A String", # A plain text displayable name for this user.
2330 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002331 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2332 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002333 },
2334 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002335 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04002336 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002337 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002338 "picture": { # The user's profile picture.
2339 "url": "A String", # A URL that points to a profile picture of this user.
2340 },
2341 "kind": "drive#user", # This is always drive#user.
2342 "displayName": "A String", # A plain text displayable name for this user.
2343 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2344 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2345 "emailAddress": "A String", # The email address of the user.
2346 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002347 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2348 "width": 42, # The width of the video in pixels.
2349 "durationMillis": "A String", # The duration of the video in milliseconds.
2350 "height": 42, # The height of the video in pixels.
2351 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002352 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04002353 "picture": { # The user's profile picture.
2354 "url": "A String", # A URL that points to a profile picture of this user.
2355 },
2356 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002357 "displayName": "A String", # A plain text displayable name for this user.
2358 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002359 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2360 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002361 },
2362 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002363 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002364 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04002365 "ownerNames": [ # Name(s) of the owner(s) of this file.
2366 "A String",
2367 ],
2368 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2369 "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.
2370 "etag": "A String", # ETag of the file.
2371 "parents": [ # Collection of parent folders which contain this file.
2372 # 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.
2373 { # A reference to a file's parent.
2374 "selfLink": "A String", # A link back to this reference.
2375 "kind": "drive#parentReference", # This is always drive#parentReference.
2376 "id": "A String", # The ID of the parent.
2377 "isRoot": True or False, # Whether or not the parent is the root folder.
2378 "parentLink": "A String", # A link to the parent.
2379 },
2380 ],
2381 "exportLinks": { # Links for exporting Google Docs to specific formats.
2382 "a_key": "A String", # A mapping from export format to URL
2383 },
2384 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002385 "permissions": [ # The list of permissions for users with access to this file.
2386 { # A permission for a file.
2387 "withLink": True or False, # Whether the link is required for this permission.
2388 "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.
2389 "name": "A String", # The name for this permission.
2390 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002391 "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 unless the permission type anyone, in which case both id and value are ignored.
2392 "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 unless the permission type anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07002393 "authKey": "A String", # The authkey parameter required for this permission.
2394 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002395 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002396 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07002397 "role": "A String", # The primary role for this user. Allowed values are:
2398 # - owner
2399 # - reader
2400 # - writer
2401 "type": "A String", # The account type. Allowed values are:
2402 # - user
2403 # - group
2404 # - domain
2405 # - anyone
2406 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2407 "A String",
2408 ],
2409 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002410 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002411 },
2412 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002413 "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 -04002414 "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.
2415 "a_key": "A String",
2416 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002417 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
John Asmuth614db982014-04-24 15:46:26 -04002418 "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.
2419 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2420 "exposureTime": 3.14, # The length of the exposure, in seconds.
2421 "cameraMake": "A String", # The make of the camera used to create the photo.
2422 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2423 "isoSpeed": 42, # The ISO speed used to create the photo.
2424 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2425 "exposureMode": "A String", # The exposure mode used to create the photo.
2426 "colorSpace": "A String", # The color space of the photo.
2427 "location": { # Geographic location information stored in the image.
2428 "latitude": 3.14, # The latitude stored in the image.
2429 "altitude": 3.14, # The altitude stored in the image.
2430 "longitude": 3.14, # The longitude stored in the image.
2431 },
2432 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2433 "height": 42, # The height of the image in pixels.
2434 "lens": "A String", # The lens used to create the photo.
2435 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2436 "width": 42, # The width of the image in pixels.
2437 "meteringMode": "A String", # The metering mode used to create the photo.
2438 "flashUsed": True or False, # Whether a flash was used to create the photo.
2439 "aperture": 3.14, # The aperture used to create the photo (f-number).
2440 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2441 "sensor": "A String", # The type of sensor used to create the photo.
2442 "whiteBalance": "A String", # The white balance mode used to create the photo.
2443 "cameraModel": "A String", # The model of the camera used to create the photo.
2444 },
2445 "description": "A String", # A short description of the file.
2446 "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.
2447 "editable": True or False, # Whether the file can be edited by the current user.
2448 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002449 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002450 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002451 "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 -07002452 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002453 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002454 { # A key-value pair attached to a file that is either public or private to an application.
2455 # The following limits apply to file properties:
2456 # - Maximum of 100 properties total per file
2457 # - Maximum of 30 private properties per app
2458 # - Maximum of 30 public properties
2459 # - 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 -04002460 "kind": "drive#property", # This is always drive#property.
2461 "value": "A String", # The value of this property.
2462 "etag": "A String", # ETag of the property.
2463 "visibility": "A String", # The visibility of this property.
2464 "key": "A String", # The key of this property.
2465 "selfLink": "A String", # The link back to this property.
2466 },
2467 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002468 "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 -04002469 "iconLink": "A String", # A link to the file's icon.
2470 "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.
2471 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002472 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002473 "title": "A String", # The title of this file.
2474 "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 -07002475 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2476 "mimeType": "A String", # The MIME type of the thumbnail.
2477 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2478 },
2479 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002480 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2481 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002482 "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 -04002483 "name": "A String", # The name for this permission.
2484 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002485 "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 unless the permission type anyone, in which case both id and value are ignored.
2486 "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 unless the permission type anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04002487 "authKey": "A String", # The authkey parameter required for this permission.
2488 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002489 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002490 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04002491 "role": "A String", # The primary role for this user. Allowed values are:
2492 # - owner
2493 # - reader
2494 # - writer
2495 "type": "A String", # The account type. Allowed values are:
2496 # - user
2497 # - group
2498 # - domain
2499 # - anyone
2500 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2501 "A String",
2502 ],
2503 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002504 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04002505 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002506 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002507 "A String",
2508 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002509 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002510 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
Takashi Matsuo06694102015-09-11 13:55:40 -07002511 "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.
2512 "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 -04002513 "selfLink": "A String", # A link back to this file.
2514 "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.
2515 }</pre>
2516</div>
2517
2518<div class="method">
2519 <code class="details" id="untrash">untrash(fileId)</code>
2520 <pre>Restores a file from the trash.
2521
2522Args:
2523 fileId: string, The ID of the file to untrash. (required)
2524
2525Returns:
2526 An object of the form:
2527
2528 { # The metadata for a file.
2529 "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.
2530 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002531 "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.
2532 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002533 "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 -04002534 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002535 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04002536 "hidden": True or False, # Deprecated.
2537 "viewed": True or False, # Whether this file has been viewed by this user.
2538 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002539 "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 -04002540 },
2541 "indexableText": { # Indexable text attributes for the file (can only be written)
2542 "text": "A String", # The text to be indexed for this file.
2543 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002544 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002545 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04002546 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2547 "writersCanShare": True or False, # Whether writers can share the document with other users.
2548 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002549 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04002550 "picture": { # The user's profile picture.
2551 "url": "A String", # A URL that points to a profile picture of this user.
2552 },
2553 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002554 "displayName": "A String", # A plain text displayable name for this user.
2555 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002556 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2557 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002558 },
2559 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002560 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04002561 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002562 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002563 "picture": { # The user's profile picture.
2564 "url": "A String", # A URL that points to a profile picture of this user.
2565 },
2566 "kind": "drive#user", # This is always drive#user.
2567 "displayName": "A String", # A plain text displayable name for this user.
2568 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2569 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2570 "emailAddress": "A String", # The email address of the user.
2571 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002572 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2573 "width": 42, # The width of the video in pixels.
2574 "durationMillis": "A String", # The duration of the video in milliseconds.
2575 "height": 42, # The height of the video in pixels.
2576 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002577 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04002578 "picture": { # The user's profile picture.
2579 "url": "A String", # A URL that points to a profile picture of this user.
2580 },
2581 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002582 "displayName": "A String", # A plain text displayable name for this user.
2583 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002584 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2585 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002586 },
2587 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002588 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002589 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04002590 "ownerNames": [ # Name(s) of the owner(s) of this file.
2591 "A String",
2592 ],
2593 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2594 "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.
2595 "etag": "A String", # ETag of the file.
2596 "parents": [ # Collection of parent folders which contain this file.
2597 # 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.
2598 { # A reference to a file's parent.
2599 "selfLink": "A String", # A link back to this reference.
2600 "kind": "drive#parentReference", # This is always drive#parentReference.
2601 "id": "A String", # The ID of the parent.
2602 "isRoot": True or False, # Whether or not the parent is the root folder.
2603 "parentLink": "A String", # A link to the parent.
2604 },
2605 ],
2606 "exportLinks": { # Links for exporting Google Docs to specific formats.
2607 "a_key": "A String", # A mapping from export format to URL
2608 },
2609 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002610 "permissions": [ # The list of permissions for users with access to this file.
2611 { # A permission for a file.
2612 "withLink": True or False, # Whether the link is required for this permission.
2613 "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.
2614 "name": "A String", # The name for this permission.
2615 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002616 "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 unless the permission type anyone, in which case both id and value are ignored.
2617 "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 unless the permission type anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07002618 "authKey": "A String", # The authkey parameter required for this permission.
2619 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002620 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002621 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07002622 "role": "A String", # The primary role for this user. Allowed values are:
2623 # - owner
2624 # - reader
2625 # - writer
2626 "type": "A String", # The account type. Allowed values are:
2627 # - user
2628 # - group
2629 # - domain
2630 # - anyone
2631 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2632 "A String",
2633 ],
2634 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002635 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002636 },
2637 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002638 "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 -04002639 "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.
2640 "a_key": "A String",
2641 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002642 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
John Asmuth614db982014-04-24 15:46:26 -04002643 "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.
2644 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2645 "exposureTime": 3.14, # The length of the exposure, in seconds.
2646 "cameraMake": "A String", # The make of the camera used to create the photo.
2647 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2648 "isoSpeed": 42, # The ISO speed used to create the photo.
2649 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2650 "exposureMode": "A String", # The exposure mode used to create the photo.
2651 "colorSpace": "A String", # The color space of the photo.
2652 "location": { # Geographic location information stored in the image.
2653 "latitude": 3.14, # The latitude stored in the image.
2654 "altitude": 3.14, # The altitude stored in the image.
2655 "longitude": 3.14, # The longitude stored in the image.
2656 },
2657 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2658 "height": 42, # The height of the image in pixels.
2659 "lens": "A String", # The lens used to create the photo.
2660 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2661 "width": 42, # The width of the image in pixels.
2662 "meteringMode": "A String", # The metering mode used to create the photo.
2663 "flashUsed": True or False, # Whether a flash was used to create the photo.
2664 "aperture": 3.14, # The aperture used to create the photo (f-number).
2665 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2666 "sensor": "A String", # The type of sensor used to create the photo.
2667 "whiteBalance": "A String", # The white balance mode used to create the photo.
2668 "cameraModel": "A String", # The model of the camera used to create the photo.
2669 },
2670 "description": "A String", # A short description of the file.
2671 "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.
2672 "editable": True or False, # Whether the file can be edited by the current user.
2673 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002674 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002675 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002676 "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 -07002677 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002678 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002679 { # A key-value pair attached to a file that is either public or private to an application.
2680 # The following limits apply to file properties:
2681 # - Maximum of 100 properties total per file
2682 # - Maximum of 30 private properties per app
2683 # - Maximum of 30 public properties
2684 # - 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 -04002685 "kind": "drive#property", # This is always drive#property.
2686 "value": "A String", # The value of this property.
2687 "etag": "A String", # ETag of the property.
2688 "visibility": "A String", # The visibility of this property.
2689 "key": "A String", # The key of this property.
2690 "selfLink": "A String", # The link back to this property.
2691 },
2692 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002693 "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 -04002694 "iconLink": "A String", # A link to the file's icon.
2695 "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.
2696 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002697 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002698 "title": "A String", # The title of this file.
2699 "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 -07002700 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2701 "mimeType": "A String", # The MIME type of the thumbnail.
2702 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2703 },
2704 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002705 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2706 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002707 "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 -04002708 "name": "A String", # The name for this permission.
2709 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002710 "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 unless the permission type anyone, in which case both id and value are ignored.
2711 "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 unless the permission type anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04002712 "authKey": "A String", # The authkey parameter required for this permission.
2713 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002714 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002715 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04002716 "role": "A String", # The primary role for this user. Allowed values are:
2717 # - owner
2718 # - reader
2719 # - writer
2720 "type": "A String", # The account type. Allowed values are:
2721 # - user
2722 # - group
2723 # - domain
2724 # - anyone
2725 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2726 "A String",
2727 ],
2728 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002729 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04002730 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002731 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002732 "A String",
2733 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002734 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002735 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
Takashi Matsuo06694102015-09-11 13:55:40 -07002736 "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.
2737 "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 -04002738 "selfLink": "A String", # A link back to this file.
2739 "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.
2740 }</pre>
2741</div>
2742
2743<div class="method">
Takashi Matsuo06694102015-09-11 13:55:40 -07002744 <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 -04002745 <pre>Updates file metadata and/or content.
2746
2747Args:
2748 fileId: string, The ID of the file to update. (required)
2749 body: object, The request body.
2750 The object takes the form of:
2751
2752{ # The metadata for a file.
2753 "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.
2754 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002755 "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.
2756 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002757 "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 -04002758 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002759 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04002760 "hidden": True or False, # Deprecated.
2761 "viewed": True or False, # Whether this file has been viewed by this user.
2762 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002763 "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 -04002764 },
2765 "indexableText": { # Indexable text attributes for the file (can only be written)
2766 "text": "A String", # The text to be indexed for this file.
2767 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002768 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002769 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04002770 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2771 "writersCanShare": True or False, # Whether writers can share the document with other users.
2772 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002773 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04002774 "picture": { # The user's profile picture.
2775 "url": "A String", # A URL that points to a profile picture of this user.
2776 },
2777 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002778 "displayName": "A String", # A plain text displayable name for this user.
2779 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002780 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2781 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002782 },
2783 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002784 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04002785 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002786 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002787 "picture": { # The user's profile picture.
2788 "url": "A String", # A URL that points to a profile picture of this user.
2789 },
2790 "kind": "drive#user", # This is always drive#user.
2791 "displayName": "A String", # A plain text displayable name for this user.
2792 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2793 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2794 "emailAddress": "A String", # The email address of the user.
2795 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002796 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2797 "width": 42, # The width of the video in pixels.
2798 "durationMillis": "A String", # The duration of the video in milliseconds.
2799 "height": 42, # The height of the video in pixels.
2800 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002801 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04002802 "picture": { # The user's profile picture.
2803 "url": "A String", # A URL that points to a profile picture of this user.
2804 },
2805 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002806 "displayName": "A String", # A plain text displayable name for this user.
2807 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002808 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2809 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002810 },
2811 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002812 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002813 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04002814 "ownerNames": [ # Name(s) of the owner(s) of this file.
2815 "A String",
2816 ],
2817 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2818 "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.
2819 "etag": "A String", # ETag of the file.
2820 "parents": [ # Collection of parent folders which contain this file.
2821 # 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.
2822 { # A reference to a file's parent.
2823 "selfLink": "A String", # A link back to this reference.
2824 "kind": "drive#parentReference", # This is always drive#parentReference.
2825 "id": "A String", # The ID of the parent.
2826 "isRoot": True or False, # Whether or not the parent is the root folder.
2827 "parentLink": "A String", # A link to the parent.
2828 },
2829 ],
2830 "exportLinks": { # Links for exporting Google Docs to specific formats.
2831 "a_key": "A String", # A mapping from export format to URL
2832 },
2833 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002834 "permissions": [ # The list of permissions for users with access to this file.
2835 { # A permission for a file.
2836 "withLink": True or False, # Whether the link is required for this permission.
2837 "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.
2838 "name": "A String", # The name for this permission.
2839 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002840 "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 unless the permission type anyone, in which case both id and value are ignored.
2841 "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 unless the permission type anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07002842 "authKey": "A String", # The authkey parameter required for this permission.
2843 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002844 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002845 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07002846 "role": "A String", # The primary role for this user. Allowed values are:
2847 # - owner
2848 # - reader
2849 # - writer
2850 "type": "A String", # The account type. Allowed values are:
2851 # - user
2852 # - group
2853 # - domain
2854 # - anyone
2855 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2856 "A String",
2857 ],
2858 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002859 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002860 },
2861 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002862 "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 -04002863 "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.
2864 "a_key": "A String",
2865 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002866 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
John Asmuth614db982014-04-24 15:46:26 -04002867 "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.
2868 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2869 "exposureTime": 3.14, # The length of the exposure, in seconds.
2870 "cameraMake": "A String", # The make of the camera used to create the photo.
2871 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2872 "isoSpeed": 42, # The ISO speed used to create the photo.
2873 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2874 "exposureMode": "A String", # The exposure mode used to create the photo.
2875 "colorSpace": "A String", # The color space of the photo.
2876 "location": { # Geographic location information stored in the image.
2877 "latitude": 3.14, # The latitude stored in the image.
2878 "altitude": 3.14, # The altitude stored in the image.
2879 "longitude": 3.14, # The longitude stored in the image.
2880 },
2881 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2882 "height": 42, # The height of the image in pixels.
2883 "lens": "A String", # The lens used to create the photo.
2884 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2885 "width": 42, # The width of the image in pixels.
2886 "meteringMode": "A String", # The metering mode used to create the photo.
2887 "flashUsed": True or False, # Whether a flash was used to create the photo.
2888 "aperture": 3.14, # The aperture used to create the photo (f-number).
2889 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2890 "sensor": "A String", # The type of sensor used to create the photo.
2891 "whiteBalance": "A String", # The white balance mode used to create the photo.
2892 "cameraModel": "A String", # The model of the camera used to create the photo.
2893 },
2894 "description": "A String", # A short description of the file.
2895 "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.
2896 "editable": True or False, # Whether the file can be edited by the current user.
2897 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002898 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002899 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002900 "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 -07002901 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002902 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002903 { # A key-value pair attached to a file that is either public or private to an application.
2904 # The following limits apply to file properties:
2905 # - Maximum of 100 properties total per file
2906 # - Maximum of 30 private properties per app
2907 # - Maximum of 30 public properties
2908 # - 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 -04002909 "kind": "drive#property", # This is always drive#property.
2910 "value": "A String", # The value of this property.
2911 "etag": "A String", # ETag of the property.
2912 "visibility": "A String", # The visibility of this property.
2913 "key": "A String", # The key of this property.
2914 "selfLink": "A String", # The link back to this property.
2915 },
2916 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002917 "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 -04002918 "iconLink": "A String", # A link to the file's icon.
2919 "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.
2920 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002921 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002922 "title": "A String", # The title of this file.
2923 "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 -07002924 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
2925 "mimeType": "A String", # The MIME type of the thumbnail.
2926 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2927 },
2928 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002929 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2930 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002931 "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 -04002932 "name": "A String", # The name for this permission.
2933 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002934 "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 unless the permission type anyone, in which case both id and value are ignored.
2935 "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 unless the permission type anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04002936 "authKey": "A String", # The authkey parameter required for this permission.
2937 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002938 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002939 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04002940 "role": "A String", # The primary role for this user. Allowed values are:
2941 # - owner
2942 # - reader
2943 # - writer
2944 "type": "A String", # The account type. Allowed values are:
2945 # - user
2946 # - group
2947 # - domain
2948 # - anyone
2949 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2950 "A String",
2951 ],
2952 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002953 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04002954 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002955 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002956 "A String",
2957 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002958 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002959 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
Takashi Matsuo06694102015-09-11 13:55:40 -07002960 "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.
2961 "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 -04002962 "selfLink": "A String", # A link back to this file.
2963 "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.
2964}
2965
Takashi Matsuo06694102015-09-11 13:55:40 -07002966 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.
2967 modifiedDateBehavior: string, Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.
2968 Allowed values
2969 fromBody - Set modifiedDate to the value provided in the body of the request. No change if no value was provided.
2970 fromBodyIfNeeded - Set modifiedDate to the value provided in the body of the request depending on other contents of the update.
2971 fromBodyOrNow - Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.
2972 noChange - Maintain the previous value of modifiedDate.
2973 now - Set modifiedDate to the current time.
2974 nowIfNeeded - Set modifiedDate to the current time depending on contents of the update.
John Asmuth614db982014-04-24 15:46:26 -04002975 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002976 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 -04002977 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002978 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 -07002979 addParents: string, Comma-separated list of parent IDs to add.
2980 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04002981 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
2982 timedTextTrackName: string, The timed text track name.
Takashi Matsuo06694102015-09-11 13:55:40 -07002983 convert: boolean, This parameter is deprecated and has no function.
John Asmuth614db982014-04-24 15:46:26 -04002984 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
2985 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
2986 timedTextLanguage: string, The language of the timed text.
2987
2988Returns:
2989 An object of the form:
2990
2991 { # The metadata for a file.
2992 "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.
2993 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002994 "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.
2995 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002996 "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 -04002997 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002998 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
John Asmuth614db982014-04-24 15:46:26 -04002999 "hidden": True or False, # Deprecated.
3000 "viewed": True or False, # Whether this file has been viewed by this user.
3001 "starred": True or False, # Whether this file is starred by the user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003002 "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 -04003003 },
3004 "indexableText": { # Indexable text attributes for the file (can only be written)
3005 "text": "A String", # The text to be indexed for this file.
3006 },
Takashi Matsuo06694102015-09-11 13:55:40 -07003007 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003008 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04003009 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
3010 "writersCanShare": True or False, # Whether writers can share the document with other users.
3011 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003012 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04003013 "picture": { # The user's profile picture.
3014 "url": "A String", # A URL that points to a profile picture of this user.
3015 },
3016 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04003017 "displayName": "A String", # A plain text displayable name for this user.
3018 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07003019 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
3020 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04003021 },
3022 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07003023 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04003024 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003025 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07003026 "picture": { # The user's profile picture.
3027 "url": "A String", # A URL that points to a profile picture of this user.
3028 },
3029 "kind": "drive#user", # This is always drive#user.
3030 "displayName": "A String", # A plain text displayable name for this user.
3031 "permissionId": "A String", # The user's ID as visible in the permissions collection.
3032 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
3033 "emailAddress": "A String", # The email address of the user.
3034 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -07003035 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
3036 "width": 42, # The width of the video in pixels.
3037 "durationMillis": "A String", # The duration of the video in milliseconds.
3038 "height": 42, # The height of the video in pixels.
3039 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003040 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04003041 "picture": { # The user's profile picture.
3042 "url": "A String", # A URL that points to a profile picture of this user.
3043 },
3044 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04003045 "displayName": "A String", # A plain text displayable name for this user.
3046 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07003047 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
3048 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04003049 },
3050 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08003051 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003052 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04003053 "ownerNames": [ # Name(s) of the owner(s) of this file.
3054 "A String",
3055 ],
3056 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
3057 "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.
3058 "etag": "A String", # ETag of the file.
3059 "parents": [ # Collection of parent folders which contain this file.
3060 # 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.
3061 { # A reference to a file's parent.
3062 "selfLink": "A String", # A link back to this reference.
3063 "kind": "drive#parentReference", # This is always drive#parentReference.
3064 "id": "A String", # The ID of the parent.
3065 "isRoot": True or False, # Whether or not the parent is the root folder.
3066 "parentLink": "A String", # A link to the parent.
3067 },
3068 ],
3069 "exportLinks": { # Links for exporting Google Docs to specific formats.
3070 "a_key": "A String", # A mapping from export format to URL
3071 },
3072 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07003073 "permissions": [ # The list of permissions for users with access to this file.
3074 { # A permission for a file.
3075 "withLink": True or False, # Whether the link is required for this permission.
3076 "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.
3077 "name": "A String", # The name for this permission.
3078 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003079 "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 unless the permission type anyone, in which case both id and value are ignored.
3080 "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 unless the permission type anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07003081 "authKey": "A String", # The authkey parameter required for this permission.
3082 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08003083 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003084 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07003085 "role": "A String", # The primary role for this user. Allowed values are:
3086 # - owner
3087 # - reader
3088 # - writer
3089 "type": "A String", # The account type. Allowed values are:
3090 # - user
3091 # - group
3092 # - domain
3093 # - anyone
3094 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
3095 "A String",
3096 ],
3097 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003098 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07003099 },
3100 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07003101 "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 -04003102 "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.
3103 "a_key": "A String",
3104 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003105 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
John Asmuth614db982014-04-24 15:46:26 -04003106 "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.
3107 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
3108 "exposureTime": 3.14, # The length of the exposure, in seconds.
3109 "cameraMake": "A String", # The make of the camera used to create the photo.
3110 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
3111 "isoSpeed": 42, # The ISO speed used to create the photo.
3112 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
3113 "exposureMode": "A String", # The exposure mode used to create the photo.
3114 "colorSpace": "A String", # The color space of the photo.
3115 "location": { # Geographic location information stored in the image.
3116 "latitude": 3.14, # The latitude stored in the image.
3117 "altitude": 3.14, # The altitude stored in the image.
3118 "longitude": 3.14, # The longitude stored in the image.
3119 },
3120 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
3121 "height": 42, # The height of the image in pixels.
3122 "lens": "A String", # The lens used to create the photo.
3123 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
3124 "width": 42, # The width of the image in pixels.
3125 "meteringMode": "A String", # The metering mode used to create the photo.
3126 "flashUsed": True or False, # Whether a flash was used to create the photo.
3127 "aperture": 3.14, # The aperture used to create the photo (f-number).
3128 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
3129 "sensor": "A String", # The type of sensor used to create the photo.
3130 "whiteBalance": "A String", # The white balance mode used to create the photo.
3131 "cameraModel": "A String", # The model of the camera used to create the photo.
3132 },
3133 "description": "A String", # A short description of the file.
3134 "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.
3135 "editable": True or False, # Whether the file can be edited by the current user.
3136 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07003137 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04003138 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07003139 "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 -07003140 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04003141 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003142 { # A key-value pair attached to a file that is either public or private to an application.
3143 # The following limits apply to file properties:
3144 # - Maximum of 100 properties total per file
3145 # - Maximum of 30 private properties per app
3146 # - Maximum of 30 public properties
3147 # - 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 -04003148 "kind": "drive#property", # This is always drive#property.
3149 "value": "A String", # The value of this property.
3150 "etag": "A String", # ETag of the property.
3151 "visibility": "A String", # The visibility of this property.
3152 "key": "A String", # The key of this property.
3153 "selfLink": "A String", # The link back to this property.
3154 },
3155 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07003156 "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 -04003157 "iconLink": "A String", # A link to the file's icon.
3158 "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.
3159 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07003160 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04003161 "title": "A String", # The title of this file.
3162 "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 -07003163 "thumbnail": { # Thumbnail for the file. Only accepted on upload and for files that are not already thumbnailed by Google.
3164 "mimeType": "A String", # The MIME type of the thumbnail.
3165 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
3166 },
3167 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04003168 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
3169 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07003170 "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 -04003171 "name": "A String", # The name for this permission.
3172 "kind": "drive#permission", # This is always drive#permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003173 "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 unless the permission type anyone, in which case both id and value are ignored.
3174 "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 unless the permission type anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04003175 "authKey": "A String", # The authkey parameter required for this permission.
3176 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08003177 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003178 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04003179 "role": "A String", # The primary role for this user. Allowed values are:
3180 # - owner
3181 # - reader
3182 # - writer
3183 "type": "A String", # The account type. Allowed values are:
3184 # - user
3185 # - group
3186 # - domain
3187 # - anyone
3188 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
3189 "A String",
3190 ],
3191 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003192 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04003193 },
Takashi Matsuo06694102015-09-11 13:55:40 -07003194 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003195 "A String",
3196 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07003197 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003198 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive.
Takashi Matsuo06694102015-09-11 13:55:40 -07003199 "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.
3200 "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 -04003201 "selfLink": "A String", # A link back to this file.
3202 "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.
3203 }</pre>
3204</div>
3205
3206<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003207 <code class="details" id="watch">watch(fileId, body, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04003208 <pre>Subscribe to changes on a file
3209
3210Args:
3211 fileId: string, The ID for the file in question. (required)
3212 body: object, The request body. (required)
3213 The object takes the form of:
3214
3215{ # An notification channel used to watch for resource changes.
3216 "resourceUri": "A String", # A version-specific identifier for the watched resource.
3217 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
3218 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
3219 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
3220 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
3221 "params": { # Additional parameters controlling delivery channel behavior. Optional.
3222 "a_key": "A String", # Declares a new parameter by name.
3223 },
3224 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
3225 "address": "A String", # The address where notifications are delivered for this channel.
3226 "type": "A String", # The type of delivery mechanism used for this channel.
3227 "id": "A String", # A UUID or similar unique string that identifies this channel.
3228 }
3229
3230 projection: string, This parameter is deprecated and has no function.
3231 Allowed values
3232 BASIC - Deprecated
3233 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003234 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -08003235 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003236 updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.
John Asmuth614db982014-04-24 15:46:26 -04003237
3238Returns:
3239 An object of the form:
3240
3241 { # An notification channel used to watch for resource changes.
3242 "resourceUri": "A String", # A version-specific identifier for the watched resource.
3243 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
3244 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
3245 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
3246 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
3247 "params": { # Additional parameters controlling delivery channel behavior. Optional.
3248 "a_key": "A String", # Declares a new parameter by name.
3249 },
3250 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
3251 "address": "A String", # The address where notifications are delivered for this channel.
3252 "type": "A String", # The type of delivery mechanism used for this channel.
3253 "id": "A String", # A UUID or similar unique string that identifies this channel.
3254 }</pre>
3255</div>
3256
Craig Citroe633be12015-03-02 13:40:36 -08003257<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003258 <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 -08003259 <pre>Subscribe to changes on a file
3260
3261Args:
3262 fileId: string, The ID for the file in question. (required)
3263 body: object, The request body. (required)
3264 The object takes the form of:
3265
3266{ # An notification channel used to watch for resource changes.
3267 "resourceUri": "A String", # A version-specific identifier for the watched resource.
3268 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
3269 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
3270 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
3271 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
3272 "params": { # Additional parameters controlling delivery channel behavior. Optional.
3273 "a_key": "A String", # Declares a new parameter by name.
3274 },
3275 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
3276 "address": "A String", # The address where notifications are delivered for this channel.
3277 "type": "A String", # The type of delivery mechanism used for this channel.
3278 "id": "A String", # A UUID or similar unique string that identifies this channel.
3279 }
3280
3281 projection: string, This parameter is deprecated and has no function.
3282 Allowed values
3283 BASIC - Deprecated
3284 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003285 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -08003286 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003287 updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.
Craig Citroe633be12015-03-02 13:40:36 -08003288
3289Returns:
3290 The media object as a string.
3291
3292 </pre>
3293</div>
3294
John Asmuth614db982014-04-24 15:46:26 -04003295</body></html>