blob: 834122b9e66b607c64ac1e3b75b705c49ee80a17 [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">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800102 <code><a href="#insert">insert(body=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, visibility=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, media_mime_type=None, timedTextLanguage=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400103<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">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800123 <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, media_mime_type=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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800142 "hasThumbnail": True or False, # Whether this file has a thumbnail.
John Asmuth614db982014-04-24 15:46:26 -0400143 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800146 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800149 "modified": True or False, # Whether the file has been modified by this user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000150 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800151 "hidden": True or False, # Deprecated.
152 "starred": True or False, # Whether this file is starred by the user.
153 "viewed": True or False, # Whether this file has been viewed by this user.
John Asmuth614db982014-04-24 15:46:26 -0400154 },
155 "indexableText": { # Indexable text attributes for the file (can only be written)
156 "text": "A String", # The text to be indexed for this file.
157 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800158 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Takashi Matsuo06694102015-09-11 13:55:40 -0700159 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700160 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -0400161 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
162 "writersCanShare": True or False, # Whether writers can share the document with other users.
163 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700164 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -0400165 "picture": { # The user's profile picture.
166 "url": "A String", # A URL that points to a profile picture of this user.
167 },
168 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400169 "displayName": "A String", # A plain text displayable name for this user.
170 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700171 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
172 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400173 },
174 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700175 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -0400176 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700177 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700178 "picture": { # The user's profile picture.
179 "url": "A String", # A URL that points to a profile picture of this user.
180 },
181 "kind": "drive#user", # This is always drive#user.
182 "displayName": "A String", # A plain text displayable name for this user.
183 "permissionId": "A String", # The user's ID as visible in the permissions collection.
184 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
185 "emailAddress": "A String", # The email address of the user.
186 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800187 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700188 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -0400189 "picture": { # The user's profile picture.
190 "url": "A String", # A URL that points to a profile picture of this user.
191 },
192 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400193 "displayName": "A String", # A plain text displayable name for this user.
194 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700195 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
196 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400197 },
198 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800199 "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 -0700200 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400201 "ownerNames": [ # Name(s) of the owner(s) of this file.
202 "A String",
203 ],
204 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
205 "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.
206 "etag": "A String", # ETag of the file.
207 "parents": [ # Collection of parent folders which contain this file.
208 # 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.
209 { # A reference to a file's parent.
210 "selfLink": "A String", # A link back to this reference.
211 "kind": "drive#parentReference", # This is always drive#parentReference.
212 "id": "A String", # The ID of the parent.
213 "isRoot": True or False, # Whether or not the parent is the root folder.
214 "parentLink": "A String", # A link to the parent.
215 },
216 ],
217 "exportLinks": { # Links for exporting Google Docs to specific formats.
218 "a_key": "A String", # A mapping from export format to URL
219 },
220 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700221 "permissions": [ # The list of permissions for users with access to this file.
222 { # A permission for a file.
223 "withLink": True or False, # Whether the link is required for this permission.
224 "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.
225 "name": "A String", # The name for this permission.
226 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800227 "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 is anyone, in which case both id and value are ignored.
228 "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 is anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -0700229 "authKey": "A String", # The authkey parameter required for this permission.
230 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800231 "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 -0700232 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -0700233 "role": "A String", # The primary role for this user. Allowed values are:
234 # - owner
235 # - reader
236 # - writer
237 "type": "A String", # The account type. Allowed values are:
238 # - user
239 # - group
240 # - domain
241 # - anyone
242 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
243 "A String",
244 ],
245 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700246 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700247 },
248 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700249 "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 -0400250 "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.
251 "a_key": "A String",
252 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700253 "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 -0400254 "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.
255 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
256 "exposureTime": 3.14, # The length of the exposure, in seconds.
257 "cameraMake": "A String", # The make of the camera used to create the photo.
258 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
259 "isoSpeed": 42, # The ISO speed used to create the photo.
260 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
261 "exposureMode": "A String", # The exposure mode used to create the photo.
262 "colorSpace": "A String", # The color space of the photo.
263 "location": { # Geographic location information stored in the image.
264 "latitude": 3.14, # The latitude stored in the image.
265 "altitude": 3.14, # The altitude stored in the image.
266 "longitude": 3.14, # The longitude stored in the image.
267 },
268 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
269 "height": 42, # The height of the image in pixels.
270 "lens": "A String", # The lens used to create the photo.
271 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
272 "width": 42, # The width of the image in pixels.
273 "meteringMode": "A String", # The metering mode used to create the photo.
274 "flashUsed": True or False, # Whether a flash was used to create the photo.
275 "aperture": 3.14, # The aperture used to create the photo (f-number).
276 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
277 "sensor": "A String", # The type of sensor used to create the photo.
278 "whiteBalance": "A String", # The white balance mode used to create the photo.
279 "cameraModel": "A String", # The model of the camera used to create the photo.
280 },
281 "description": "A String", # A short description of the file.
282 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800283 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
284 "width": 42, # The width of the video in pixels.
285 "durationMillis": "A String", # The duration of the video in milliseconds.
286 "height": 42, # The height of the video in pixels.
287 },
John Asmuth614db982014-04-24 15:46:26 -0400288 "editable": True or False, # Whether the file can be edited by the current user.
289 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700290 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -0400291 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700292 "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 -0700293 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400294 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000295 { # A key-value pair attached to a file that is either public or private to an application.
296 # The following limits apply to file properties:
297 # - Maximum of 100 properties total per file
298 # - Maximum of 30 private properties per app
299 # - Maximum of 30 public properties
300 # - 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 -0400301 "kind": "drive#property", # This is always drive#property.
302 "value": "A String", # The value of this property.
303 "etag": "A String", # ETag of the property.
304 "visibility": "A String", # The visibility of this property.
305 "key": "A String", # The key of this property.
306 "selfLink": "A String", # The link back to this property.
307 },
308 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700309 "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 -0400310 "iconLink": "A String", # A link to the file's icon.
311 "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.
312 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700313 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400314 "title": "A String", # The title of this file.
315 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800316 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
Takashi Matsuo06694102015-09-11 13:55:40 -0700317 "mimeType": "A String", # The MIME type of the thumbnail.
318 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
319 },
320 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -0400321 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
322 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700323 "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 -0400324 "name": "A String", # The name for this permission.
325 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800326 "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 is anyone, in which case both id and value are ignored.
327 "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 is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400328 "authKey": "A String", # The authkey parameter required for this permission.
329 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800330 "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 -0700331 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -0400332 "role": "A String", # The primary role for this user. Allowed values are:
333 # - owner
334 # - reader
335 # - writer
336 "type": "A String", # The account type. Allowed values are:
337 # - user
338 # - group
339 # - domain
340 # - anyone
341 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
342 "A String",
343 ],
344 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700345 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400346 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700347 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000348 "A String",
349 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700350 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700351 "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 -0700352 "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.
353 "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 -0400354 "selfLink": "A String", # A link back to this file.
355 "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.
356}
357
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700358 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 -0400359 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
360 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.
361 Allowed values
362 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
363 PRIVATE - The new file will be visible to only the owner.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000364 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 -0400365 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
366 timedTextLanguage: string, The language of the timed text.
367 timedTextTrackName: string, The timed text track name.
368
369Returns:
370 An object of the form:
371
372 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800373 "hasThumbnail": True or False, # Whether this file has a thumbnail.
John Asmuth614db982014-04-24 15:46:26 -0400374 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700375 "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.
376 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800377 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
John Asmuth614db982014-04-24 15:46:26 -0400378 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700379 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800380 "modified": True or False, # Whether the file has been modified by this user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000381 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800382 "hidden": True or False, # Deprecated.
383 "starred": True or False, # Whether this file is starred by the user.
384 "viewed": True or False, # Whether this file has been viewed by this user.
John Asmuth614db982014-04-24 15:46:26 -0400385 },
386 "indexableText": { # Indexable text attributes for the file (can only be written)
387 "text": "A String", # The text to be indexed for this file.
388 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800389 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Takashi Matsuo06694102015-09-11 13:55:40 -0700390 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700391 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -0400392 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
393 "writersCanShare": True or False, # Whether writers can share the document with other users.
394 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700395 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -0400396 "picture": { # The user's profile picture.
397 "url": "A String", # A URL that points to a profile picture of this user.
398 },
399 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400400 "displayName": "A String", # A plain text displayable name for this user.
401 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700402 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
403 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400404 },
405 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700406 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -0400407 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700408 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700409 "picture": { # The user's profile picture.
410 "url": "A String", # A URL that points to a profile picture of this user.
411 },
412 "kind": "drive#user", # This is always drive#user.
413 "displayName": "A String", # A plain text displayable name for this user.
414 "permissionId": "A String", # The user's ID as visible in the permissions collection.
415 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
416 "emailAddress": "A String", # The email address of the user.
417 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800418 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700419 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -0400420 "picture": { # The user's profile picture.
421 "url": "A String", # A URL that points to a profile picture of this user.
422 },
423 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400424 "displayName": "A String", # A plain text displayable name for this user.
425 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700426 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
427 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400428 },
429 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800430 "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 -0700431 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400432 "ownerNames": [ # Name(s) of the owner(s) of this file.
433 "A String",
434 ],
435 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
436 "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.
437 "etag": "A String", # ETag of the file.
438 "parents": [ # Collection of parent folders which contain this file.
439 # 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.
440 { # A reference to a file's parent.
441 "selfLink": "A String", # A link back to this reference.
442 "kind": "drive#parentReference", # This is always drive#parentReference.
443 "id": "A String", # The ID of the parent.
444 "isRoot": True or False, # Whether or not the parent is the root folder.
445 "parentLink": "A String", # A link to the parent.
446 },
447 ],
448 "exportLinks": { # Links for exporting Google Docs to specific formats.
449 "a_key": "A String", # A mapping from export format to URL
450 },
451 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700452 "permissions": [ # The list of permissions for users with access to this file.
453 { # A permission for a file.
454 "withLink": True or False, # Whether the link is required for this permission.
455 "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.
456 "name": "A String", # The name for this permission.
457 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800458 "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 is anyone, in which case both id and value are ignored.
459 "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 is anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -0700460 "authKey": "A String", # The authkey parameter required for this permission.
461 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800462 "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 -0700463 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -0700464 "role": "A String", # The primary role for this user. Allowed values are:
465 # - owner
466 # - reader
467 # - writer
468 "type": "A String", # The account type. Allowed values are:
469 # - user
470 # - group
471 # - domain
472 # - anyone
473 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
474 "A String",
475 ],
476 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700477 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700478 },
479 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700480 "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 -0400481 "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.
482 "a_key": "A String",
483 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700484 "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 -0400485 "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.
486 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
487 "exposureTime": 3.14, # The length of the exposure, in seconds.
488 "cameraMake": "A String", # The make of the camera used to create the photo.
489 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
490 "isoSpeed": 42, # The ISO speed used to create the photo.
491 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
492 "exposureMode": "A String", # The exposure mode used to create the photo.
493 "colorSpace": "A String", # The color space of the photo.
494 "location": { # Geographic location information stored in the image.
495 "latitude": 3.14, # The latitude stored in the image.
496 "altitude": 3.14, # The altitude stored in the image.
497 "longitude": 3.14, # The longitude stored in the image.
498 },
499 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
500 "height": 42, # The height of the image in pixels.
501 "lens": "A String", # The lens used to create the photo.
502 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
503 "width": 42, # The width of the image in pixels.
504 "meteringMode": "A String", # The metering mode used to create the photo.
505 "flashUsed": True or False, # Whether a flash was used to create the photo.
506 "aperture": 3.14, # The aperture used to create the photo (f-number).
507 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
508 "sensor": "A String", # The type of sensor used to create the photo.
509 "whiteBalance": "A String", # The white balance mode used to create the photo.
510 "cameraModel": "A String", # The model of the camera used to create the photo.
511 },
512 "description": "A String", # A short description of the file.
513 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800514 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
515 "width": 42, # The width of the video in pixels.
516 "durationMillis": "A String", # The duration of the video in milliseconds.
517 "height": 42, # The height of the video in pixels.
518 },
John Asmuth614db982014-04-24 15:46:26 -0400519 "editable": True or False, # Whether the file can be edited by the current user.
520 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700521 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -0400522 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700523 "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 -0700524 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400525 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000526 { # A key-value pair attached to a file that is either public or private to an application.
527 # The following limits apply to file properties:
528 # - Maximum of 100 properties total per file
529 # - Maximum of 30 private properties per app
530 # - Maximum of 30 public properties
531 # - 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 -0400532 "kind": "drive#property", # This is always drive#property.
533 "value": "A String", # The value of this property.
534 "etag": "A String", # ETag of the property.
535 "visibility": "A String", # The visibility of this property.
536 "key": "A String", # The key of this property.
537 "selfLink": "A String", # The link back to this property.
538 },
539 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700540 "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 -0400541 "iconLink": "A String", # A link to the file's icon.
542 "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.
543 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700544 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400545 "title": "A String", # The title of this file.
546 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800547 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
Takashi Matsuo06694102015-09-11 13:55:40 -0700548 "mimeType": "A String", # The MIME type of the thumbnail.
549 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
550 },
551 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -0400552 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
553 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700554 "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 -0400555 "name": "A String", # The name for this permission.
556 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800557 "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 is anyone, in which case both id and value are ignored.
558 "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 is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400559 "authKey": "A String", # The authkey parameter required for this permission.
560 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800561 "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 -0700562 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -0400563 "role": "A String", # The primary role for this user. Allowed values are:
564 # - owner
565 # - reader
566 # - writer
567 "type": "A String", # The account type. Allowed values are:
568 # - user
569 # - group
570 # - domain
571 # - anyone
572 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
573 "A String",
574 ],
575 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700576 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400577 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700578 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000579 "A String",
580 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700581 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700582 "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 -0700583 "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.
584 "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 -0400585 "selfLink": "A String", # A link back to this file.
586 "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.
587 }</pre>
588</div>
589
590<div class="method">
591 <code class="details" id="delete">delete(fileId)</code>
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000592 <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 -0400593
594Args:
595 fileId: string, The ID of the file to delete. (required)
596</pre>
597</div>
598
599<div class="method">
Craig Citro065b5302014-08-14 00:47:23 -0700600 <code class="details" id="emptyTrash">emptyTrash()</code>
601 <pre>Permanently deletes all of the user's trashed files.
602
603Args:
604</pre>
605</div>
606
607<div class="method">
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700608 <code class="details" id="export">export(fileId, mimeType)</code>
609 <pre>Exports a Google Doc to the requested MIME type and returns the exported content.
610
611Args:
612 fileId: string, The ID of the file. (required)
613 mimeType: string, The MIME type of the format requested for this export. (required)
614</pre>
615</div>
616
617<div class="method">
618 <code class="details" id="export_media">export_media(fileId, mimeType)</code>
619 <pre>Exports a Google Doc to the requested MIME type and returns the exported content.
620
621Args:
622 fileId: string, The ID of the file. (required)
623 mimeType: string, The MIME type of the format requested for this export. (required)
624</pre>
625</div>
626
627<div class="method">
Takashi Matsuo06694102015-09-11 13:55:40 -0700628 <code class="details" id="generateIds">generateIds(space=None, maxResults=None)</code>
629 <pre>Generates a set of file IDs which can be provided in insert requests.
630
631Args:
632 space: string, The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.
633 maxResults: integer, Maximum number of IDs to return.
634
635Returns:
636 An object of the form:
637
638 { # A list of generated IDs which can be provided in insert requests
639 "kind": "drive#generatedIds", # This is always drive#generatedIds
640 "ids": [ # The IDs generated for the requesting user in the specified space.
641 "A String",
642 ],
643 "space": "A String", # The type of file that can be created with these IDs.
644 }</pre>
645</div>
646
647<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000648 <code class="details" id="get">get(fileId, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400649 <pre>Gets a file's metadata by ID.
650
651Args:
652 fileId: string, The ID for the file in question. (required)
653 projection: string, This parameter is deprecated and has no function.
654 Allowed values
655 BASIC - Deprecated
656 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000657 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -0800658 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700659 updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.
John Asmuth614db982014-04-24 15:46:26 -0400660
661Returns:
662 An object of the form:
663
664 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800665 "hasThumbnail": True or False, # Whether this file has a thumbnail.
John Asmuth614db982014-04-24 15:46:26 -0400666 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700667 "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.
668 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800669 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
John Asmuth614db982014-04-24 15:46:26 -0400670 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700671 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800672 "modified": True or False, # Whether the file has been modified by this user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000673 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800674 "hidden": True or False, # Deprecated.
675 "starred": True or False, # Whether this file is starred by the user.
676 "viewed": True or False, # Whether this file has been viewed by this user.
John Asmuth614db982014-04-24 15:46:26 -0400677 },
678 "indexableText": { # Indexable text attributes for the file (can only be written)
679 "text": "A String", # The text to be indexed for this file.
680 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800681 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Takashi Matsuo06694102015-09-11 13:55:40 -0700682 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700683 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -0400684 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
685 "writersCanShare": True or False, # Whether writers can share the document with other users.
686 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700687 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -0400688 "picture": { # The user's profile picture.
689 "url": "A String", # A URL that points to a profile picture of this user.
690 },
691 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400692 "displayName": "A String", # A plain text displayable name for this user.
693 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700694 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
695 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400696 },
697 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700698 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -0400699 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700700 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700701 "picture": { # The user's profile picture.
702 "url": "A String", # A URL that points to a profile picture of this user.
703 },
704 "kind": "drive#user", # This is always drive#user.
705 "displayName": "A String", # A plain text displayable name for this user.
706 "permissionId": "A String", # The user's ID as visible in the permissions collection.
707 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
708 "emailAddress": "A String", # The email address of the user.
709 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800710 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700711 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -0400712 "picture": { # The user's profile picture.
713 "url": "A String", # A URL that points to a profile picture of this user.
714 },
715 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400716 "displayName": "A String", # A plain text displayable name for this user.
717 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700718 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
719 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400720 },
721 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800722 "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 -0700723 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400724 "ownerNames": [ # Name(s) of the owner(s) of this file.
725 "A String",
726 ],
727 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
728 "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.
729 "etag": "A String", # ETag of the file.
730 "parents": [ # Collection of parent folders which contain this file.
731 # 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.
732 { # A reference to a file's parent.
733 "selfLink": "A String", # A link back to this reference.
734 "kind": "drive#parentReference", # This is always drive#parentReference.
735 "id": "A String", # The ID of the parent.
736 "isRoot": True or False, # Whether or not the parent is the root folder.
737 "parentLink": "A String", # A link to the parent.
738 },
739 ],
740 "exportLinks": { # Links for exporting Google Docs to specific formats.
741 "a_key": "A String", # A mapping from export format to URL
742 },
743 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700744 "permissions": [ # The list of permissions for users with access to this file.
745 { # A permission for a file.
746 "withLink": True or False, # Whether the link is required for this permission.
747 "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.
748 "name": "A String", # The name for this permission.
749 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800750 "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 is anyone, in which case both id and value are ignored.
751 "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 is anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -0700752 "authKey": "A String", # The authkey parameter required for this permission.
753 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800754 "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 -0700755 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -0700756 "role": "A String", # The primary role for this user. Allowed values are:
757 # - owner
758 # - reader
759 # - writer
760 "type": "A String", # The account type. Allowed values are:
761 # - user
762 # - group
763 # - domain
764 # - anyone
765 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
766 "A String",
767 ],
768 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700769 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700770 },
771 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700772 "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 -0400773 "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.
774 "a_key": "A String",
775 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700776 "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 -0400777 "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.
778 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
779 "exposureTime": 3.14, # The length of the exposure, in seconds.
780 "cameraMake": "A String", # The make of the camera used to create the photo.
781 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
782 "isoSpeed": 42, # The ISO speed used to create the photo.
783 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
784 "exposureMode": "A String", # The exposure mode used to create the photo.
785 "colorSpace": "A String", # The color space of the photo.
786 "location": { # Geographic location information stored in the image.
787 "latitude": 3.14, # The latitude stored in the image.
788 "altitude": 3.14, # The altitude stored in the image.
789 "longitude": 3.14, # The longitude stored in the image.
790 },
791 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
792 "height": 42, # The height of the image in pixels.
793 "lens": "A String", # The lens used to create the photo.
794 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
795 "width": 42, # The width of the image in pixels.
796 "meteringMode": "A String", # The metering mode used to create the photo.
797 "flashUsed": True or False, # Whether a flash was used to create the photo.
798 "aperture": 3.14, # The aperture used to create the photo (f-number).
799 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
800 "sensor": "A String", # The type of sensor used to create the photo.
801 "whiteBalance": "A String", # The white balance mode used to create the photo.
802 "cameraModel": "A String", # The model of the camera used to create the photo.
803 },
804 "description": "A String", # A short description of the file.
805 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800806 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
807 "width": 42, # The width of the video in pixels.
808 "durationMillis": "A String", # The duration of the video in milliseconds.
809 "height": 42, # The height of the video in pixels.
810 },
John Asmuth614db982014-04-24 15:46:26 -0400811 "editable": True or False, # Whether the file can be edited by the current user.
812 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700813 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -0400814 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700815 "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 -0700816 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -0400817 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000818 { # A key-value pair attached to a file that is either public or private to an application.
819 # The following limits apply to file properties:
820 # - Maximum of 100 properties total per file
821 # - Maximum of 30 private properties per app
822 # - Maximum of 30 public properties
823 # - 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 -0400824 "kind": "drive#property", # This is always drive#property.
825 "value": "A String", # The value of this property.
826 "etag": "A String", # ETag of the property.
827 "visibility": "A String", # The visibility of this property.
828 "key": "A String", # The key of this property.
829 "selfLink": "A String", # The link back to this property.
830 },
831 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700832 "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 -0400833 "iconLink": "A String", # A link to the file's icon.
834 "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.
835 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700836 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -0400837 "title": "A String", # The title of this file.
838 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800839 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
Takashi Matsuo06694102015-09-11 13:55:40 -0700840 "mimeType": "A String", # The MIME type of the thumbnail.
841 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
842 },
843 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -0400844 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
845 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700846 "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 -0400847 "name": "A String", # The name for this permission.
848 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800849 "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 is anyone, in which case both id and value are ignored.
850 "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 is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400851 "authKey": "A String", # The authkey parameter required for this permission.
852 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800853 "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 -0700854 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -0400855 "role": "A String", # The primary role for this user. Allowed values are:
856 # - owner
857 # - reader
858 # - writer
859 "type": "A String", # The account type. Allowed values are:
860 # - user
861 # - group
862 # - domain
863 # - anyone
864 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
865 "A String",
866 ],
867 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700868 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400869 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700870 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000871 "A String",
872 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700873 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700874 "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 -0700875 "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.
876 "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 -0400877 "selfLink": "A String", # A link back to this file.
878 "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.
879 }</pre>
880</div>
881
882<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000883 <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 -0800884 <pre>Gets a file's metadata by ID.
885
886Args:
887 fileId: string, The ID for the file in question. (required)
888 projection: string, This parameter is deprecated and has no function.
889 Allowed values
890 BASIC - Deprecated
891 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000892 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -0800893 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700894 updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.
Craig Citroe633be12015-03-02 13:40:36 -0800895
896Returns:
897 The media object as a string.
898
899 </pre>
900</div>
901
902<div class="method">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800903 <code class="details" id="insert">insert(body=None, media_body=None, ocrLanguage=None, ocr=None, pinned=None, visibility=None, timedTextTrackName=None, convert=None, useContentAsIndexableText=None, media_mime_type=None, timedTextLanguage=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400904 <pre>Insert a new file.
905
906Args:
907 body: object, The request body.
908 The object takes the form of:
909
910{ # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800911 "hasThumbnail": True or False, # Whether this file has a thumbnail.
John Asmuth614db982014-04-24 15:46:26 -0400912 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -0700913 "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.
914 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800915 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
John Asmuth614db982014-04-24 15:46:26 -0400916 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -0700917 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800918 "modified": True or False, # Whether the file has been modified by this user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000919 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800920 "hidden": True or False, # Deprecated.
921 "starred": True or False, # Whether this file is starred by the user.
922 "viewed": True or False, # Whether this file has been viewed by this user.
John Asmuth614db982014-04-24 15:46:26 -0400923 },
924 "indexableText": { # Indexable text attributes for the file (can only be written)
925 "text": "A String", # The text to be indexed for this file.
926 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800927 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Takashi Matsuo06694102015-09-11 13:55:40 -0700928 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700929 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -0400930 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
931 "writersCanShare": True or False, # Whether writers can share the document with other users.
932 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700933 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -0400934 "picture": { # The user's profile picture.
935 "url": "A String", # A URL that points to a profile picture of this user.
936 },
937 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400938 "displayName": "A String", # A plain text displayable name for this user.
939 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700940 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
941 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400942 },
943 ],
Takashi Matsuo06694102015-09-11 13:55:40 -0700944 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -0400945 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700946 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -0700947 "picture": { # The user's profile picture.
948 "url": "A String", # A URL that points to a profile picture of this user.
949 },
950 "kind": "drive#user", # This is always drive#user.
951 "displayName": "A String", # A plain text displayable name for this user.
952 "permissionId": "A String", # The user's ID as visible in the permissions collection.
953 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
954 "emailAddress": "A String", # The email address of the user.
955 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800956 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700957 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -0400958 "picture": { # The user's profile picture.
959 "url": "A String", # A URL that points to a profile picture of this user.
960 },
961 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -0400962 "displayName": "A String", # A plain text displayable name for this user.
963 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -0700964 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
965 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -0400966 },
967 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -0800968 "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 -0700969 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400970 "ownerNames": [ # Name(s) of the owner(s) of this file.
971 "A String",
972 ],
973 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
974 "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.
975 "etag": "A String", # ETag of the file.
976 "parents": [ # Collection of parent folders which contain this file.
977 # 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.
978 { # A reference to a file's parent.
979 "selfLink": "A String", # A link back to this reference.
980 "kind": "drive#parentReference", # This is always drive#parentReference.
981 "id": "A String", # The ID of the parent.
982 "isRoot": True or False, # Whether or not the parent is the root folder.
983 "parentLink": "A String", # A link to the parent.
984 },
985 ],
986 "exportLinks": { # Links for exporting Google Docs to specific formats.
987 "a_key": "A String", # A mapping from export format to URL
988 },
989 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -0700990 "permissions": [ # The list of permissions for users with access to this file.
991 { # A permission for a file.
992 "withLink": True or False, # Whether the link is required for this permission.
993 "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.
994 "name": "A String", # The name for this permission.
995 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800996 "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 is anyone, in which case both id and value are ignored.
997 "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 is anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -0700998 "authKey": "A String", # The authkey parameter required for this permission.
999 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001000 "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 -07001001 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07001002 "role": "A String", # The primary role for this user. Allowed values are:
1003 # - owner
1004 # - reader
1005 # - writer
1006 "type": "A String", # The account type. Allowed values are:
1007 # - user
1008 # - group
1009 # - domain
1010 # - anyone
1011 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1012 "A String",
1013 ],
1014 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001015 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001016 },
1017 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001018 "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 -04001019 "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.
1020 "a_key": "A String",
1021 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001022 "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 -04001023 "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.
1024 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1025 "exposureTime": 3.14, # The length of the exposure, in seconds.
1026 "cameraMake": "A String", # The make of the camera used to create the photo.
1027 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1028 "isoSpeed": 42, # The ISO speed used to create the photo.
1029 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1030 "exposureMode": "A String", # The exposure mode used to create the photo.
1031 "colorSpace": "A String", # The color space of the photo.
1032 "location": { # Geographic location information stored in the image.
1033 "latitude": 3.14, # The latitude stored in the image.
1034 "altitude": 3.14, # The altitude stored in the image.
1035 "longitude": 3.14, # The longitude stored in the image.
1036 },
1037 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1038 "height": 42, # The height of the image in pixels.
1039 "lens": "A String", # The lens used to create the photo.
1040 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1041 "width": 42, # The width of the image in pixels.
1042 "meteringMode": "A String", # The metering mode used to create the photo.
1043 "flashUsed": True or False, # Whether a flash was used to create the photo.
1044 "aperture": 3.14, # The aperture used to create the photo (f-number).
1045 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1046 "sensor": "A String", # The type of sensor used to create the photo.
1047 "whiteBalance": "A String", # The white balance mode used to create the photo.
1048 "cameraModel": "A String", # The model of the camera used to create the photo.
1049 },
1050 "description": "A String", # A short description of the file.
1051 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001052 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1053 "width": 42, # The width of the video in pixels.
1054 "durationMillis": "A String", # The duration of the video in milliseconds.
1055 "height": 42, # The height of the video in pixels.
1056 },
John Asmuth614db982014-04-24 15:46:26 -04001057 "editable": True or False, # Whether the file can be edited by the current user.
1058 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001059 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04001060 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001061 "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 -07001062 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001063 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001064 { # A key-value pair attached to a file that is either public or private to an application.
1065 # The following limits apply to file properties:
1066 # - Maximum of 100 properties total per file
1067 # - Maximum of 30 private properties per app
1068 # - Maximum of 30 public properties
1069 # - 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 -04001070 "kind": "drive#property", # This is always drive#property.
1071 "value": "A String", # The value of this property.
1072 "etag": "A String", # ETag of the property.
1073 "visibility": "A String", # The visibility of this property.
1074 "key": "A String", # The key of this property.
1075 "selfLink": "A String", # The link back to this property.
1076 },
1077 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001078 "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 -04001079 "iconLink": "A String", # A link to the file's icon.
1080 "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.
1081 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001082 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001083 "title": "A String", # The title of this file.
1084 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001085 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
Takashi Matsuo06694102015-09-11 13:55:40 -07001086 "mimeType": "A String", # The MIME type of the thumbnail.
1087 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
1088 },
1089 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04001090 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1091 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001092 "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 -04001093 "name": "A String", # The name for this permission.
1094 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001095 "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 is anyone, in which case both id and value are ignored.
1096 "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 is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04001097 "authKey": "A String", # The authkey parameter required for this permission.
1098 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001099 "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 -07001100 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04001101 "role": "A String", # The primary role for this user. Allowed values are:
1102 # - owner
1103 # - reader
1104 # - writer
1105 "type": "A String", # The account type. Allowed values are:
1106 # - user
1107 # - group
1108 # - domain
1109 # - anyone
1110 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1111 "A String",
1112 ],
1113 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001114 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04001115 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001116 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001117 "A String",
1118 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001119 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001120 "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 -07001121 "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.
1122 "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 -04001123 "selfLink": "A String", # A link back to this file.
1124 "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.
1125}
1126
1127 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001128 ocrLanguage: string, If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
1129 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
1130 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 -04001131 visibility: string, The visibility of the new file. This parameter is only relevant when convert=false.
1132 Allowed values
1133 DEFAULT - The visibility of the new file is determined by the user's default visibility/sharing policies.
1134 PRIVATE - The new file will be visible to only the owner.
John Asmuth614db982014-04-24 15:46:26 -04001135 timedTextTrackName: string, The timed text track name.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001136 convert: boolean, Whether to convert this file to the corresponding Google Docs format.
1137 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
1138 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
1139 timedTextLanguage: string, The language of the timed text.
John Asmuth614db982014-04-24 15:46:26 -04001140
1141Returns:
1142 An object of the form:
1143
1144 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001145 "hasThumbnail": True or False, # Whether this file has a thumbnail.
John Asmuth614db982014-04-24 15:46:26 -04001146 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001147 "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.
1148 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001149 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
John Asmuth614db982014-04-24 15:46:26 -04001150 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001151 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001152 "modified": True or False, # Whether the file has been modified by this user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001153 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001154 "hidden": True or False, # Deprecated.
1155 "starred": True or False, # Whether this file is starred by the user.
1156 "viewed": True or False, # Whether this file has been viewed by this user.
John Asmuth614db982014-04-24 15:46:26 -04001157 },
1158 "indexableText": { # Indexable text attributes for the file (can only be written)
1159 "text": "A String", # The text to be indexed for this file.
1160 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001161 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Takashi Matsuo06694102015-09-11 13:55:40 -07001162 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001163 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04001164 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1165 "writersCanShare": True or False, # Whether writers can share the document with other users.
1166 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001167 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04001168 "picture": { # The user's profile picture.
1169 "url": "A String", # A URL that points to a profile picture of this user.
1170 },
1171 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001172 "displayName": "A String", # A plain text displayable name for this user.
1173 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001174 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1175 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001176 },
1177 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001178 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04001179 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001180 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001181 "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.
1185 "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.
1187 "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.
1189 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001190 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001191 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04001192 "picture": { # The user's profile picture.
1193 "url": "A String", # A URL that points to a profile picture of this user.
1194 },
1195 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001196 "displayName": "A String", # A plain text displayable name for this user.
1197 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001198 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1199 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001200 },
1201 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001202 "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 -07001203 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04001204 "ownerNames": [ # Name(s) of the owner(s) of this file.
1205 "A String",
1206 ],
1207 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1208 "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.
1209 "etag": "A String", # ETag of the file.
1210 "parents": [ # Collection of parent folders which contain this file.
1211 # 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.
1212 { # A reference to a file's parent.
1213 "selfLink": "A String", # A link back to this reference.
1214 "kind": "drive#parentReference", # This is always drive#parentReference.
1215 "id": "A String", # The ID of the parent.
1216 "isRoot": True or False, # Whether or not the parent is the root folder.
1217 "parentLink": "A String", # A link to the parent.
1218 },
1219 ],
1220 "exportLinks": { # Links for exporting Google Docs to specific formats.
1221 "a_key": "A String", # A mapping from export format to URL
1222 },
1223 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001224 "permissions": [ # The list of permissions for users with access to this file.
1225 { # A permission for a file.
1226 "withLink": True or False, # Whether the link is required for this permission.
1227 "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.
1228 "name": "A String", # The name for this permission.
1229 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001230 "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 is anyone, in which case both id and value are ignored.
1231 "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 is anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07001232 "authKey": "A String", # The authkey parameter required for this permission.
1233 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001234 "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 -07001235 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07001236 "role": "A String", # The primary role for this user. Allowed values are:
1237 # - owner
1238 # - reader
1239 # - writer
1240 "type": "A String", # The account type. Allowed values are:
1241 # - user
1242 # - group
1243 # - domain
1244 # - anyone
1245 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1246 "A String",
1247 ],
1248 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001249 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001250 },
1251 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001252 "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 -04001253 "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.
1254 "a_key": "A String",
1255 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001256 "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 -04001257 "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.
1258 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1259 "exposureTime": 3.14, # The length of the exposure, in seconds.
1260 "cameraMake": "A String", # The make of the camera used to create the photo.
1261 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1262 "isoSpeed": 42, # The ISO speed used to create the photo.
1263 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1264 "exposureMode": "A String", # The exposure mode used to create the photo.
1265 "colorSpace": "A String", # The color space of the photo.
1266 "location": { # Geographic location information stored in the image.
1267 "latitude": 3.14, # The latitude stored in the image.
1268 "altitude": 3.14, # The altitude stored in the image.
1269 "longitude": 3.14, # The longitude stored in the image.
1270 },
1271 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1272 "height": 42, # The height of the image in pixels.
1273 "lens": "A String", # The lens used to create the photo.
1274 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1275 "width": 42, # The width of the image in pixels.
1276 "meteringMode": "A String", # The metering mode used to create the photo.
1277 "flashUsed": True or False, # Whether a flash was used to create the photo.
1278 "aperture": 3.14, # The aperture used to create the photo (f-number).
1279 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1280 "sensor": "A String", # The type of sensor used to create the photo.
1281 "whiteBalance": "A String", # The white balance mode used to create the photo.
1282 "cameraModel": "A String", # The model of the camera used to create the photo.
1283 },
1284 "description": "A String", # A short description of the file.
1285 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001286 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1287 "width": 42, # The width of the video in pixels.
1288 "durationMillis": "A String", # The duration of the video in milliseconds.
1289 "height": 42, # The height of the video in pixels.
1290 },
John Asmuth614db982014-04-24 15:46:26 -04001291 "editable": True or False, # Whether the file can be edited by the current user.
1292 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001293 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04001294 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001295 "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 -07001296 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001297 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001298 { # A key-value pair attached to a file that is either public or private to an application.
1299 # The following limits apply to file properties:
1300 # - Maximum of 100 properties total per file
1301 # - Maximum of 30 private properties per app
1302 # - Maximum of 30 public properties
1303 # - 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 -04001304 "kind": "drive#property", # This is always drive#property.
1305 "value": "A String", # The value of this property.
1306 "etag": "A String", # ETag of the property.
1307 "visibility": "A String", # The visibility of this property.
1308 "key": "A String", # The key of this property.
1309 "selfLink": "A String", # The link back to this property.
1310 },
1311 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001312 "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 -04001313 "iconLink": "A String", # A link to the file's icon.
1314 "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.
1315 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001316 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001317 "title": "A String", # The title of this file.
1318 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001319 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
Takashi Matsuo06694102015-09-11 13:55:40 -07001320 "mimeType": "A String", # The MIME type of the thumbnail.
1321 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
1322 },
1323 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04001324 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1325 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001326 "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 -04001327 "name": "A String", # The name for this permission.
1328 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001329 "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 is anyone, in which case both id and value are ignored.
1330 "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 is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04001331 "authKey": "A String", # The authkey parameter required for this permission.
1332 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001333 "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 -07001334 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04001335 "role": "A String", # The primary role for this user. Allowed values are:
1336 # - owner
1337 # - reader
1338 # - writer
1339 "type": "A String", # The account type. Allowed values are:
1340 # - user
1341 # - group
1342 # - domain
1343 # - anyone
1344 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1345 "A String",
1346 ],
1347 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001348 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04001349 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001350 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001351 "A String",
1352 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001353 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001354 "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 -07001355 "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.
1356 "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 -04001357 "selfLink": "A String", # A link back to this file.
1358 "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.
1359 }</pre>
1360</div>
1361
1362<div class="method">
Takashi Matsuo06694102015-09-11 13:55:40 -07001363 <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 -04001364 <pre>Lists the user's files.
1365
1366Args:
Takashi Matsuo06694102015-09-11 13:55:40 -07001367 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 -04001368 q: string, Query string for searching files.
1369 projection: string, This parameter is deprecated and has no function.
1370 Allowed values
1371 BASIC - Deprecated
1372 FULL - Deprecated
1373 pageToken: string, Page token for files.
1374 maxResults: integer, Maximum number of files to return.
Takashi Matsuo06694102015-09-11 13:55:40 -07001375 spaces: string, A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.
Craig Citro065b5302014-08-14 00:47:23 -07001376 corpus: string, The body of items (files/documents) to which the query applies.
1377 Allowed values
1378 DEFAULT - The items that the user has accessed.
1379 DOMAIN - Items shared to the user's domain.
John Asmuth614db982014-04-24 15:46:26 -04001380
1381Returns:
1382 An object of the form:
1383
1384 { # A list of files.
1385 "nextPageToken": "A String", # The page token for the next page of files.
1386 "kind": "drive#fileList", # This is always drive#fileList.
1387 "items": [ # The actual list of files.
1388 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001389 "hasThumbnail": True or False, # Whether this file has a thumbnail.
John Asmuth614db982014-04-24 15:46:26 -04001390 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001391 "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.
1392 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001393 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
John Asmuth614db982014-04-24 15:46:26 -04001394 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001395 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001396 "modified": True or False, # Whether the file has been modified by this user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001397 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001398 "hidden": True or False, # Deprecated.
1399 "starred": True or False, # Whether this file is starred by the user.
1400 "viewed": True or False, # Whether this file has been viewed by this user.
John Asmuth614db982014-04-24 15:46:26 -04001401 },
1402 "indexableText": { # Indexable text attributes for the file (can only be written)
1403 "text": "A String", # The text to be indexed for this file.
1404 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001405 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Takashi Matsuo06694102015-09-11 13:55:40 -07001406 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001407 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04001408 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1409 "writersCanShare": True or False, # Whether writers can share the document with other users.
1410 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001411 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04001412 "picture": { # The user's profile picture.
1413 "url": "A String", # A URL that points to a profile picture of this user.
1414 },
1415 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001416 "displayName": "A String", # A plain text displayable name for this user.
1417 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001418 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1419 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001420 },
1421 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001422 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04001423 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001424 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001425 "picture": { # The user's profile picture.
1426 "url": "A String", # A URL that points to a profile picture of this user.
1427 },
1428 "kind": "drive#user", # This is always drive#user.
1429 "displayName": "A String", # A plain text displayable name for this user.
1430 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1431 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1432 "emailAddress": "A String", # The email address of the user.
1433 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001434 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001435 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04001436 "picture": { # The user's profile picture.
1437 "url": "A String", # A URL that points to a profile picture of this user.
1438 },
1439 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001440 "displayName": "A String", # A plain text displayable name for this user.
1441 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001442 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1443 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001444 },
1445 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001446 "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 -07001447 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04001448 "ownerNames": [ # Name(s) of the owner(s) of this file.
1449 "A String",
1450 ],
1451 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1452 "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.
1453 "etag": "A String", # ETag of the file.
1454 "parents": [ # Collection of parent folders which contain this file.
1455 # 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.
1456 { # A reference to a file's parent.
1457 "selfLink": "A String", # A link back to this reference.
1458 "kind": "drive#parentReference", # This is always drive#parentReference.
1459 "id": "A String", # The ID of the parent.
1460 "isRoot": True or False, # Whether or not the parent is the root folder.
1461 "parentLink": "A String", # A link to the parent.
1462 },
1463 ],
1464 "exportLinks": { # Links for exporting Google Docs to specific formats.
1465 "a_key": "A String", # A mapping from export format to URL
1466 },
1467 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001468 "permissions": [ # The list of permissions for users with access to this file.
1469 { # A permission for a file.
1470 "withLink": True or False, # Whether the link is required for this permission.
1471 "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.
1472 "name": "A String", # The name for this permission.
1473 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001474 "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 is anyone, in which case both id and value are ignored.
1475 "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 is anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07001476 "authKey": "A String", # The authkey parameter required for this permission.
1477 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001478 "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 -07001479 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07001480 "role": "A String", # The primary role for this user. Allowed values are:
1481 # - owner
1482 # - reader
1483 # - writer
1484 "type": "A String", # The account type. Allowed values are:
1485 # - user
1486 # - group
1487 # - domain
1488 # - anyone
1489 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1490 "A String",
1491 ],
1492 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001493 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001494 },
1495 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001496 "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 -04001497 "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.
1498 "a_key": "A String",
1499 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001500 "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 -04001501 "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.
1502 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1503 "exposureTime": 3.14, # The length of the exposure, in seconds.
1504 "cameraMake": "A String", # The make of the camera used to create the photo.
1505 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1506 "isoSpeed": 42, # The ISO speed used to create the photo.
1507 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1508 "exposureMode": "A String", # The exposure mode used to create the photo.
1509 "colorSpace": "A String", # The color space of the photo.
1510 "location": { # Geographic location information stored in the image.
1511 "latitude": 3.14, # The latitude stored in the image.
1512 "altitude": 3.14, # The altitude stored in the image.
1513 "longitude": 3.14, # The longitude stored in the image.
1514 },
1515 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1516 "height": 42, # The height of the image in pixels.
1517 "lens": "A String", # The lens used to create the photo.
1518 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1519 "width": 42, # The width of the image in pixels.
1520 "meteringMode": "A String", # The metering mode used to create the photo.
1521 "flashUsed": True or False, # Whether a flash was used to create the photo.
1522 "aperture": 3.14, # The aperture used to create the photo (f-number).
1523 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1524 "sensor": "A String", # The type of sensor used to create the photo.
1525 "whiteBalance": "A String", # The white balance mode used to create the photo.
1526 "cameraModel": "A String", # The model of the camera used to create the photo.
1527 },
1528 "description": "A String", # A short description of the file.
1529 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001530 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1531 "width": 42, # The width of the video in pixels.
1532 "durationMillis": "A String", # The duration of the video in milliseconds.
1533 "height": 42, # The height of the video in pixels.
1534 },
John Asmuth614db982014-04-24 15:46:26 -04001535 "editable": True or False, # Whether the file can be edited by the current user.
1536 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001537 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04001538 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001539 "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 -07001540 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001541 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001542 { # A key-value pair attached to a file that is either public or private to an application.
1543 # The following limits apply to file properties:
1544 # - Maximum of 100 properties total per file
1545 # - Maximum of 30 private properties per app
1546 # - Maximum of 30 public properties
1547 # - 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 -04001548 "kind": "drive#property", # This is always drive#property.
1549 "value": "A String", # The value of this property.
1550 "etag": "A String", # ETag of the property.
1551 "visibility": "A String", # The visibility of this property.
1552 "key": "A String", # The key of this property.
1553 "selfLink": "A String", # The link back to this property.
1554 },
1555 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001556 "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 -04001557 "iconLink": "A String", # A link to the file's icon.
1558 "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.
1559 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001560 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001561 "title": "A String", # The title of this file.
1562 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001563 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
Takashi Matsuo06694102015-09-11 13:55:40 -07001564 "mimeType": "A String", # The MIME type of the thumbnail.
1565 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
1566 },
1567 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04001568 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1569 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001570 "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 -04001571 "name": "A String", # The name for this permission.
1572 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001573 "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 is anyone, in which case both id and value are ignored.
1574 "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 is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04001575 "authKey": "A String", # The authkey parameter required for this permission.
1576 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001577 "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 -07001578 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04001579 "role": "A String", # The primary role for this user. Allowed values are:
1580 # - owner
1581 # - reader
1582 # - writer
1583 "type": "A String", # The account type. Allowed values are:
1584 # - user
1585 # - group
1586 # - domain
1587 # - anyone
1588 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1589 "A String",
1590 ],
1591 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001592 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04001593 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001594 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001595 "A String",
1596 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001597 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001598 "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 -07001599 "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.
1600 "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 -04001601 "selfLink": "A String", # A link back to this file.
1602 "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.
1603 },
1604 ],
1605 "nextLink": "A String", # A link to the next page of files.
1606 "etag": "A String", # The ETag of the list.
1607 "selfLink": "A String", # A link back to this list.
1608 }</pre>
1609</div>
1610
1611<div class="method">
1612 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1613 <pre>Retrieves the next page of results.
1614
1615Args:
1616 previous_request: The request for the previous page. (required)
1617 previous_response: The response from the request for the previous page. (required)
1618
1619Returns:
1620 A request object that you can call 'execute()' on to request the next
1621 page. Returns None if there are no more items in the collection.
1622 </pre>
1623</div>
1624
1625<div class="method">
Takashi Matsuo06694102015-09-11 13:55:40 -07001626 <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 -04001627 <pre>Updates file metadata and/or content. This method supports patch semantics.
1628
1629Args:
1630 fileId: string, The ID of the file to update. (required)
1631 body: object, The request body. (required)
1632 The object takes the form of:
1633
1634{ # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001635 "hasThumbnail": True or False, # Whether this file has a thumbnail.
John Asmuth614db982014-04-24 15:46:26 -04001636 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001637 "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.
1638 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001639 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
John Asmuth614db982014-04-24 15:46:26 -04001640 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001641 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001642 "modified": True or False, # Whether the file has been modified by this user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001643 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001644 "hidden": True or False, # Deprecated.
1645 "starred": True or False, # Whether this file is starred by the user.
1646 "viewed": True or False, # Whether this file has been viewed by this user.
John Asmuth614db982014-04-24 15:46:26 -04001647 },
1648 "indexableText": { # Indexable text attributes for the file (can only be written)
1649 "text": "A String", # The text to be indexed for this file.
1650 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001651 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Takashi Matsuo06694102015-09-11 13:55:40 -07001652 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001653 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04001654 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1655 "writersCanShare": True or False, # Whether writers can share the document with other users.
1656 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001657 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04001658 "picture": { # The user's profile picture.
1659 "url": "A String", # A URL that points to a profile picture of this user.
1660 },
1661 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001662 "displayName": "A String", # A plain text displayable name for this user.
1663 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001664 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1665 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001666 },
1667 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001668 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04001669 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001670 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001671 "picture": { # The user's profile picture.
1672 "url": "A String", # A URL that points to a profile picture of this user.
1673 },
1674 "kind": "drive#user", # This is always drive#user.
1675 "displayName": "A String", # A plain text displayable name for this user.
1676 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1677 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1678 "emailAddress": "A String", # The email address of the user.
1679 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001680 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001681 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04001682 "picture": { # The user's profile picture.
1683 "url": "A String", # A URL that points to a profile picture of this user.
1684 },
1685 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001686 "displayName": "A String", # A plain text displayable name for this user.
1687 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001688 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1689 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001690 },
1691 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001692 "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 -07001693 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04001694 "ownerNames": [ # Name(s) of the owner(s) of this file.
1695 "A String",
1696 ],
1697 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1698 "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.
1699 "etag": "A String", # ETag of the file.
1700 "parents": [ # Collection of parent folders which contain this file.
1701 # 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.
1702 { # A reference to a file's parent.
1703 "selfLink": "A String", # A link back to this reference.
1704 "kind": "drive#parentReference", # This is always drive#parentReference.
1705 "id": "A String", # The ID of the parent.
1706 "isRoot": True or False, # Whether or not the parent is the root folder.
1707 "parentLink": "A String", # A link to the parent.
1708 },
1709 ],
1710 "exportLinks": { # Links for exporting Google Docs to specific formats.
1711 "a_key": "A String", # A mapping from export format to URL
1712 },
1713 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001714 "permissions": [ # The list of permissions for users with access to this file.
1715 { # A permission for a file.
1716 "withLink": True or False, # Whether the link is required for this permission.
1717 "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.
1718 "name": "A String", # The name for this permission.
1719 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001720 "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 is anyone, in which case both id and value are ignored.
1721 "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 is anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07001722 "authKey": "A String", # The authkey parameter required for this permission.
1723 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001724 "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 -07001725 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07001726 "role": "A String", # The primary role for this user. Allowed values are:
1727 # - owner
1728 # - reader
1729 # - writer
1730 "type": "A String", # The account type. Allowed values are:
1731 # - user
1732 # - group
1733 # - domain
1734 # - anyone
1735 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1736 "A String",
1737 ],
1738 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001739 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001740 },
1741 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001742 "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 -04001743 "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.
1744 "a_key": "A String",
1745 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001746 "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 -04001747 "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.
1748 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1749 "exposureTime": 3.14, # The length of the exposure, in seconds.
1750 "cameraMake": "A String", # The make of the camera used to create the photo.
1751 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1752 "isoSpeed": 42, # The ISO speed used to create the photo.
1753 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1754 "exposureMode": "A String", # The exposure mode used to create the photo.
1755 "colorSpace": "A String", # The color space of the photo.
1756 "location": { # Geographic location information stored in the image.
1757 "latitude": 3.14, # The latitude stored in the image.
1758 "altitude": 3.14, # The altitude stored in the image.
1759 "longitude": 3.14, # The longitude stored in the image.
1760 },
1761 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1762 "height": 42, # The height of the image in pixels.
1763 "lens": "A String", # The lens used to create the photo.
1764 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
1765 "width": 42, # The width of the image in pixels.
1766 "meteringMode": "A String", # The metering mode used to create the photo.
1767 "flashUsed": True or False, # Whether a flash was used to create the photo.
1768 "aperture": 3.14, # The aperture used to create the photo (f-number).
1769 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1770 "sensor": "A String", # The type of sensor used to create the photo.
1771 "whiteBalance": "A String", # The white balance mode used to create the photo.
1772 "cameraModel": "A String", # The model of the camera used to create the photo.
1773 },
1774 "description": "A String", # A short description of the file.
1775 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001776 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
1777 "width": 42, # The width of the video in pixels.
1778 "durationMillis": "A String", # The duration of the video in milliseconds.
1779 "height": 42, # The height of the video in pixels.
1780 },
John Asmuth614db982014-04-24 15:46:26 -04001781 "editable": True or False, # Whether the file can be edited by the current user.
1782 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001783 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04001784 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001785 "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 -07001786 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04001787 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001788 { # A key-value pair attached to a file that is either public or private to an application.
1789 # The following limits apply to file properties:
1790 # - Maximum of 100 properties total per file
1791 # - Maximum of 30 private properties per app
1792 # - Maximum of 30 public properties
1793 # - 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 -04001794 "kind": "drive#property", # This is always drive#property.
1795 "value": "A String", # The value of this property.
1796 "etag": "A String", # ETag of the property.
1797 "visibility": "A String", # The visibility of this property.
1798 "key": "A String", # The key of this property.
1799 "selfLink": "A String", # The link back to this property.
1800 },
1801 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001802 "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 -04001803 "iconLink": "A String", # A link to the file's icon.
1804 "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.
1805 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001806 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04001807 "title": "A String", # The title of this file.
1808 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001809 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
Takashi Matsuo06694102015-09-11 13:55:40 -07001810 "mimeType": "A String", # The MIME type of the thumbnail.
1811 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
1812 },
1813 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04001814 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
1815 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07001816 "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 -04001817 "name": "A String", # The name for this permission.
1818 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001819 "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 is anyone, in which case both id and value are ignored.
1820 "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 is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04001821 "authKey": "A String", # The authkey parameter required for this permission.
1822 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001823 "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 -07001824 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04001825 "role": "A String", # The primary role for this user. Allowed values are:
1826 # - owner
1827 # - reader
1828 # - writer
1829 "type": "A String", # The account type. Allowed values are:
1830 # - user
1831 # - group
1832 # - domain
1833 # - anyone
1834 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1835 "A String",
1836 ],
1837 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001838 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04001839 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001840 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001841 "A String",
1842 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001843 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001844 "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 -07001845 "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.
1846 "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 -04001847 "selfLink": "A String", # A link back to this file.
1848 "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.
1849}
1850
Takashi Matsuo06694102015-09-11 13:55:40 -07001851 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.
1852 modifiedDateBehavior: string, Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.
1853 Allowed values
1854 fromBody - Set modifiedDate to the value provided in the body of the request. No change if no value was provided.
1855 fromBodyIfNeeded - Set modifiedDate to the value provided in the body of the request depending on other contents of the update.
1856 fromBodyOrNow - Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.
1857 noChange - Maintain the previous value of modifiedDate.
1858 now - Set modifiedDate to the current time.
1859 nowIfNeeded - Set modifiedDate to the current time depending on contents of the update.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001860 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 +00001861 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 -04001862 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Craig Citro065b5302014-08-14 00:47:23 -07001863 addParents: string, Comma-separated list of parent IDs to add.
1864 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04001865 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
1866 timedTextTrackName: string, The timed text track name.
Takashi Matsuo06694102015-09-11 13:55:40 -07001867 convert: boolean, This parameter is deprecated and has no function.
John Asmuth614db982014-04-24 15:46:26 -04001868 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
1869 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
1870 timedTextLanguage: string, The language of the timed text.
1871
1872Returns:
1873 An object of the form:
1874
1875 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001876 "hasThumbnail": True or False, # Whether this file has a thumbnail.
John Asmuth614db982014-04-24 15:46:26 -04001877 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07001878 "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.
1879 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001880 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
John Asmuth614db982014-04-24 15:46:26 -04001881 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07001882 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001883 "modified": True or False, # Whether the file has been modified by this user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001884 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001885 "hidden": True or False, # Deprecated.
1886 "starred": True or False, # Whether this file is starred by the user.
1887 "viewed": True or False, # Whether this file has been viewed by this user.
John Asmuth614db982014-04-24 15:46:26 -04001888 },
1889 "indexableText": { # Indexable text attributes for the file (can only be written)
1890 "text": "A String", # The text to be indexed for this file.
1891 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001892 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Takashi Matsuo06694102015-09-11 13:55:40 -07001893 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001894 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04001895 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
1896 "writersCanShare": True or False, # Whether writers can share the document with other users.
1897 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001898 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04001899 "picture": { # The user's profile picture.
1900 "url": "A String", # A URL that points to a profile picture of this user.
1901 },
1902 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001903 "displayName": "A String", # A plain text displayable name for this user.
1904 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001905 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1906 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001907 },
1908 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001909 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04001910 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001911 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001912 "picture": { # The user's profile picture.
1913 "url": "A String", # A URL that points to a profile picture of this user.
1914 },
1915 "kind": "drive#user", # This is always drive#user.
1916 "displayName": "A String", # A plain text displayable name for this user.
1917 "permissionId": "A String", # The user's ID as visible in the permissions collection.
1918 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1919 "emailAddress": "A String", # The email address of the user.
1920 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001921 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001922 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04001923 "picture": { # The user's profile picture.
1924 "url": "A String", # A URL that points to a profile picture of this user.
1925 },
1926 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04001927 "displayName": "A String", # A plain text displayable name for this user.
1928 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07001929 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
1930 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04001931 },
1932 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08001933 "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 -07001934 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04001935 "ownerNames": [ # Name(s) of the owner(s) of this file.
1936 "A String",
1937 ],
1938 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
1939 "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.
1940 "etag": "A String", # ETag of the file.
1941 "parents": [ # Collection of parent folders which contain this file.
1942 # 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.
1943 { # A reference to a file's parent.
1944 "selfLink": "A String", # A link back to this reference.
1945 "kind": "drive#parentReference", # This is always drive#parentReference.
1946 "id": "A String", # The ID of the parent.
1947 "isRoot": True or False, # Whether or not the parent is the root folder.
1948 "parentLink": "A String", # A link to the parent.
1949 },
1950 ],
1951 "exportLinks": { # Links for exporting Google Docs to specific formats.
1952 "a_key": "A String", # A mapping from export format to URL
1953 },
1954 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07001955 "permissions": [ # The list of permissions for users with access to this file.
1956 { # A permission for a file.
1957 "withLink": True or False, # Whether the link is required for this permission.
1958 "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.
1959 "name": "A String", # The name for this permission.
1960 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001961 "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 is anyone, in which case both id and value are ignored.
1962 "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 is anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07001963 "authKey": "A String", # The authkey parameter required for this permission.
1964 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08001965 "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 -07001966 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07001967 "role": "A String", # The primary role for this user. Allowed values are:
1968 # - owner
1969 # - reader
1970 # - writer
1971 "type": "A String", # The account type. Allowed values are:
1972 # - user
1973 # - group
1974 # - domain
1975 # - anyone
1976 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
1977 "A String",
1978 ],
1979 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001980 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07001981 },
1982 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07001983 "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 -04001984 "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.
1985 "a_key": "A String",
1986 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001987 "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 -04001988 "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.
1989 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1990 "exposureTime": 3.14, # The length of the exposure, in seconds.
1991 "cameraMake": "A String", # The make of the camera used to create the photo.
1992 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1993 "isoSpeed": 42, # The ISO speed used to create the photo.
1994 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1995 "exposureMode": "A String", # The exposure mode used to create the photo.
1996 "colorSpace": "A String", # The color space of the photo.
1997 "location": { # Geographic location information stored in the image.
1998 "latitude": 3.14, # The latitude stored in the image.
1999 "altitude": 3.14, # The altitude stored in the image.
2000 "longitude": 3.14, # The longitude stored in the image.
2001 },
2002 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2003 "height": 42, # The height of the image in pixels.
2004 "lens": "A String", # The lens used to create the photo.
2005 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2006 "width": 42, # The width of the image in pixels.
2007 "meteringMode": "A String", # The metering mode used to create the photo.
2008 "flashUsed": True or False, # Whether a flash was used to create the photo.
2009 "aperture": 3.14, # The aperture used to create the photo (f-number).
2010 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2011 "sensor": "A String", # The type of sensor used to create the photo.
2012 "whiteBalance": "A String", # The white balance mode used to create the photo.
2013 "cameraModel": "A String", # The model of the camera used to create the photo.
2014 },
2015 "description": "A String", # A short description of the file.
2016 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002017 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2018 "width": 42, # The width of the video in pixels.
2019 "durationMillis": "A String", # The duration of the video in milliseconds.
2020 "height": 42, # The height of the video in pixels.
2021 },
John Asmuth614db982014-04-24 15:46:26 -04002022 "editable": True or False, # Whether the file can be edited by the current user.
2023 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002024 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002025 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002026 "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 -07002027 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002028 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002029 { # A key-value pair attached to a file that is either public or private to an application.
2030 # The following limits apply to file properties:
2031 # - Maximum of 100 properties total per file
2032 # - Maximum of 30 private properties per app
2033 # - Maximum of 30 public properties
2034 # - 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 -04002035 "kind": "drive#property", # This is always drive#property.
2036 "value": "A String", # The value of this property.
2037 "etag": "A String", # ETag of the property.
2038 "visibility": "A String", # The visibility of this property.
2039 "key": "A String", # The key of this property.
2040 "selfLink": "A String", # The link back to this property.
2041 },
2042 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002043 "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 -04002044 "iconLink": "A String", # A link to the file's icon.
2045 "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.
2046 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002047 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002048 "title": "A String", # The title of this file.
2049 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002050 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
Takashi Matsuo06694102015-09-11 13:55:40 -07002051 "mimeType": "A String", # The MIME type of the thumbnail.
2052 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2053 },
2054 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002055 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2056 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002057 "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 -04002058 "name": "A String", # The name for this permission.
2059 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002060 "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 is anyone, in which case both id and value are ignored.
2061 "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 is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04002062 "authKey": "A String", # The authkey parameter required for this permission.
2063 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002064 "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 -07002065 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04002066 "role": "A String", # The primary role for this user. Allowed values are:
2067 # - owner
2068 # - reader
2069 # - writer
2070 "type": "A String", # The account type. Allowed values are:
2071 # - user
2072 # - group
2073 # - domain
2074 # - anyone
2075 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2076 "A String",
2077 ],
2078 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002079 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04002080 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002081 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002082 "A String",
2083 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002084 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002085 "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 -07002086 "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.
2087 "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 -04002088 "selfLink": "A String", # A link back to this file.
2089 "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.
2090 }</pre>
2091</div>
2092
2093<div class="method">
2094 <code class="details" id="touch">touch(fileId)</code>
2095 <pre>Set the file's updated time to the current server time.
2096
2097Args:
2098 fileId: string, The ID of the file to update. (required)
2099
2100Returns:
2101 An object of the form:
2102
2103 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002104 "hasThumbnail": True or False, # Whether this file has a thumbnail.
John Asmuth614db982014-04-24 15:46:26 -04002105 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002106 "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.
2107 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002108 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
John Asmuth614db982014-04-24 15:46:26 -04002109 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002110 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002111 "modified": True or False, # Whether the file has been modified by this user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002112 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002113 "hidden": True or False, # Deprecated.
2114 "starred": True or False, # Whether this file is starred by the user.
2115 "viewed": True or False, # Whether this file has been viewed by this user.
John Asmuth614db982014-04-24 15:46:26 -04002116 },
2117 "indexableText": { # Indexable text attributes for the file (can only be written)
2118 "text": "A String", # The text to be indexed for this file.
2119 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002120 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Takashi Matsuo06694102015-09-11 13:55:40 -07002121 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002122 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04002123 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2124 "writersCanShare": True or False, # Whether writers can share the document with other users.
2125 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002126 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04002127 "picture": { # The user's profile picture.
2128 "url": "A String", # A URL that points to a profile picture of this user.
2129 },
2130 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002131 "displayName": "A String", # A plain text displayable name for this user.
2132 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002133 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2134 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002135 },
2136 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002137 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04002138 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002139 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002140 "picture": { # The user's profile picture.
2141 "url": "A String", # A URL that points to a profile picture of this user.
2142 },
2143 "kind": "drive#user", # This is always drive#user.
2144 "displayName": "A String", # A plain text displayable name for this user.
2145 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2146 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2147 "emailAddress": "A String", # The email address of the user.
2148 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002149 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002150 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04002151 "picture": { # The user's profile picture.
2152 "url": "A String", # A URL that points to a profile picture of this user.
2153 },
2154 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002155 "displayName": "A String", # A plain text displayable name for this user.
2156 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002157 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2158 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002159 },
2160 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002161 "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 -07002162 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04002163 "ownerNames": [ # Name(s) of the owner(s) of this file.
2164 "A String",
2165 ],
2166 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2167 "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.
2168 "etag": "A String", # ETag of the file.
2169 "parents": [ # Collection of parent folders which contain this file.
2170 # 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.
2171 { # A reference to a file's parent.
2172 "selfLink": "A String", # A link back to this reference.
2173 "kind": "drive#parentReference", # This is always drive#parentReference.
2174 "id": "A String", # The ID of the parent.
2175 "isRoot": True or False, # Whether or not the parent is the root folder.
2176 "parentLink": "A String", # A link to the parent.
2177 },
2178 ],
2179 "exportLinks": { # Links for exporting Google Docs to specific formats.
2180 "a_key": "A String", # A mapping from export format to URL
2181 },
2182 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002183 "permissions": [ # The list of permissions for users with access to this file.
2184 { # A permission for a file.
2185 "withLink": True or False, # Whether the link is required for this permission.
2186 "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.
2187 "name": "A String", # The name for this permission.
2188 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002189 "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 is anyone, in which case both id and value are ignored.
2190 "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 is anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07002191 "authKey": "A String", # The authkey parameter required for this permission.
2192 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002193 "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 -07002194 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07002195 "role": "A String", # The primary role for this user. Allowed values are:
2196 # - owner
2197 # - reader
2198 # - writer
2199 "type": "A String", # The account type. Allowed values are:
2200 # - user
2201 # - group
2202 # - domain
2203 # - anyone
2204 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2205 "A String",
2206 ],
2207 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002208 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002209 },
2210 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002211 "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 -04002212 "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.
2213 "a_key": "A String",
2214 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002215 "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 -04002216 "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.
2217 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2218 "exposureTime": 3.14, # The length of the exposure, in seconds.
2219 "cameraMake": "A String", # The make of the camera used to create the photo.
2220 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2221 "isoSpeed": 42, # The ISO speed used to create the photo.
2222 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2223 "exposureMode": "A String", # The exposure mode used to create the photo.
2224 "colorSpace": "A String", # The color space of the photo.
2225 "location": { # Geographic location information stored in the image.
2226 "latitude": 3.14, # The latitude stored in the image.
2227 "altitude": 3.14, # The altitude stored in the image.
2228 "longitude": 3.14, # The longitude stored in the image.
2229 },
2230 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2231 "height": 42, # The height of the image in pixels.
2232 "lens": "A String", # The lens used to create the photo.
2233 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2234 "width": 42, # The width of the image in pixels.
2235 "meteringMode": "A String", # The metering mode used to create the photo.
2236 "flashUsed": True or False, # Whether a flash was used to create the photo.
2237 "aperture": 3.14, # The aperture used to create the photo (f-number).
2238 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2239 "sensor": "A String", # The type of sensor used to create the photo.
2240 "whiteBalance": "A String", # The white balance mode used to create the photo.
2241 "cameraModel": "A String", # The model of the camera used to create the photo.
2242 },
2243 "description": "A String", # A short description of the file.
2244 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002245 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2246 "width": 42, # The width of the video in pixels.
2247 "durationMillis": "A String", # The duration of the video in milliseconds.
2248 "height": 42, # The height of the video in pixels.
2249 },
John Asmuth614db982014-04-24 15:46:26 -04002250 "editable": True or False, # Whether the file can be edited by the current user.
2251 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002252 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002253 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002254 "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 -07002255 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002256 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002257 { # A key-value pair attached to a file that is either public or private to an application.
2258 # The following limits apply to file properties:
2259 # - Maximum of 100 properties total per file
2260 # - Maximum of 30 private properties per app
2261 # - Maximum of 30 public properties
2262 # - 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 -04002263 "kind": "drive#property", # This is always drive#property.
2264 "value": "A String", # The value of this property.
2265 "etag": "A String", # ETag of the property.
2266 "visibility": "A String", # The visibility of this property.
2267 "key": "A String", # The key of this property.
2268 "selfLink": "A String", # The link back to this property.
2269 },
2270 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002271 "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 -04002272 "iconLink": "A String", # A link to the file's icon.
2273 "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.
2274 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002275 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002276 "title": "A String", # The title of this file.
2277 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002278 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
Takashi Matsuo06694102015-09-11 13:55:40 -07002279 "mimeType": "A String", # The MIME type of the thumbnail.
2280 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2281 },
2282 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002283 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2284 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002285 "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 -04002286 "name": "A String", # The name for this permission.
2287 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002288 "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 is anyone, in which case both id and value are ignored.
2289 "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 is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04002290 "authKey": "A String", # The authkey parameter required for this permission.
2291 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002292 "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 -07002293 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04002294 "role": "A String", # The primary role for this user. Allowed values are:
2295 # - owner
2296 # - reader
2297 # - writer
2298 "type": "A String", # The account type. Allowed values are:
2299 # - user
2300 # - group
2301 # - domain
2302 # - anyone
2303 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2304 "A String",
2305 ],
2306 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002307 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04002308 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002309 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002310 "A String",
2311 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002312 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002313 "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 -07002314 "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.
2315 "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 -04002316 "selfLink": "A String", # A link back to this file.
2317 "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.
2318 }</pre>
2319</div>
2320
2321<div class="method">
2322 <code class="details" id="trash">trash(fileId)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -07002323 <pre>Moves a file to the trash. The currently authenticated user must own the file.
John Asmuth614db982014-04-24 15:46:26 -04002324
2325Args:
2326 fileId: string, The ID of the file to trash. (required)
2327
2328Returns:
2329 An object of the form:
2330
2331 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002332 "hasThumbnail": True or False, # Whether this file has a thumbnail.
John Asmuth614db982014-04-24 15:46:26 -04002333 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002334 "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.
2335 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002336 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
John Asmuth614db982014-04-24 15:46:26 -04002337 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002338 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002339 "modified": True or False, # Whether the file has been modified by this user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002340 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002341 "hidden": True or False, # Deprecated.
2342 "starred": True or False, # Whether this file is starred by the user.
2343 "viewed": True or False, # Whether this file has been viewed by this user.
John Asmuth614db982014-04-24 15:46:26 -04002344 },
2345 "indexableText": { # Indexable text attributes for the file (can only be written)
2346 "text": "A String", # The text to be indexed for this file.
2347 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002348 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Takashi Matsuo06694102015-09-11 13:55:40 -07002349 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002350 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04002351 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2352 "writersCanShare": True or False, # Whether writers can share the document with other users.
2353 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002354 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04002355 "picture": { # The user's profile picture.
2356 "url": "A String", # A URL that points to a profile picture of this user.
2357 },
2358 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002359 "displayName": "A String", # A plain text displayable name for this user.
2360 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002361 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2362 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002363 },
2364 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002365 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04002366 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002367 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002368 "picture": { # The user's profile picture.
2369 "url": "A String", # A URL that points to a profile picture of this user.
2370 },
2371 "kind": "drive#user", # This is always drive#user.
2372 "displayName": "A String", # A plain text displayable name for this user.
2373 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2374 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2375 "emailAddress": "A String", # The email address of the user.
2376 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002377 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002378 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04002379 "picture": { # The user's profile picture.
2380 "url": "A String", # A URL that points to a profile picture of this user.
2381 },
2382 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002383 "displayName": "A String", # A plain text displayable name for this user.
2384 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002385 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2386 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002387 },
2388 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002389 "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 -07002390 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04002391 "ownerNames": [ # Name(s) of the owner(s) of this file.
2392 "A String",
2393 ],
2394 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2395 "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.
2396 "etag": "A String", # ETag of the file.
2397 "parents": [ # Collection of parent folders which contain this file.
2398 # 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.
2399 { # A reference to a file's parent.
2400 "selfLink": "A String", # A link back to this reference.
2401 "kind": "drive#parentReference", # This is always drive#parentReference.
2402 "id": "A String", # The ID of the parent.
2403 "isRoot": True or False, # Whether or not the parent is the root folder.
2404 "parentLink": "A String", # A link to the parent.
2405 },
2406 ],
2407 "exportLinks": { # Links for exporting Google Docs to specific formats.
2408 "a_key": "A String", # A mapping from export format to URL
2409 },
2410 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002411 "permissions": [ # The list of permissions for users with access to this file.
2412 { # A permission for a file.
2413 "withLink": True or False, # Whether the link is required for this permission.
2414 "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.
2415 "name": "A String", # The name for this permission.
2416 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002417 "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 is anyone, in which case both id and value are ignored.
2418 "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 is anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07002419 "authKey": "A String", # The authkey parameter required for this permission.
2420 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002421 "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 -07002422 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07002423 "role": "A String", # The primary role for this user. Allowed values are:
2424 # - owner
2425 # - reader
2426 # - writer
2427 "type": "A String", # The account type. Allowed values are:
2428 # - user
2429 # - group
2430 # - domain
2431 # - anyone
2432 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2433 "A String",
2434 ],
2435 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002436 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002437 },
2438 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002439 "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 -04002440 "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.
2441 "a_key": "A String",
2442 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002443 "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 -04002444 "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.
2445 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2446 "exposureTime": 3.14, # The length of the exposure, in seconds.
2447 "cameraMake": "A String", # The make of the camera used to create the photo.
2448 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2449 "isoSpeed": 42, # The ISO speed used to create the photo.
2450 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2451 "exposureMode": "A String", # The exposure mode used to create the photo.
2452 "colorSpace": "A String", # The color space of the photo.
2453 "location": { # Geographic location information stored in the image.
2454 "latitude": 3.14, # The latitude stored in the image.
2455 "altitude": 3.14, # The altitude stored in the image.
2456 "longitude": 3.14, # The longitude stored in the image.
2457 },
2458 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2459 "height": 42, # The height of the image in pixels.
2460 "lens": "A String", # The lens used to create the photo.
2461 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2462 "width": 42, # The width of the image in pixels.
2463 "meteringMode": "A String", # The metering mode used to create the photo.
2464 "flashUsed": True or False, # Whether a flash was used to create the photo.
2465 "aperture": 3.14, # The aperture used to create the photo (f-number).
2466 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2467 "sensor": "A String", # The type of sensor used to create the photo.
2468 "whiteBalance": "A String", # The white balance mode used to create the photo.
2469 "cameraModel": "A String", # The model of the camera used to create the photo.
2470 },
2471 "description": "A String", # A short description of the file.
2472 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002473 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2474 "width": 42, # The width of the video in pixels.
2475 "durationMillis": "A String", # The duration of the video in milliseconds.
2476 "height": 42, # The height of the video in pixels.
2477 },
John Asmuth614db982014-04-24 15:46:26 -04002478 "editable": True or False, # Whether the file can be edited by the current user.
2479 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002480 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002481 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002482 "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 -07002483 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002484 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002485 { # A key-value pair attached to a file that is either public or private to an application.
2486 # The following limits apply to file properties:
2487 # - Maximum of 100 properties total per file
2488 # - Maximum of 30 private properties per app
2489 # - Maximum of 30 public properties
2490 # - 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 -04002491 "kind": "drive#property", # This is always drive#property.
2492 "value": "A String", # The value of this property.
2493 "etag": "A String", # ETag of the property.
2494 "visibility": "A String", # The visibility of this property.
2495 "key": "A String", # The key of this property.
2496 "selfLink": "A String", # The link back to this property.
2497 },
2498 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002499 "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 -04002500 "iconLink": "A String", # A link to the file's icon.
2501 "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.
2502 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002503 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002504 "title": "A String", # The title of this file.
2505 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002506 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
Takashi Matsuo06694102015-09-11 13:55:40 -07002507 "mimeType": "A String", # The MIME type of the thumbnail.
2508 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2509 },
2510 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002511 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2512 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002513 "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 -04002514 "name": "A String", # The name for this permission.
2515 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002516 "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 is anyone, in which case both id and value are ignored.
2517 "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 is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04002518 "authKey": "A String", # The authkey parameter required for this permission.
2519 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002520 "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 -07002521 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04002522 "role": "A String", # The primary role for this user. Allowed values are:
2523 # - owner
2524 # - reader
2525 # - writer
2526 "type": "A String", # The account type. Allowed values are:
2527 # - user
2528 # - group
2529 # - domain
2530 # - anyone
2531 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2532 "A String",
2533 ],
2534 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002535 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04002536 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002537 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002538 "A String",
2539 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002540 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002541 "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 -07002542 "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.
2543 "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 -04002544 "selfLink": "A String", # A link back to this file.
2545 "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.
2546 }</pre>
2547</div>
2548
2549<div class="method">
2550 <code class="details" id="untrash">untrash(fileId)</code>
2551 <pre>Restores a file from the trash.
2552
2553Args:
2554 fileId: string, The ID of the file to untrash. (required)
2555
2556Returns:
2557 An object of the form:
2558
2559 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002560 "hasThumbnail": True or False, # Whether this file has a thumbnail.
John Asmuth614db982014-04-24 15:46:26 -04002561 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002562 "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.
2563 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002564 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
John Asmuth614db982014-04-24 15:46:26 -04002565 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002566 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002567 "modified": True or False, # Whether the file has been modified by this user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002568 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002569 "hidden": True or False, # Deprecated.
2570 "starred": True or False, # Whether this file is starred by the user.
2571 "viewed": True or False, # Whether this file has been viewed by this user.
John Asmuth614db982014-04-24 15:46:26 -04002572 },
2573 "indexableText": { # Indexable text attributes for the file (can only be written)
2574 "text": "A String", # The text to be indexed for this file.
2575 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002576 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Takashi Matsuo06694102015-09-11 13:55:40 -07002577 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002578 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04002579 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2580 "writersCanShare": True or False, # Whether writers can share the document with other users.
2581 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002582 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04002583 "picture": { # The user's profile picture.
2584 "url": "A String", # A URL that points to a profile picture of this user.
2585 },
2586 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002587 "displayName": "A String", # A plain text displayable name for this user.
2588 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002589 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2590 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002591 },
2592 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002593 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04002594 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002595 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002596 "picture": { # The user's profile picture.
2597 "url": "A String", # A URL that points to a profile picture of this user.
2598 },
2599 "kind": "drive#user", # This is always drive#user.
2600 "displayName": "A String", # A plain text displayable name for this user.
2601 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2602 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2603 "emailAddress": "A String", # The email address of the user.
2604 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002605 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002606 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04002607 "picture": { # The user's profile picture.
2608 "url": "A String", # A URL that points to a profile picture of this user.
2609 },
2610 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002611 "displayName": "A String", # A plain text displayable name for this user.
2612 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002613 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2614 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002615 },
2616 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002617 "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 -07002618 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04002619 "ownerNames": [ # Name(s) of the owner(s) of this file.
2620 "A String",
2621 ],
2622 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2623 "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.
2624 "etag": "A String", # ETag of the file.
2625 "parents": [ # Collection of parent folders which contain this file.
2626 # 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.
2627 { # A reference to a file's parent.
2628 "selfLink": "A String", # A link back to this reference.
2629 "kind": "drive#parentReference", # This is always drive#parentReference.
2630 "id": "A String", # The ID of the parent.
2631 "isRoot": True or False, # Whether or not the parent is the root folder.
2632 "parentLink": "A String", # A link to the parent.
2633 },
2634 ],
2635 "exportLinks": { # Links for exporting Google Docs to specific formats.
2636 "a_key": "A String", # A mapping from export format to URL
2637 },
2638 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002639 "permissions": [ # The list of permissions for users with access to this file.
2640 { # A permission for a file.
2641 "withLink": True or False, # Whether the link is required for this permission.
2642 "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.
2643 "name": "A String", # The name for this permission.
2644 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002645 "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 is anyone, in which case both id and value are ignored.
2646 "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 is anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07002647 "authKey": "A String", # The authkey parameter required for this permission.
2648 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002649 "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 -07002650 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07002651 "role": "A String", # The primary role for this user. Allowed values are:
2652 # - owner
2653 # - reader
2654 # - writer
2655 "type": "A String", # The account type. Allowed values are:
2656 # - user
2657 # - group
2658 # - domain
2659 # - anyone
2660 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2661 "A String",
2662 ],
2663 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002664 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002665 },
2666 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002667 "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 -04002668 "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.
2669 "a_key": "A String",
2670 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002671 "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 -04002672 "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.
2673 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2674 "exposureTime": 3.14, # The length of the exposure, in seconds.
2675 "cameraMake": "A String", # The make of the camera used to create the photo.
2676 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2677 "isoSpeed": 42, # The ISO speed used to create the photo.
2678 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2679 "exposureMode": "A String", # The exposure mode used to create the photo.
2680 "colorSpace": "A String", # The color space of the photo.
2681 "location": { # Geographic location information stored in the image.
2682 "latitude": 3.14, # The latitude stored in the image.
2683 "altitude": 3.14, # The altitude stored in the image.
2684 "longitude": 3.14, # The longitude stored in the image.
2685 },
2686 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2687 "height": 42, # The height of the image in pixels.
2688 "lens": "A String", # The lens used to create the photo.
2689 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2690 "width": 42, # The width of the image in pixels.
2691 "meteringMode": "A String", # The metering mode used to create the photo.
2692 "flashUsed": True or False, # Whether a flash was used to create the photo.
2693 "aperture": 3.14, # The aperture used to create the photo (f-number).
2694 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2695 "sensor": "A String", # The type of sensor used to create the photo.
2696 "whiteBalance": "A String", # The white balance mode used to create the photo.
2697 "cameraModel": "A String", # The model of the camera used to create the photo.
2698 },
2699 "description": "A String", # A short description of the file.
2700 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002701 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2702 "width": 42, # The width of the video in pixels.
2703 "durationMillis": "A String", # The duration of the video in milliseconds.
2704 "height": 42, # The height of the video in pixels.
2705 },
John Asmuth614db982014-04-24 15:46:26 -04002706 "editable": True or False, # Whether the file can be edited by the current user.
2707 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002708 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002709 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002710 "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 -07002711 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002712 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002713 { # A key-value pair attached to a file that is either public or private to an application.
2714 # The following limits apply to file properties:
2715 # - Maximum of 100 properties total per file
2716 # - Maximum of 30 private properties per app
2717 # - Maximum of 30 public properties
2718 # - 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 -04002719 "kind": "drive#property", # This is always drive#property.
2720 "value": "A String", # The value of this property.
2721 "etag": "A String", # ETag of the property.
2722 "visibility": "A String", # The visibility of this property.
2723 "key": "A String", # The key of this property.
2724 "selfLink": "A String", # The link back to this property.
2725 },
2726 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002727 "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 -04002728 "iconLink": "A String", # A link to the file's icon.
2729 "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.
2730 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002731 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002732 "title": "A String", # The title of this file.
2733 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002734 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
Takashi Matsuo06694102015-09-11 13:55:40 -07002735 "mimeType": "A String", # The MIME type of the thumbnail.
2736 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2737 },
2738 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002739 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2740 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002741 "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 -04002742 "name": "A String", # The name for this permission.
2743 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002744 "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 is anyone, in which case both id and value are ignored.
2745 "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 is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04002746 "authKey": "A String", # The authkey parameter required for this permission.
2747 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002748 "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 -07002749 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04002750 "role": "A String", # The primary role for this user. Allowed values are:
2751 # - owner
2752 # - reader
2753 # - writer
2754 "type": "A String", # The account type. Allowed values are:
2755 # - user
2756 # - group
2757 # - domain
2758 # - anyone
2759 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2760 "A String",
2761 ],
2762 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002763 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04002764 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002765 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002766 "A String",
2767 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002768 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002769 "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 -07002770 "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.
2771 "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 -04002772 "selfLink": "A String", # A link back to this file.
2773 "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.
2774 }</pre>
2775</div>
2776
2777<div class="method">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002778 <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, media_mime_type=None, setModifiedDate=None, timedTextLanguage=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04002779 <pre>Updates file metadata and/or content.
2780
2781Args:
2782 fileId: string, The ID of the file to update. (required)
2783 body: object, The request body.
2784 The object takes the form of:
2785
2786{ # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002787 "hasThumbnail": True or False, # Whether this file has a thumbnail.
John Asmuth614db982014-04-24 15:46:26 -04002788 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07002789 "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.
2790 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002791 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
John Asmuth614db982014-04-24 15:46:26 -04002792 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002793 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002794 "modified": True or False, # Whether the file has been modified by this user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002795 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002796 "hidden": True or False, # Deprecated.
2797 "starred": True or False, # Whether this file is starred by the user.
2798 "viewed": True or False, # Whether this file has been viewed by this user.
John Asmuth614db982014-04-24 15:46:26 -04002799 },
2800 "indexableText": { # Indexable text attributes for the file (can only be written)
2801 "text": "A String", # The text to be indexed for this file.
2802 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002803 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Takashi Matsuo06694102015-09-11 13:55:40 -07002804 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002805 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04002806 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
2807 "writersCanShare": True or False, # Whether writers can share the document with other users.
2808 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002809 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04002810 "picture": { # The user's profile picture.
2811 "url": "A String", # A URL that points to a profile picture of this user.
2812 },
2813 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002814 "displayName": "A String", # A plain text displayable name for this user.
2815 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002816 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2817 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002818 },
2819 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002820 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04002821 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002822 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002823 "picture": { # The user's profile picture.
2824 "url": "A String", # A URL that points to a profile picture of this user.
2825 },
2826 "kind": "drive#user", # This is always drive#user.
2827 "displayName": "A String", # A plain text displayable name for this user.
2828 "permissionId": "A String", # The user's ID as visible in the permissions collection.
2829 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2830 "emailAddress": "A String", # The email address of the user.
2831 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002832 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002833 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04002834 "picture": { # The user's profile picture.
2835 "url": "A String", # A URL that points to a profile picture of this user.
2836 },
2837 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04002838 "displayName": "A String", # A plain text displayable name for this user.
2839 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07002840 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
2841 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04002842 },
2843 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08002844 "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 -07002845 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04002846 "ownerNames": [ # Name(s) of the owner(s) of this file.
2847 "A String",
2848 ],
2849 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
2850 "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.
2851 "etag": "A String", # ETag of the file.
2852 "parents": [ # Collection of parent folders which contain this file.
2853 # 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.
2854 { # A reference to a file's parent.
2855 "selfLink": "A String", # A link back to this reference.
2856 "kind": "drive#parentReference", # This is always drive#parentReference.
2857 "id": "A String", # The ID of the parent.
2858 "isRoot": True or False, # Whether or not the parent is the root folder.
2859 "parentLink": "A String", # A link to the parent.
2860 },
2861 ],
2862 "exportLinks": { # Links for exporting Google Docs to specific formats.
2863 "a_key": "A String", # A mapping from export format to URL
2864 },
2865 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07002866 "permissions": [ # The list of permissions for users with access to this file.
2867 { # A permission for a file.
2868 "withLink": True or False, # Whether the link is required for this permission.
2869 "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.
2870 "name": "A String", # The name for this permission.
2871 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002872 "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 is anyone, in which case both id and value are ignored.
2873 "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 is anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07002874 "authKey": "A String", # The authkey parameter required for this permission.
2875 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002876 "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 -07002877 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07002878 "role": "A String", # The primary role for this user. Allowed values are:
2879 # - owner
2880 # - reader
2881 # - writer
2882 "type": "A String", # The account type. Allowed values are:
2883 # - user
2884 # - group
2885 # - domain
2886 # - anyone
2887 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2888 "A String",
2889 ],
2890 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002891 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07002892 },
2893 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002894 "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 -04002895 "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.
2896 "a_key": "A String",
2897 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002898 "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 -04002899 "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.
2900 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
2901 "exposureTime": 3.14, # The length of the exposure, in seconds.
2902 "cameraMake": "A String", # The make of the camera used to create the photo.
2903 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
2904 "isoSpeed": 42, # The ISO speed used to create the photo.
2905 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
2906 "exposureMode": "A String", # The exposure mode used to create the photo.
2907 "colorSpace": "A String", # The color space of the photo.
2908 "location": { # Geographic location information stored in the image.
2909 "latitude": 3.14, # The latitude stored in the image.
2910 "altitude": 3.14, # The altitude stored in the image.
2911 "longitude": 3.14, # The longitude stored in the image.
2912 },
2913 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
2914 "height": 42, # The height of the image in pixels.
2915 "lens": "A String", # The lens used to create the photo.
2916 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
2917 "width": 42, # The width of the image in pixels.
2918 "meteringMode": "A String", # The metering mode used to create the photo.
2919 "flashUsed": True or False, # Whether a flash was used to create the photo.
2920 "aperture": 3.14, # The aperture used to create the photo (f-number).
2921 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
2922 "sensor": "A String", # The type of sensor used to create the photo.
2923 "whiteBalance": "A String", # The white balance mode used to create the photo.
2924 "cameraModel": "A String", # The model of the camera used to create the photo.
2925 },
2926 "description": "A String", # A short description of the file.
2927 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002928 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
2929 "width": 42, # The width of the video in pixels.
2930 "durationMillis": "A String", # The duration of the video in milliseconds.
2931 "height": 42, # The height of the video in pixels.
2932 },
John Asmuth614db982014-04-24 15:46:26 -04002933 "editable": True or False, # Whether the file can be edited by the current user.
2934 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002935 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04002936 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07002937 "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 -07002938 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04002939 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002940 { # A key-value pair attached to a file that is either public or private to an application.
2941 # The following limits apply to file properties:
2942 # - Maximum of 100 properties total per file
2943 # - Maximum of 30 private properties per app
2944 # - Maximum of 30 public properties
2945 # - 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 -04002946 "kind": "drive#property", # This is always drive#property.
2947 "value": "A String", # The value of this property.
2948 "etag": "A String", # ETag of the property.
2949 "visibility": "A String", # The visibility of this property.
2950 "key": "A String", # The key of this property.
2951 "selfLink": "A String", # The link back to this property.
2952 },
2953 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002954 "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 -04002955 "iconLink": "A String", # A link to the file's icon.
2956 "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.
2957 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07002958 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04002959 "title": "A String", # The title of this file.
2960 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002961 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
Takashi Matsuo06694102015-09-11 13:55:40 -07002962 "mimeType": "A String", # The MIME type of the thumbnail.
2963 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
2964 },
2965 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04002966 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
2967 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07002968 "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 -04002969 "name": "A String", # The name for this permission.
2970 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08002971 "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 is anyone, in which case both id and value are ignored.
2972 "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 is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04002973 "authKey": "A String", # The authkey parameter required for this permission.
2974 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08002975 "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 -07002976 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04002977 "role": "A String", # The primary role for this user. Allowed values are:
2978 # - owner
2979 # - reader
2980 # - writer
2981 "type": "A String", # The account type. Allowed values are:
2982 # - user
2983 # - group
2984 # - domain
2985 # - anyone
2986 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
2987 "A String",
2988 ],
2989 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002990 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04002991 },
Takashi Matsuo06694102015-09-11 13:55:40 -07002992 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00002993 "A String",
2994 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07002995 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07002996 "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 -07002997 "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.
2998 "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 -04002999 "selfLink": "A String", # A link back to this file.
3000 "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.
3001}
3002
Takashi Matsuo06694102015-09-11 13:55:40 -07003003 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.
3004 modifiedDateBehavior: string, Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.
3005 Allowed values
3006 fromBody - Set modifiedDate to the value provided in the body of the request. No change if no value was provided.
3007 fromBodyIfNeeded - Set modifiedDate to the value provided in the body of the request depending on other contents of the update.
3008 fromBodyOrNow - Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.
3009 noChange - Maintain the previous value of modifiedDate.
3010 now - Set modifiedDate to the current time.
3011 nowIfNeeded - Set modifiedDate to the current time depending on contents of the update.
John Asmuth614db982014-04-24 15:46:26 -04003012 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003013 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 -04003014 ocr: boolean, Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07003015 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 -07003016 addParents: string, Comma-separated list of parent IDs to add.
3017 removeParents: string, Comma-separated list of parent IDs to remove.
John Asmuth614db982014-04-24 15:46:26 -04003018 updateViewedDate: boolean, Whether to update the view date after successfully updating the file.
3019 timedTextTrackName: string, The timed text track name.
Takashi Matsuo06694102015-09-11 13:55:40 -07003020 convert: boolean, This parameter is deprecated and has no function.
John Asmuth614db982014-04-24 15:46:26 -04003021 useContentAsIndexableText: boolean, Whether to use the content as indexable text.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08003022 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
John Asmuth614db982014-04-24 15:46:26 -04003023 setModifiedDate: boolean, Whether to set the modified date with the supplied modified date.
3024 timedTextLanguage: string, The language of the timed text.
3025
3026Returns:
3027 An object of the form:
3028
3029 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08003030 "hasThumbnail": True or False, # Whether this file has a thumbnail.
John Asmuth614db982014-04-24 15:46:26 -04003031 "lastViewedByMeDate": "A String", # Last time this file was viewed by the user (formatted RFC 3339 timestamp).
Craig Citro065b5302014-08-14 00:47:23 -07003032 "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.
3033 "appDataContents": True or False, # Whether this file is in the Application Data folder.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08003034 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
John Asmuth614db982014-04-24 15:46:26 -04003035 "labels": { # A group of labels for the file.
Takashi Matsuo06694102015-09-11 13:55:40 -07003036 "restricted": True or False, # Whether viewers and commenters are prevented from downloading, printing, and copying this file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08003037 "modified": True or False, # Whether the file has been modified by this user.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003038 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08003039 "hidden": True or False, # Deprecated.
3040 "starred": True or False, # Whether this file is starred by the user.
3041 "viewed": True or False, # Whether this file has been viewed by this user.
John Asmuth614db982014-04-24 15:46:26 -04003042 },
3043 "indexableText": { # Indexable text attributes for the file (can only be written)
3044 "text": "A String", # The text to be indexed for this file.
3045 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08003046 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Takashi Matsuo06694102015-09-11 13:55:40 -07003047 "explicitlyTrashed": True or False, # Whether this file has been explicitly trashed, as opposed to recursively trashed.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003048 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
John Asmuth614db982014-04-24 15:46:26 -04003049 "lastModifyingUserName": "A String", # Name of the last user to modify this file.
3050 "writersCanShare": True or False, # Whether writers can share the document with other users.
3051 "owners": [ # The owner(s) of this file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003052 { # Information about a Drive user.
John Asmuth614db982014-04-24 15:46:26 -04003053 "picture": { # The user's profile picture.
3054 "url": "A String", # A URL that points to a profile picture of this user.
3055 },
3056 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04003057 "displayName": "A String", # A plain text displayable name for this user.
3058 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07003059 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
3060 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04003061 },
3062 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07003063 "ownedByMe": True or False, # Whether the file is owned by the current user.
John Asmuth614db982014-04-24 15:46:26 -04003064 "id": "A String", # The ID of the file.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003065 "sharingUser": { # Information about a Drive user. # User that shared the item with the current user, if available.
Craig Citro065b5302014-08-14 00:47:23 -07003066 "picture": { # The user's profile picture.
3067 "url": "A String", # A URL that points to a profile picture of this user.
3068 },
3069 "kind": "drive#user", # This is always drive#user.
3070 "displayName": "A String", # A plain text displayable name for this user.
3071 "permissionId": "A String", # The user's ID as visible in the permissions collection.
3072 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
3073 "emailAddress": "A String", # The email address of the user.
3074 },
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08003075 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003076 "lastModifyingUser": { # Information about a Drive user. # The last user to modify this file.
John Asmuth614db982014-04-24 15:46:26 -04003077 "picture": { # The user's profile picture.
3078 "url": "A String", # A URL that points to a profile picture of this user.
3079 },
3080 "kind": "drive#user", # This is always drive#user.
John Asmuth614db982014-04-24 15:46:26 -04003081 "displayName": "A String", # A plain text displayable name for this user.
3082 "permissionId": "A String", # The user's ID as visible in the permissions collection.
Craig Citro065b5302014-08-14 00:47:23 -07003083 "isAuthenticatedUser": True or False, # Whether this user is the same as the authenticated user for whom the request was made.
3084 "emailAddress": "A String", # The email address of the user.
John Asmuth614db982014-04-24 15:46:26 -04003085 },
3086 "copyable": True or False, # Whether the file can be copied by the current user.
Craig Citroe633be12015-03-02 13:40:36 -08003087 "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 -07003088 "markedViewedByMeDate": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -04003089 "ownerNames": [ # Name(s) of the owner(s) of this file.
3090 "A String",
3091 ],
3092 "sharedWithMeDate": "A String", # Time at which this file was shared with the user (formatted RFC 3339 timestamp).
3093 "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.
3094 "etag": "A String", # ETag of the file.
3095 "parents": [ # Collection of parent folders which contain this file.
3096 # 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.
3097 { # A reference to a file's parent.
3098 "selfLink": "A String", # A link back to this reference.
3099 "kind": "drive#parentReference", # This is always drive#parentReference.
3100 "id": "A String", # The ID of the parent.
3101 "isRoot": True or False, # Whether or not the parent is the root folder.
3102 "parentLink": "A String", # A link to the parent.
3103 },
3104 ],
3105 "exportLinks": { # Links for exporting Google Docs to specific formats.
3106 "a_key": "A String", # A mapping from export format to URL
3107 },
3108 "shared": True or False, # Whether the file has been shared.
Craig Citro065b5302014-08-14 00:47:23 -07003109 "permissions": [ # The list of permissions for users with access to this file.
3110 { # A permission for a file.
3111 "withLink": True or False, # Whether the link is required for this permission.
3112 "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.
3113 "name": "A String", # The name for this permission.
3114 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08003115 "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 is anyone, in which case both id and value are ignored.
3116 "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 is anyone, in which case both id and value are ignored.
Craig Citro065b5302014-08-14 00:47:23 -07003117 "authKey": "A String", # The authkey parameter required for this permission.
3118 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08003119 "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 -07003120 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Craig Citro065b5302014-08-14 00:47:23 -07003121 "role": "A String", # The primary role for this user. Allowed values are:
3122 # - owner
3123 # - reader
3124 # - writer
3125 "type": "A String", # The account type. Allowed values are:
3126 # - user
3127 # - group
3128 # - domain
3129 # - anyone
3130 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
3131 "A String",
3132 ],
3133 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003134 "photoLink": "A String", # A link to the profile photo, if available.
Craig Citro065b5302014-08-14 00:47:23 -07003135 },
3136 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07003137 "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 -04003138 "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.
3139 "a_key": "A String",
3140 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003141 "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 -04003142 "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.
3143 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
3144 "exposureTime": 3.14, # The length of the exposure, in seconds.
3145 "cameraMake": "A String", # The make of the camera used to create the photo.
3146 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
3147 "isoSpeed": 42, # The ISO speed used to create the photo.
3148 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
3149 "exposureMode": "A String", # The exposure mode used to create the photo.
3150 "colorSpace": "A String", # The color space of the photo.
3151 "location": { # Geographic location information stored in the image.
3152 "latitude": 3.14, # The latitude stored in the image.
3153 "altitude": 3.14, # The altitude stored in the image.
3154 "longitude": 3.14, # The longitude stored in the image.
3155 },
3156 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
3157 "height": 42, # The height of the image in pixels.
3158 "lens": "A String", # The lens used to create the photo.
3159 "date": "A String", # The date and time the photo was taken (EXIF format timestamp).
3160 "width": 42, # The width of the image in pixels.
3161 "meteringMode": "A String", # The metering mode used to create the photo.
3162 "flashUsed": True or False, # Whether a flash was used to create the photo.
3163 "aperture": 3.14, # The aperture used to create the photo (f-number).
3164 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
3165 "sensor": "A String", # The type of sensor used to create the photo.
3166 "whiteBalance": "A String", # The white balance mode used to create the photo.
3167 "cameraModel": "A String", # The model of the camera used to create the photo.
3168 },
3169 "description": "A String", # A short description of the file.
3170 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08003171 "videoMediaMetadata": { # Metadata about video media. This will only be present for video types.
3172 "width": 42, # The width of the video in pixels.
3173 "durationMillis": "A String", # The duration of the video in milliseconds.
3174 "height": 42, # The height of the video in pixels.
3175 },
John Asmuth614db982014-04-24 15:46:26 -04003176 "editable": True or False, # Whether the file can be edited by the current user.
3177 "kind": "drive#file", # The type of file. This is always drive#file.
Takashi Matsuo06694102015-09-11 13:55:40 -07003178 "canComment": True or False, # Whether the current user can comment on the file.
John Asmuth614db982014-04-24 15:46:26 -04003179 "quotaBytesUsed": "A String", # The number of quota bytes used by this file.
Takashi Matsuo06694102015-09-11 13:55:40 -07003180 "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 -07003181 "createdDate": "A String", # Create time for this file (formatted RFC 3339 timestamp).
John Asmuth614db982014-04-24 15:46:26 -04003182 "properties": [ # The list of properties.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003183 { # A key-value pair attached to a file that is either public or private to an application.
3184 # The following limits apply to file properties:
3185 # - Maximum of 100 properties total per file
3186 # - Maximum of 30 private properties per app
3187 # - Maximum of 30 public properties
3188 # - 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 -04003189 "kind": "drive#property", # This is always drive#property.
3190 "value": "A String", # The value of this property.
3191 "etag": "A String", # ETag of the property.
3192 "visibility": "A String", # The visibility of this property.
3193 "key": "A String", # The key of this property.
3194 "selfLink": "A String", # The link back to this property.
3195 },
3196 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07003197 "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 -04003198 "iconLink": "A String", # A link to the file's icon.
3199 "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.
3200 "embedLink": "A String", # A link for embedding the file.
Craig Citro0e5b9bf2014-10-15 10:26:14 -07003201 "alternateLink": "A String", # A link for opening the file in a relevant Google editor or viewer.
John Asmuth614db982014-04-24 15:46:26 -04003202 "title": "A String", # The title of this file.
3203 "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.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08003204 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
Takashi Matsuo06694102015-09-11 13:55:40 -07003205 "mimeType": "A String", # The MIME type of the thumbnail.
3206 "image": "A String", # The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
3207 },
3208 "downloadUrl": "A String",
John Asmuth614db982014-04-24 15:46:26 -04003209 "userPermission": { # A permission for a file. # The permissions for the authenticated user on this file.
3210 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -07003211 "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 -04003212 "name": "A String", # The name for this permission.
3213 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08003214 "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 is anyone, in which case both id and value are ignored.
3215 "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 is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -04003216 "authKey": "A String", # The authkey parameter required for this permission.
3217 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -08003218 "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 -07003219 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time).
John Asmuth614db982014-04-24 15:46:26 -04003220 "role": "A String", # The primary role for this user. Allowed values are:
3221 # - owner
3222 # - reader
3223 # - writer
3224 "type": "A String", # The account type. Allowed values are:
3225 # - user
3226 # - group
3227 # - domain
3228 # - anyone
3229 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
3230 "A String",
3231 ],
3232 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003233 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -04003234 },
Takashi Matsuo06694102015-09-11 13:55:40 -07003235 "spaces": [ # The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'.
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003236 "A String",
3237 ],
Takashi Matsuo06694102015-09-11 13:55:40 -07003238 "shareable": True or False, # Whether the file's sharing settings can be modified by the current user.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003239 "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 -07003240 "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.
3241 "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 -04003242 "selfLink": "A String", # A link back to this file.
3243 "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.
3244 }</pre>
3245</div>
3246
3247<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003248 <code class="details" id="watch">watch(fileId, body, projection=None, revisionId=None, acknowledgeAbuse=None, updateViewedDate=None)</code>
John Asmuth614db982014-04-24 15:46:26 -04003249 <pre>Subscribe to changes on a file
3250
3251Args:
3252 fileId: string, The ID for the file in question. (required)
3253 body: object, The request body. (required)
3254 The object takes the form of:
3255
3256{ # An notification channel used to watch for resource changes.
3257 "resourceUri": "A String", # A version-specific identifier for the watched resource.
3258 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
3259 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
3260 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
3261 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
3262 "params": { # Additional parameters controlling delivery channel behavior. Optional.
3263 "a_key": "A String", # Declares a new parameter by name.
3264 },
3265 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
3266 "address": "A String", # The address where notifications are delivered for this channel.
3267 "type": "A String", # The type of delivery mechanism used for this channel.
3268 "id": "A String", # A UUID or similar unique string that identifies this channel.
3269 }
3270
3271 projection: string, This parameter is deprecated and has no function.
3272 Allowed values
3273 BASIC - Deprecated
3274 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003275 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -08003276 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003277 updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.
John Asmuth614db982014-04-24 15:46:26 -04003278
3279Returns:
3280 An object of the form:
3281
3282 { # An notification channel used to watch for resource changes.
3283 "resourceUri": "A String", # A version-specific identifier for the watched resource.
3284 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
3285 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
3286 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
3287 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
3288 "params": { # Additional parameters controlling delivery channel behavior. Optional.
3289 "a_key": "A String", # Declares a new parameter by name.
3290 },
3291 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
3292 "address": "A String", # The address where notifications are delivered for this channel.
3293 "type": "A String", # The type of delivery mechanism used for this channel.
3294 "id": "A String", # A UUID or similar unique string that identifies this channel.
3295 }</pre>
3296</div>
3297
Craig Citroe633be12015-03-02 13:40:36 -08003298<div class="method">
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003299 <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 -08003300 <pre>Subscribe to changes on a file
3301
3302Args:
3303 fileId: string, The ID for the file in question. (required)
3304 body: object, The request body. (required)
3305 The object takes the form of:
3306
3307{ # An notification channel used to watch for resource changes.
3308 "resourceUri": "A String", # A version-specific identifier for the watched resource.
3309 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
3310 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
3311 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
3312 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
3313 "params": { # Additional parameters controlling delivery channel behavior. Optional.
3314 "a_key": "A String", # Declares a new parameter by name.
3315 },
3316 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
3317 "address": "A String", # The address where notifications are delivered for this channel.
3318 "type": "A String", # The type of delivery mechanism used for this channel.
3319 "id": "A String", # A UUID or similar unique string that identifies this channel.
3320 }
3321
3322 projection: string, This parameter is deprecated and has no function.
3323 Allowed values
3324 BASIC - Deprecated
3325 FULL - Deprecated
Nathaniel Manista4f877e52015-06-15 16:44:50 +00003326 revisionId: string, Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.
Craig Citroe633be12015-03-02 13:40:36 -08003327 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07003328 updateViewedDate: boolean, Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.
Craig Citroe633be12015-03-02 13:40:36 -08003329
3330Returns:
3331 The media object as a string.
3332
3333 </pre>
3334</div>
3335
John Asmuth614db982014-04-24 15:46:26 -04003336</body></html>