blob: 16cb74e55e094c0a50ec2f2e4e75b8d9e2e1fd9e [file] [log] [blame]
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001<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_v3.html">Drive API</a> . <a href="drive_v3.files.html">files</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#copy">copy(fileId, body, keepRevisionForever=None, ignoreDefaultVisibility=None, ocrLanguage=None)</a></code></p>
79<p class="firstline">Creates a copy of a file and applies any requested updates with patch semantics.</p>
80<p class="toc_element">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -080081 <code><a href="#create">create(body=None, media_body=None, keepRevisionForever=None, media_mime_type=None, useContentAsIndexableText=None, ignoreDefaultVisibility=None, ocrLanguage=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080082<p class="firstline">Creates a new file.</p>
83<p class="toc_element">
84 <code><a href="#delete">delete(fileId)</a></code></p>
85<p class="firstline">Permanently deletes a file owned by the user without moving it to the trash. If the target is a folder, all descendants owned by the user are also deleted.</p>
86<p class="toc_element">
87 <code><a href="#emptyTrash">emptyTrash()</a></code></p>
88<p class="firstline">Permanently deletes all of the user's trashed files.</p>
89<p class="toc_element">
90 <code><a href="#export">export(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">
93 <code><a href="#export_media">export_media(fileId, mimeType)</a></code></p>
94<p class="firstline">Exports a Google Doc to the requested MIME type and returns the exported content.</p>
95<p class="toc_element">
96 <code><a href="#generateIds">generateIds(count=None, space=None)</a></code></p>
97<p class="firstline">Generates a set of file IDs which can be provided in create requests.</p>
98<p class="toc_element">
99 <code><a href="#get">get(fileId, acknowledgeAbuse=None)</a></code></p>
100<p class="firstline">Gets a file's metadata or content by ID.</p>
101<p class="toc_element">
102 <code><a href="#get_media">get_media(fileId, acknowledgeAbuse=None)</a></code></p>
103<p class="firstline">Gets a file's metadata or content by ID.</p>
104<p class="toc_element">
105 <code><a href="#list">list(orderBy=None, q=None, pageSize=None, pageToken=None, spaces=None, corpus=None)</a></code></p>
106<p class="firstline">Lists or searches 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">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800111 <code><a href="#update">update(fileId, body=None, media_body=None, addParents=None, removeParents=None, media_mime_type=None, useContentAsIndexableText=None, keepRevisionForever=None, ocrLanguage=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800112<p class="firstline">Updates a file's metadata and/or content with patch semantics.</p>
113<p class="toc_element">
114 <code><a href="#watch">watch(fileId, body, acknowledgeAbuse=None)</a></code></p>
115<p class="firstline">Subscribes to changes to a file</p>
116<p class="toc_element">
117 <code><a href="#watch_media">watch_media(fileId, body, acknowledgeAbuse=None)</a></code></p>
118<p class="firstline">Subscribes to changes to a file</p>
119<h3>Method Details</h3>
120<div class="method">
121 <code class="details" id="copy">copy(fileId, body, keepRevisionForever=None, ignoreDefaultVisibility=None, ocrLanguage=None)</code>
122 <pre>Creates a copy of a file and applies any requested updates with patch semantics.
123
124Args:
125 fileId: string, The ID of the file. (required)
126 body: object, The request body. (required)
127 The object takes the form of:
128
129{ # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800130 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800131 "mimeType": "A String", # The MIME type of the file.
132 # Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded.
133 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.
134 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800135 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
136 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800137 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700138 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800139 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
140 "ownedByMe": True or False, # Whether the user owns the file.
141 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
142 "id": "A String", # The ID of the file.
143 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
144 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700145 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800146 "displayName": "A String", # A plain text displayable name for this user.
147 "permissionId": "A String", # The user's ID as visible in Permission resources.
148 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
149 "photoLink": "A String", # A link to the user's profile photo, if available.
150 },
151 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
152 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
153 "width": 42, # The width of the video in pixels.
154 "durationMillis": "A String", # The duration of the video in milliseconds.
155 "height": 42, # The height of the video in pixels.
156 },
157 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
158 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700159 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800160 "displayName": "A String", # A plain text displayable name for this user.
161 "permissionId": "A String", # The user's ID as visible in Permission resources.
162 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
163 "photoLink": "A String", # A link to the user's profile photo, if available.
164 },
165 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
166 # If an unsupported color is specified, the closest color in the palette will be used instead.
167 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
168 # Entries with null values are cleared in update and copy requests.
169 "a_key": "A String",
170 },
171 "capabilities": { # Capabilities the current user has on the file.
172 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
173 "canCopy": True or False, # Whether the user can copy the file.
174 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
175 "canEdit": True or False, # Whether the user can edit the file's content.
176 "canComment": True or False, # Whether the user can comment on the file.
177 },
178 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
179 "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 user.
180 "parents": [ # The IDs of the parent folders which contain the file.
181 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
182 "A String",
183 ],
184 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
185 "shared": True or False, # Whether the file has been shared.
186 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
187 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
188 "domain": "A String", # The domain to which this permission refers.
189 "displayName": "A String", # A displayable name for users, groups or domains.
190 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700191 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800192 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
193 "photoLink": "A String", # A link to the user's profile photo, if available.
194 "role": "A String", # The role granted by this permission. Valid values are:
195 # - owner
196 # - writer
197 # - commenter
198 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700199 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800200 "type": "A String", # The type of the grantee. Valid values are:
201 # - user
202 # - group
203 # - domain
204 # - anyone
205 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
206 },
207 ],
208 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Drive.
209 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
210 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Drive.
211 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
212 "description": "A String", # A short description of the file.
213 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
214 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
215 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800216 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800217 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
218 { # Information about a Drive user.
219 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700220 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800221 "displayName": "A String", # A plain text displayable name for this user.
222 "permissionId": "A String", # The user's ID as visible in Permission resources.
223 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
224 "photoLink": "A String", # A link to the user's profile photo, if available.
225 },
226 ],
227 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
228 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.
229 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
230 # Entries with null values are cleared in update and copy requests.
231 "a_key": "A String",
232 },
233 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
234 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
235 "imageMediaMetadata": { # Additional metadata about image media, if available.
236 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
237 "exposureTime": 3.14, # The length of the exposure, in seconds.
238 "cameraMake": "A String", # The make of the camera used to create the photo.
239 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
240 "width": 42, # The width of the image in pixels.
241 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
242 "exposureMode": "A String", # The exposure mode used to create the photo.
243 "colorSpace": "A String", # The color space of the photo.
244 "location": { # Geographic location information stored in the image.
245 "latitude": 3.14, # The latitude stored in the image.
246 "altitude": 3.14, # The altitude stored in the image.
247 "longitude": 3.14, # The longitude stored in the image.
248 },
249 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
250 "height": 42, # The height of the image in pixels.
251 "lens": "A String", # The lens used to create the photo.
252 "isoSpeed": 42, # The ISO speed used to create the photo.
253 "meteringMode": "A String", # The metering mode used to create the photo.
254 "flashUsed": True or False, # Whether a flash was used to create the photo.
255 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
256 "aperture": 3.14, # The aperture used to create the photo (f-number).
257 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
258 "sensor": "A String", # The type of sensor used to create the photo.
259 "whiteBalance": "A String", # The white balance mode used to create the photo.
260 "cameraModel": "A String", # The model of the camera used to create the photo.
261 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700262 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800263 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
264 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive.
265 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
266 "A String",
267 ],
268 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
269 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
270 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements.
271 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
272 "mimeType": "A String", # The MIME type of the thumbnail.
273 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
274 },
275 },
276 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
277 "starred": True or False, # Whether the user has starred the file.
278 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
279}
280
281 keepRevisionForever: boolean, Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.
282 ignoreDefaultVisibility: boolean, Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.
283 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code).
284
285Returns:
286 An object of the form:
287
288 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800289 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800290 "mimeType": "A String", # The MIME type of the file.
291 # Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded.
292 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.
293 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800294 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
295 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800296 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700297 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800298 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
299 "ownedByMe": True or False, # Whether the user owns the file.
300 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
301 "id": "A String", # The ID of the file.
302 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
303 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700304 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800305 "displayName": "A String", # A plain text displayable name for this user.
306 "permissionId": "A String", # The user's ID as visible in Permission resources.
307 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
308 "photoLink": "A String", # A link to the user's profile photo, if available.
309 },
310 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
311 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
312 "width": 42, # The width of the video in pixels.
313 "durationMillis": "A String", # The duration of the video in milliseconds.
314 "height": 42, # The height of the video in pixels.
315 },
316 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
317 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700318 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800319 "displayName": "A String", # A plain text displayable name for this user.
320 "permissionId": "A String", # The user's ID as visible in Permission resources.
321 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
322 "photoLink": "A String", # A link to the user's profile photo, if available.
323 },
324 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
325 # If an unsupported color is specified, the closest color in the palette will be used instead.
326 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
327 # Entries with null values are cleared in update and copy requests.
328 "a_key": "A String",
329 },
330 "capabilities": { # Capabilities the current user has on the file.
331 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
332 "canCopy": True or False, # Whether the user can copy the file.
333 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
334 "canEdit": True or False, # Whether the user can edit the file's content.
335 "canComment": True or False, # Whether the user can comment on the file.
336 },
337 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
338 "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 user.
339 "parents": [ # The IDs of the parent folders which contain the file.
340 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
341 "A String",
342 ],
343 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
344 "shared": True or False, # Whether the file has been shared.
345 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
346 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
347 "domain": "A String", # The domain to which this permission refers.
348 "displayName": "A String", # A displayable name for users, groups or domains.
349 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700350 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800351 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
352 "photoLink": "A String", # A link to the user's profile photo, if available.
353 "role": "A String", # The role granted by this permission. Valid values are:
354 # - owner
355 # - writer
356 # - commenter
357 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700358 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800359 "type": "A String", # The type of the grantee. Valid values are:
360 # - user
361 # - group
362 # - domain
363 # - anyone
364 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
365 },
366 ],
367 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Drive.
368 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
369 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Drive.
370 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
371 "description": "A String", # A short description of the file.
372 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
373 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
374 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800375 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800376 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
377 { # Information about a Drive user.
378 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700379 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800380 "displayName": "A String", # A plain text displayable name for this user.
381 "permissionId": "A String", # The user's ID as visible in Permission resources.
382 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
383 "photoLink": "A String", # A link to the user's profile photo, if available.
384 },
385 ],
386 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
387 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.
388 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
389 # Entries with null values are cleared in update and copy requests.
390 "a_key": "A String",
391 },
392 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
393 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
394 "imageMediaMetadata": { # Additional metadata about image media, if available.
395 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
396 "exposureTime": 3.14, # The length of the exposure, in seconds.
397 "cameraMake": "A String", # The make of the camera used to create the photo.
398 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
399 "width": 42, # The width of the image in pixels.
400 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
401 "exposureMode": "A String", # The exposure mode used to create the photo.
402 "colorSpace": "A String", # The color space of the photo.
403 "location": { # Geographic location information stored in the image.
404 "latitude": 3.14, # The latitude stored in the image.
405 "altitude": 3.14, # The altitude stored in the image.
406 "longitude": 3.14, # The longitude stored in the image.
407 },
408 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
409 "height": 42, # The height of the image in pixels.
410 "lens": "A String", # The lens used to create the photo.
411 "isoSpeed": 42, # The ISO speed used to create the photo.
412 "meteringMode": "A String", # The metering mode used to create the photo.
413 "flashUsed": True or False, # Whether a flash was used to create the photo.
414 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
415 "aperture": 3.14, # The aperture used to create the photo (f-number).
416 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
417 "sensor": "A String", # The type of sensor used to create the photo.
418 "whiteBalance": "A String", # The white balance mode used to create the photo.
419 "cameraModel": "A String", # The model of the camera used to create the photo.
420 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700421 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800422 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
423 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive.
424 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
425 "A String",
426 ],
427 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
428 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
429 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements.
430 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
431 "mimeType": "A String", # The MIME type of the thumbnail.
432 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
433 },
434 },
435 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
436 "starred": True or False, # Whether the user has starred the file.
437 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
438 }</pre>
439</div>
440
441<div class="method">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800442 <code class="details" id="create">create(body=None, media_body=None, keepRevisionForever=None, media_mime_type=None, useContentAsIndexableText=None, ignoreDefaultVisibility=None, ocrLanguage=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800443 <pre>Creates a new file.
444
445Args:
446 body: object, The request body.
447 The object takes the form of:
448
449{ # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800450 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800451 "mimeType": "A String", # The MIME type of the file.
452 # Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded.
453 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.
454 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800455 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
456 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800457 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700458 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800459 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
460 "ownedByMe": True or False, # Whether the user owns the file.
461 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
462 "id": "A String", # The ID of the file.
463 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
464 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700465 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800466 "displayName": "A String", # A plain text displayable name for this user.
467 "permissionId": "A String", # The user's ID as visible in Permission resources.
468 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
469 "photoLink": "A String", # A link to the user's profile photo, if available.
470 },
471 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
472 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
473 "width": 42, # The width of the video in pixels.
474 "durationMillis": "A String", # The duration of the video in milliseconds.
475 "height": 42, # The height of the video in pixels.
476 },
477 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
478 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700479 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800480 "displayName": "A String", # A plain text displayable name for this user.
481 "permissionId": "A String", # The user's ID as visible in Permission resources.
482 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
483 "photoLink": "A String", # A link to the user's profile photo, if available.
484 },
485 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
486 # If an unsupported color is specified, the closest color in the palette will be used instead.
487 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
488 # Entries with null values are cleared in update and copy requests.
489 "a_key": "A String",
490 },
491 "capabilities": { # Capabilities the current user has on the file.
492 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
493 "canCopy": True or False, # Whether the user can copy the file.
494 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
495 "canEdit": True or False, # Whether the user can edit the file's content.
496 "canComment": True or False, # Whether the user can comment on the file.
497 },
498 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
499 "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 user.
500 "parents": [ # The IDs of the parent folders which contain the file.
501 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
502 "A String",
503 ],
504 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
505 "shared": True or False, # Whether the file has been shared.
506 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
507 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
508 "domain": "A String", # The domain to which this permission refers.
509 "displayName": "A String", # A displayable name for users, groups or domains.
510 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700511 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800512 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
513 "photoLink": "A String", # A link to the user's profile photo, if available.
514 "role": "A String", # The role granted by this permission. Valid values are:
515 # - owner
516 # - writer
517 # - commenter
518 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700519 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800520 "type": "A String", # The type of the grantee. Valid values are:
521 # - user
522 # - group
523 # - domain
524 # - anyone
525 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
526 },
527 ],
528 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Drive.
529 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
530 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Drive.
531 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
532 "description": "A String", # A short description of the file.
533 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
534 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
535 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800536 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800537 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
538 { # Information about a Drive user.
539 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700540 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800541 "displayName": "A String", # A plain text displayable name for this user.
542 "permissionId": "A String", # The user's ID as visible in Permission resources.
543 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
544 "photoLink": "A String", # A link to the user's profile photo, if available.
545 },
546 ],
547 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
548 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.
549 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
550 # Entries with null values are cleared in update and copy requests.
551 "a_key": "A String",
552 },
553 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
554 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
555 "imageMediaMetadata": { # Additional metadata about image media, if available.
556 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
557 "exposureTime": 3.14, # The length of the exposure, in seconds.
558 "cameraMake": "A String", # The make of the camera used to create the photo.
559 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
560 "width": 42, # The width of the image in pixels.
561 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
562 "exposureMode": "A String", # The exposure mode used to create the photo.
563 "colorSpace": "A String", # The color space of the photo.
564 "location": { # Geographic location information stored in the image.
565 "latitude": 3.14, # The latitude stored in the image.
566 "altitude": 3.14, # The altitude stored in the image.
567 "longitude": 3.14, # The longitude stored in the image.
568 },
569 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
570 "height": 42, # The height of the image in pixels.
571 "lens": "A String", # The lens used to create the photo.
572 "isoSpeed": 42, # The ISO speed used to create the photo.
573 "meteringMode": "A String", # The metering mode used to create the photo.
574 "flashUsed": True or False, # Whether a flash was used to create the photo.
575 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
576 "aperture": 3.14, # The aperture used to create the photo (f-number).
577 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
578 "sensor": "A String", # The type of sensor used to create the photo.
579 "whiteBalance": "A String", # The white balance mode used to create the photo.
580 "cameraModel": "A String", # The model of the camera used to create the photo.
581 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700582 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800583 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
584 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive.
585 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
586 "A String",
587 ],
588 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
589 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
590 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements.
591 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
592 "mimeType": "A String", # The MIME type of the thumbnail.
593 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
594 },
595 },
596 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
597 "starred": True or False, # Whether the user has starred the file.
598 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
599}
600
601 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
602 keepRevisionForever: boolean, Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800603 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800604 useContentAsIndexableText: boolean, Whether to use the uploaded content as indexable text.
605 ignoreDefaultVisibility: boolean, Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.
606 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code).
607
608Returns:
609 An object of the form:
610
611 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800612 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800613 "mimeType": "A String", # The MIME type of the file.
614 # Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded.
615 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.
616 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800617 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
618 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800619 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700620 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800621 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
622 "ownedByMe": True or False, # Whether the user owns the file.
623 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
624 "id": "A String", # The ID of the file.
625 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
626 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700627 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800628 "displayName": "A String", # A plain text displayable name for this user.
629 "permissionId": "A String", # The user's ID as visible in Permission resources.
630 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
631 "photoLink": "A String", # A link to the user's profile photo, if available.
632 },
633 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
634 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
635 "width": 42, # The width of the video in pixels.
636 "durationMillis": "A String", # The duration of the video in milliseconds.
637 "height": 42, # The height of the video in pixels.
638 },
639 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
640 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700641 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800642 "displayName": "A String", # A plain text displayable name for this user.
643 "permissionId": "A String", # The user's ID as visible in Permission resources.
644 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
645 "photoLink": "A String", # A link to the user's profile photo, if available.
646 },
647 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
648 # If an unsupported color is specified, the closest color in the palette will be used instead.
649 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
650 # Entries with null values are cleared in update and copy requests.
651 "a_key": "A String",
652 },
653 "capabilities": { # Capabilities the current user has on the file.
654 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
655 "canCopy": True or False, # Whether the user can copy the file.
656 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
657 "canEdit": True or False, # Whether the user can edit the file's content.
658 "canComment": True or False, # Whether the user can comment on the file.
659 },
660 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
661 "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 user.
662 "parents": [ # The IDs of the parent folders which contain the file.
663 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
664 "A String",
665 ],
666 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
667 "shared": True or False, # Whether the file has been shared.
668 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
669 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
670 "domain": "A String", # The domain to which this permission refers.
671 "displayName": "A String", # A displayable name for users, groups or domains.
672 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700673 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800674 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
675 "photoLink": "A String", # A link to the user's profile photo, if available.
676 "role": "A String", # The role granted by this permission. Valid values are:
677 # - owner
678 # - writer
679 # - commenter
680 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700681 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800682 "type": "A String", # The type of the grantee. Valid values are:
683 # - user
684 # - group
685 # - domain
686 # - anyone
687 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
688 },
689 ],
690 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Drive.
691 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
692 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Drive.
693 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
694 "description": "A String", # A short description of the file.
695 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
696 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
697 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800698 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800699 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
700 { # Information about a Drive user.
701 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700702 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800703 "displayName": "A String", # A plain text displayable name for this user.
704 "permissionId": "A String", # The user's ID as visible in Permission resources.
705 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
706 "photoLink": "A String", # A link to the user's profile photo, if available.
707 },
708 ],
709 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
710 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.
711 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
712 # Entries with null values are cleared in update and copy requests.
713 "a_key": "A String",
714 },
715 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
716 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
717 "imageMediaMetadata": { # Additional metadata about image media, if available.
718 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
719 "exposureTime": 3.14, # The length of the exposure, in seconds.
720 "cameraMake": "A String", # The make of the camera used to create the photo.
721 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
722 "width": 42, # The width of the image in pixels.
723 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
724 "exposureMode": "A String", # The exposure mode used to create the photo.
725 "colorSpace": "A String", # The color space of the photo.
726 "location": { # Geographic location information stored in the image.
727 "latitude": 3.14, # The latitude stored in the image.
728 "altitude": 3.14, # The altitude stored in the image.
729 "longitude": 3.14, # The longitude stored in the image.
730 },
731 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
732 "height": 42, # The height of the image in pixels.
733 "lens": "A String", # The lens used to create the photo.
734 "isoSpeed": 42, # The ISO speed used to create the photo.
735 "meteringMode": "A String", # The metering mode used to create the photo.
736 "flashUsed": True or False, # Whether a flash was used to create the photo.
737 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
738 "aperture": 3.14, # The aperture used to create the photo (f-number).
739 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
740 "sensor": "A String", # The type of sensor used to create the photo.
741 "whiteBalance": "A String", # The white balance mode used to create the photo.
742 "cameraModel": "A String", # The model of the camera used to create the photo.
743 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700744 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800745 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
746 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive.
747 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
748 "A String",
749 ],
750 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
751 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
752 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements.
753 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
754 "mimeType": "A String", # The MIME type of the thumbnail.
755 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
756 },
757 },
758 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
759 "starred": True or False, # Whether the user has starred the file.
760 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
761 }</pre>
762</div>
763
764<div class="method">
765 <code class="details" id="delete">delete(fileId)</code>
766 <pre>Permanently deletes a file owned by the user without moving it to the trash. If the target is a folder, all descendants owned by the user are also deleted.
767
768Args:
769 fileId: string, The ID of the file. (required)
770</pre>
771</div>
772
773<div class="method">
774 <code class="details" id="emptyTrash">emptyTrash()</code>
775 <pre>Permanently deletes all of the user's trashed files.
776
777Args:
778</pre>
779</div>
780
781<div class="method">
782 <code class="details" id="export">export(fileId, mimeType)</code>
783 <pre>Exports a Google Doc to the requested MIME type and returns the exported content.
784
785Args:
786 fileId: string, The ID of the file. (required)
787 mimeType: string, The MIME type of the format requested for this export. (required)
788</pre>
789</div>
790
791<div class="method">
792 <code class="details" id="export_media">export_media(fileId, mimeType)</code>
793 <pre>Exports a Google Doc to the requested MIME type and returns the exported content.
794
795Args:
796 fileId: string, The ID of the file. (required)
797 mimeType: string, The MIME type of the format requested for this export. (required)
798</pre>
799</div>
800
801<div class="method">
802 <code class="details" id="generateIds">generateIds(count=None, space=None)</code>
803 <pre>Generates a set of file IDs which can be provided in create requests.
804
805Args:
806 count: integer, The number of IDs to return.
807 space: string, The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.
808
809Returns:
810 An object of the form:
811
812 { # A list of generated file IDs which can be provided in create requests.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700813 "kind": "drive#generatedIds", # Identifies what kind of resource this is. Value: the fixed string "drive#generatedIds".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800814 "ids": [ # The IDs generated for the requesting user in the specified space.
815 "A String",
816 ],
817 "space": "A String", # The type of file that can be created with these IDs.
818 }</pre>
819</div>
820
821<div class="method">
822 <code class="details" id="get">get(fileId, acknowledgeAbuse=None)</code>
823 <pre>Gets a file's metadata or content by ID.
824
825Args:
826 fileId: string, The ID of the file. (required)
827 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
828
829Returns:
830 An object of the form:
831
832 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800833 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800834 "mimeType": "A String", # The MIME type of the file.
835 # Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded.
836 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.
837 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800838 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
839 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800840 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700841 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800842 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
843 "ownedByMe": True or False, # Whether the user owns the file.
844 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
845 "id": "A String", # The ID of the file.
846 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
847 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700848 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800849 "displayName": "A String", # A plain text displayable name for this user.
850 "permissionId": "A String", # The user's ID as visible in Permission resources.
851 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
852 "photoLink": "A String", # A link to the user's profile photo, if available.
853 },
854 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
855 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
856 "width": 42, # The width of the video in pixels.
857 "durationMillis": "A String", # The duration of the video in milliseconds.
858 "height": 42, # The height of the video in pixels.
859 },
860 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
861 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700862 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800863 "displayName": "A String", # A plain text displayable name for this user.
864 "permissionId": "A String", # The user's ID as visible in Permission resources.
865 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
866 "photoLink": "A String", # A link to the user's profile photo, if available.
867 },
868 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
869 # If an unsupported color is specified, the closest color in the palette will be used instead.
870 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
871 # Entries with null values are cleared in update and copy requests.
872 "a_key": "A String",
873 },
874 "capabilities": { # Capabilities the current user has on the file.
875 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
876 "canCopy": True or False, # Whether the user can copy the file.
877 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
878 "canEdit": True or False, # Whether the user can edit the file's content.
879 "canComment": True or False, # Whether the user can comment on the file.
880 },
881 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
882 "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 user.
883 "parents": [ # The IDs of the parent folders which contain the file.
884 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
885 "A String",
886 ],
887 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
888 "shared": True or False, # Whether the file has been shared.
889 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
890 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
891 "domain": "A String", # The domain to which this permission refers.
892 "displayName": "A String", # A displayable name for users, groups or domains.
893 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700894 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800895 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
896 "photoLink": "A String", # A link to the user's profile photo, if available.
897 "role": "A String", # The role granted by this permission. Valid values are:
898 # - owner
899 # - writer
900 # - commenter
901 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700902 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800903 "type": "A String", # The type of the grantee. Valid values are:
904 # - user
905 # - group
906 # - domain
907 # - anyone
908 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
909 },
910 ],
911 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Drive.
912 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
913 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Drive.
914 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
915 "description": "A String", # A short description of the file.
916 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
917 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
918 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800919 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800920 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
921 { # Information about a Drive user.
922 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700923 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800924 "displayName": "A String", # A plain text displayable name for this user.
925 "permissionId": "A String", # The user's ID as visible in Permission resources.
926 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
927 "photoLink": "A String", # A link to the user's profile photo, if available.
928 },
929 ],
930 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
931 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.
932 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
933 # Entries with null values are cleared in update and copy requests.
934 "a_key": "A String",
935 },
936 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
937 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
938 "imageMediaMetadata": { # Additional metadata about image media, if available.
939 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
940 "exposureTime": 3.14, # The length of the exposure, in seconds.
941 "cameraMake": "A String", # The make of the camera used to create the photo.
942 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
943 "width": 42, # The width of the image in pixels.
944 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
945 "exposureMode": "A String", # The exposure mode used to create the photo.
946 "colorSpace": "A String", # The color space of the photo.
947 "location": { # Geographic location information stored in the image.
948 "latitude": 3.14, # The latitude stored in the image.
949 "altitude": 3.14, # The altitude stored in the image.
950 "longitude": 3.14, # The longitude stored in the image.
951 },
952 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
953 "height": 42, # The height of the image in pixels.
954 "lens": "A String", # The lens used to create the photo.
955 "isoSpeed": 42, # The ISO speed used to create the photo.
956 "meteringMode": "A String", # The metering mode used to create the photo.
957 "flashUsed": True or False, # Whether a flash was used to create the photo.
958 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
959 "aperture": 3.14, # The aperture used to create the photo (f-number).
960 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
961 "sensor": "A String", # The type of sensor used to create the photo.
962 "whiteBalance": "A String", # The white balance mode used to create the photo.
963 "cameraModel": "A String", # The model of the camera used to create the photo.
964 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700965 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800966 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
967 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive.
968 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
969 "A String",
970 ],
971 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
972 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
973 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements.
974 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
975 "mimeType": "A String", # The MIME type of the thumbnail.
976 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
977 },
978 },
979 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
980 "starred": True or False, # Whether the user has starred the file.
981 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
982 }</pre>
983</div>
984
985<div class="method">
986 <code class="details" id="get_media">get_media(fileId, acknowledgeAbuse=None)</code>
987 <pre>Gets a file's metadata or content by ID.
988
989Args:
990 fileId: string, The ID of the file. (required)
991 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
992
993Returns:
994 The media object as a string.
995
996 </pre>
997</div>
998
999<div class="method">
1000 <code class="details" id="list">list(orderBy=None, q=None, pageSize=None, pageToken=None, spaces=None, corpus=None)</code>
1001 <pre>Lists or searches files.
1002
1003Args:
1004 orderBy: string, A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.
1005 q: string, A query for filtering the file results. See the "Search for Files" guide for supported syntax.
1006 pageSize: integer, The maximum number of files to return per page.
1007 pageToken: string, The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.
1008 spaces: string, A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.
1009 corpus: string, The source of files to list.
1010 Allowed values
1011 domain - Files shared to the user's domain.
1012 user - Files owned by or shared to the user.
1013
1014Returns:
1015 An object of the form:
1016
1017 { # A list of files.
1018 "files": [ # The page of files.
1019 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001020 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001021 "mimeType": "A String", # The MIME type of the file.
1022 # Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded.
1023 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.
1024 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001025 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
1026 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001027 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001028 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001029 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
1030 "ownedByMe": True or False, # Whether the user owns the file.
1031 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1032 "id": "A String", # The ID of the file.
1033 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1034 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001035 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001036 "displayName": "A String", # A plain text displayable name for this user.
1037 "permissionId": "A String", # The user's ID as visible in Permission resources.
1038 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
1039 "photoLink": "A String", # A link to the user's profile photo, if available.
1040 },
1041 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
1042 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1043 "width": 42, # The width of the video in pixels.
1044 "durationMillis": "A String", # The duration of the video in milliseconds.
1045 "height": 42, # The height of the video in pixels.
1046 },
1047 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
1048 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001049 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001050 "displayName": "A String", # A plain text displayable name for this user.
1051 "permissionId": "A String", # The user's ID as visible in Permission resources.
1052 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
1053 "photoLink": "A String", # A link to the user's profile photo, if available.
1054 },
1055 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
1056 # If an unsupported color is specified, the closest color in the palette will be used instead.
1057 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
1058 # Entries with null values are cleared in update and copy requests.
1059 "a_key": "A String",
1060 },
1061 "capabilities": { # Capabilities the current user has on the file.
1062 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
1063 "canCopy": True or False, # Whether the user can copy the file.
1064 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
1065 "canEdit": True or False, # Whether the user can edit the file's content.
1066 "canComment": True or False, # Whether the user can comment on the file.
1067 },
1068 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
1069 "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 user.
1070 "parents": [ # The IDs of the parent folders which contain the file.
1071 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
1072 "A String",
1073 ],
1074 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
1075 "shared": True or False, # Whether the file has been shared.
1076 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
1077 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1078 "domain": "A String", # The domain to which this permission refers.
1079 "displayName": "A String", # A displayable name for users, groups or domains.
1080 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001081 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001082 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1083 "photoLink": "A String", # A link to the user's profile photo, if available.
1084 "role": "A String", # The role granted by this permission. Valid values are:
1085 # - owner
1086 # - writer
1087 # - commenter
1088 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001089 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001090 "type": "A String", # The type of the grantee. Valid values are:
1091 # - user
1092 # - group
1093 # - domain
1094 # - anyone
1095 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
1096 },
1097 ],
1098 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Drive.
1099 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
1100 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Drive.
1101 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
1102 "description": "A String", # A short description of the file.
1103 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
1104 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
1105 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001106 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001107 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
1108 { # Information about a Drive user.
1109 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001110 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001111 "displayName": "A String", # A plain text displayable name for this user.
1112 "permissionId": "A String", # The user's ID as visible in Permission resources.
1113 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
1114 "photoLink": "A String", # A link to the user's profile photo, if available.
1115 },
1116 ],
1117 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
1118 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.
1119 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
1120 # Entries with null values are cleared in update and copy requests.
1121 "a_key": "A String",
1122 },
1123 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
1124 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
1125 "imageMediaMetadata": { # Additional metadata about image media, if available.
1126 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1127 "exposureTime": 3.14, # The length of the exposure, in seconds.
1128 "cameraMake": "A String", # The make of the camera used to create the photo.
1129 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1130 "width": 42, # The width of the image in pixels.
1131 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1132 "exposureMode": "A String", # The exposure mode used to create the photo.
1133 "colorSpace": "A String", # The color space of the photo.
1134 "location": { # Geographic location information stored in the image.
1135 "latitude": 3.14, # The latitude stored in the image.
1136 "altitude": 3.14, # The altitude stored in the image.
1137 "longitude": 3.14, # The longitude stored in the image.
1138 },
1139 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1140 "height": 42, # The height of the image in pixels.
1141 "lens": "A String", # The lens used to create the photo.
1142 "isoSpeed": 42, # The ISO speed used to create the photo.
1143 "meteringMode": "A String", # The metering mode used to create the photo.
1144 "flashUsed": True or False, # Whether a flash was used to create the photo.
1145 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1146 "aperture": 3.14, # The aperture used to create the photo (f-number).
1147 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1148 "sensor": "A String", # The type of sensor used to create the photo.
1149 "whiteBalance": "A String", # The white balance mode used to create the photo.
1150 "cameraModel": "A String", # The model of the camera used to create the photo.
1151 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001152 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001153 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
1154 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive.
1155 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1156 "A String",
1157 ],
1158 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
1159 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1160 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements.
1161 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
1162 "mimeType": "A String", # The MIME type of the thumbnail.
1163 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1164 },
1165 },
1166 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
1167 "starred": True or False, # Whether the user has starred the file.
1168 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
1169 },
1170 ],
1171 "nextPageToken": "A String", # The page token for the next page of files. This will be absent if the end of the files list has been reached.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001172 "kind": "drive#fileList", # Identifies what kind of resource this is. Value: the fixed string "drive#fileList".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001173 }</pre>
1174</div>
1175
1176<div class="method">
1177 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1178 <pre>Retrieves the next page of results.
1179
1180Args:
1181 previous_request: The request for the previous page. (required)
1182 previous_response: The response from the request for the previous page. (required)
1183
1184Returns:
1185 A request object that you can call 'execute()' on to request the next
1186 page. Returns None if there are no more items in the collection.
1187 </pre>
1188</div>
1189
1190<div class="method">
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001191 <code class="details" id="update">update(fileId, body=None, media_body=None, addParents=None, removeParents=None, media_mime_type=None, useContentAsIndexableText=None, keepRevisionForever=None, ocrLanguage=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001192 <pre>Updates a file's metadata and/or content with patch semantics.
1193
1194Args:
1195 fileId: string, The ID of the file. (required)
1196 body: object, The request body.
1197 The object takes the form of:
1198
1199{ # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001200 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001201 "mimeType": "A String", # The MIME type of the file.
1202 # Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded.
1203 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.
1204 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001205 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
1206 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001207 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001208 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001209 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
1210 "ownedByMe": True or False, # Whether the user owns the file.
1211 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1212 "id": "A String", # The ID of the file.
1213 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1214 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001215 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001216 "displayName": "A String", # A plain text displayable name for this user.
1217 "permissionId": "A String", # The user's ID as visible in Permission resources.
1218 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
1219 "photoLink": "A String", # A link to the user's profile photo, if available.
1220 },
1221 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
1222 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1223 "width": 42, # The width of the video in pixels.
1224 "durationMillis": "A String", # The duration of the video in milliseconds.
1225 "height": 42, # The height of the video in pixels.
1226 },
1227 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
1228 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001229 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001230 "displayName": "A String", # A plain text displayable name for this user.
1231 "permissionId": "A String", # The user's ID as visible in Permission resources.
1232 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
1233 "photoLink": "A String", # A link to the user's profile photo, if available.
1234 },
1235 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
1236 # If an unsupported color is specified, the closest color in the palette will be used instead.
1237 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
1238 # Entries with null values are cleared in update and copy requests.
1239 "a_key": "A String",
1240 },
1241 "capabilities": { # Capabilities the current user has on the file.
1242 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
1243 "canCopy": True or False, # Whether the user can copy the file.
1244 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
1245 "canEdit": True or False, # Whether the user can edit the file's content.
1246 "canComment": True or False, # Whether the user can comment on the file.
1247 },
1248 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
1249 "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 user.
1250 "parents": [ # The IDs of the parent folders which contain the file.
1251 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
1252 "A String",
1253 ],
1254 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
1255 "shared": True or False, # Whether the file has been shared.
1256 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
1257 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1258 "domain": "A String", # The domain to which this permission refers.
1259 "displayName": "A String", # A displayable name for users, groups or domains.
1260 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001261 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001262 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1263 "photoLink": "A String", # A link to the user's profile photo, if available.
1264 "role": "A String", # The role granted by this permission. Valid values are:
1265 # - owner
1266 # - writer
1267 # - commenter
1268 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001269 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001270 "type": "A String", # The type of the grantee. Valid values are:
1271 # - user
1272 # - group
1273 # - domain
1274 # - anyone
1275 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
1276 },
1277 ],
1278 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Drive.
1279 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
1280 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Drive.
1281 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
1282 "description": "A String", # A short description of the file.
1283 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
1284 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
1285 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001286 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001287 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
1288 { # Information about a Drive user.
1289 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001290 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001291 "displayName": "A String", # A plain text displayable name for this user.
1292 "permissionId": "A String", # The user's ID as visible in Permission resources.
1293 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
1294 "photoLink": "A String", # A link to the user's profile photo, if available.
1295 },
1296 ],
1297 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
1298 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.
1299 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
1300 # Entries with null values are cleared in update and copy requests.
1301 "a_key": "A String",
1302 },
1303 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
1304 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
1305 "imageMediaMetadata": { # Additional metadata about image media, if available.
1306 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1307 "exposureTime": 3.14, # The length of the exposure, in seconds.
1308 "cameraMake": "A String", # The make of the camera used to create the photo.
1309 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1310 "width": 42, # The width of the image in pixels.
1311 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1312 "exposureMode": "A String", # The exposure mode used to create the photo.
1313 "colorSpace": "A String", # The color space of the photo.
1314 "location": { # Geographic location information stored in the image.
1315 "latitude": 3.14, # The latitude stored in the image.
1316 "altitude": 3.14, # The altitude stored in the image.
1317 "longitude": 3.14, # The longitude stored in the image.
1318 },
1319 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1320 "height": 42, # The height of the image in pixels.
1321 "lens": "A String", # The lens used to create the photo.
1322 "isoSpeed": 42, # The ISO speed used to create the photo.
1323 "meteringMode": "A String", # The metering mode used to create the photo.
1324 "flashUsed": True or False, # Whether a flash was used to create the photo.
1325 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1326 "aperture": 3.14, # The aperture used to create the photo (f-number).
1327 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1328 "sensor": "A String", # The type of sensor used to create the photo.
1329 "whiteBalance": "A String", # The white balance mode used to create the photo.
1330 "cameraModel": "A String", # The model of the camera used to create the photo.
1331 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001332 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001333 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
1334 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive.
1335 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1336 "A String",
1337 ],
1338 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
1339 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1340 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements.
1341 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
1342 "mimeType": "A String", # The MIME type of the thumbnail.
1343 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1344 },
1345 },
1346 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
1347 "starred": True or False, # Whether the user has starred the file.
1348 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
1349}
1350
1351 media_body: string, The filename of the media request body, or an instance of a MediaUpload object.
1352 addParents: string, A comma-separated list of parent IDs to add.
1353 removeParents: string, A comma-separated list of parent IDs to remove.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001354 media_mime_type: string, The MIME type of the media request body, or an instance of a MediaUpload object.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001355 useContentAsIndexableText: boolean, Whether to use the uploaded content as indexable text.
1356 keepRevisionForever: boolean, Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive.
1357 ocrLanguage: string, A language hint for OCR processing during image import (ISO 639-1 code).
1358
1359Returns:
1360 An object of the form:
1361
1362 { # The metadata for a file.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001363 "hasThumbnail": True or False, # Whether this file has a thumbnail.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001364 "mimeType": "A String", # The MIME type of the file.
1365 # Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded.
1366 # If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.
1367 "modifiedByMeTime": "A String", # The last time the file was modified by the user (RFC 3339 date-time).
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001368 "thumbnailLink": "A String", # A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content.
1369 "thumbnailVersion": "A String", # The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001370 "explicitlyTrashed": True or False, # Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001371 "isAppAuthorized": True or False, # Whether the file was created or opened by the requesting app.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001372 "writersCanShare": True or False, # Whether users with only writer permission can modify the file's permissions.
1373 "ownedByMe": True or False, # Whether the user owns the file.
1374 "viewedByMeTime": "A String", # The last time the file was viewed by the user (RFC 3339 date-time).
1375 "id": "A String", # The ID of the file.
1376 "sharingUser": { # Information about a Drive user. # The user who shared the file with the requesting user, if applicable.
1377 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001378 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001379 "displayName": "A String", # A plain text displayable name for this user.
1380 "permissionId": "A String", # The user's ID as visible in Permission resources.
1381 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
1382 "photoLink": "A String", # A link to the user's profile photo, if available.
1383 },
1384 "size": "A String", # The size of the file's content in bytes. This is only applicable to files with binary content in Drive.
1385 "videoMediaMetadata": { # Additional metadata about video media. This may not be available immediately upon upload.
1386 "width": 42, # The width of the video in pixels.
1387 "durationMillis": "A String", # The duration of the video in milliseconds.
1388 "height": 42, # The height of the video in pixels.
1389 },
1390 "lastModifyingUser": { # Information about a Drive user. # The last user to modify the file.
1391 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001392 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001393 "displayName": "A String", # A plain text displayable name for this user.
1394 "permissionId": "A String", # The user's ID as visible in Permission resources.
1395 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
1396 "photoLink": "A String", # A link to the user's profile photo, if available.
1397 },
1398 "folderColorRgb": "A String", # The color for a folder as an RGB hex string. The supported colors are published in the folderColorPalette field of the About resource.
1399 # If an unsupported color is specified, the closest color in the palette will be used instead.
1400 "appProperties": { # A collection of arbitrary key-value pairs which are private to the requesting app.
1401 # Entries with null values are cleared in update and copy requests.
1402 "a_key": "A String",
1403 },
1404 "capabilities": { # Capabilities the current user has on the file.
1405 "canReadRevisions": True or False, # Whether the current user has read access to the Revisions resource of the file.
1406 "canCopy": True or False, # Whether the user can copy the file.
1407 "canShare": True or False, # Whether the user can modify the file's permissions and sharing settings.
1408 "canEdit": True or False, # Whether the user can edit the file's content.
1409 "canComment": True or False, # Whether the user can comment on the file.
1410 },
1411 "webViewLink": "A String", # A link for opening the file in a relevant Google editor or viewer in a browser.
1412 "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 user.
1413 "parents": [ # The IDs of the parent folders which contain the file.
1414 # If not specified as part of a create request, the file will be placed directly in the My Drive folder. Update requests must use the addParents and removeParents parameters to modify the values.
1415 "A String",
1416 ],
1417 "sharedWithMeTime": "A String", # The time at which the file was shared with the user, if applicable (RFC 3339 date-time).
1418 "shared": True or False, # Whether the file has been shared.
1419 "permissions": [ # The full list of permissions for the file. This is only available if the requesting user can share the file.
1420 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
1421 "domain": "A String", # The domain to which this permission refers.
1422 "displayName": "A String", # A displayable name for users, groups or domains.
1423 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001424 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001425 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
1426 "photoLink": "A String", # A link to the user's profile photo, if available.
1427 "role": "A String", # The role granted by this permission. Valid values are:
1428 # - owner
1429 # - writer
1430 # - commenter
1431 # - reader
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -07001432 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time).
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001433 "type": "A String", # The type of the grantee. Valid values are:
1434 # - user
1435 # - group
1436 # - domain
1437 # - anyone
1438 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
1439 },
1440 ],
1441 "fullFileExtension": "A String", # The full file extension extracted from the name field. May contain multiple concatenated extensions, such as "tar.gz". This is only available for files with binary content in Drive.
1442 # This is automatically updated when the name field changes, however it is not cleared if the new name does not contain a valid extension.
1443 "originalFilename": "A String", # The original filename of the uploaded content if available, or else the original value of the name field. This is only available for files with binary content in Drive.
1444 "viewersCanCopyContent": True or False, # Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations.
1445 "description": "A String", # A short description of the file.
1446 "modifiedTime": "A String", # The last time the file was modified by anyone (RFC 3339 date-time).
1447 # Note that setting modifiedTime will also update modifiedByMeTime for the user.
1448 "viewedByMe": True or False, # Whether the file has been viewed by this user.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -08001449 "modifiedByMe": True or False, # Whether the file has been modified by this user.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001450 "owners": [ # The owners of the file. Currently, only certain legacy files may have more than one owner.
1451 { # Information about a Drive user.
1452 "me": True or False, # Whether this user is the requesting user.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001453 "kind": "drive#user", # Identifies what kind of resource this is. Value: the fixed string "drive#user".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001454 "displayName": "A String", # A plain text displayable name for this user.
1455 "permissionId": "A String", # The user's ID as visible in Permission resources.
1456 "emailAddress": "A String", # The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
1457 "photoLink": "A String", # A link to the user's profile photo, if available.
1458 },
1459 ],
1460 "createdTime": "A String", # The time at which the file was created (RFC 3339 date-time).
1461 "quotaBytesUsed": "A String", # The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled.
1462 "properties": { # A collection of arbitrary key-value pairs which are visible to all apps.
1463 # Entries with null values are cleared in update and copy requests.
1464 "a_key": "A String",
1465 },
1466 "md5Checksum": "A String", # The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive.
1467 "iconLink": "A String", # A static, unauthenticated link to the file's icon.
1468 "imageMediaMetadata": { # Additional metadata about image media, if available.
1469 "exposureBias": 3.14, # The exposure bias of the photo (APEX value).
1470 "exposureTime": 3.14, # The length of the exposure, in seconds.
1471 "cameraMake": "A String", # The make of the camera used to create the photo.
1472 "maxApertureValue": 3.14, # The smallest f-number of the lens at the focal length used to create the photo (APEX value).
1473 "width": 42, # The width of the image in pixels.
1474 "focalLength": 3.14, # The focal length used to create the photo, in millimeters.
1475 "exposureMode": "A String", # The exposure mode used to create the photo.
1476 "colorSpace": "A String", # The color space of the photo.
1477 "location": { # Geographic location information stored in the image.
1478 "latitude": 3.14, # The latitude stored in the image.
1479 "altitude": 3.14, # The altitude stored in the image.
1480 "longitude": 3.14, # The longitude stored in the image.
1481 },
1482 "subjectDistance": 42, # The distance to the subject of the photo, in meters.
1483 "height": 42, # The height of the image in pixels.
1484 "lens": "A String", # The lens used to create the photo.
1485 "isoSpeed": 42, # The ISO speed used to create the photo.
1486 "meteringMode": "A String", # The metering mode used to create the photo.
1487 "flashUsed": True or False, # Whether a flash was used to create the photo.
1488 "time": "A String", # The date and time the photo was taken (EXIF DateTime).
1489 "aperture": 3.14, # The aperture used to create the photo (f-number).
1490 "rotation": 42, # The rotation in clockwise degrees from the image's original orientation.
1491 "sensor": "A String", # The type of sensor used to create the photo.
1492 "whiteBalance": "A String", # The white balance mode used to create the photo.
1493 "cameraModel": "A String", # The model of the camera used to create the photo.
1494 },
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -07001495 "kind": "drive#file", # Identifies what kind of resource this is. Value: the fixed string "drive#file".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001496 "name": "A String", # The name of the file. This is not necessarily unique within a folder.
1497 "webContentLink": "A String", # A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive.
1498 "spaces": [ # The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'.
1499 "A String",
1500 ],
1501 "trashed": True or False, # Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash.
1502 "contentHints": { # Additional information about the content of the file. These fields are never populated in responses.
1503 "indexableText": "A String", # Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements.
1504 "thumbnail": { # A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail.
1505 "mimeType": "A String", # The MIME type of the thumbnail.
1506 "image": "A String", # The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
1507 },
1508 },
1509 "fileExtension": "A String", # The final component of fullFileExtension. This is only available for files with binary content in Drive.
1510 "starred": True or False, # Whether the user has starred the file.
1511 "headRevisionId": "A String", # The ID of the file's head revision. This is currently only available for files with binary content in Drive.
1512 }</pre>
1513</div>
1514
1515<div class="method">
1516 <code class="details" id="watch">watch(fileId, body, acknowledgeAbuse=None)</code>
1517 <pre>Subscribes to changes to a file
1518
1519Args:
1520 fileId: string, The ID of the file. (required)
1521 body: object, The request body. (required)
1522 The object takes the form of:
1523
1524{ # An notification channel used to watch for resource changes.
1525 "resourceUri": "A String", # A version-specific identifier for the watched resource.
1526 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
1527 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
1528 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
1529 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
1530 "params": { # Additional parameters controlling delivery channel behavior. Optional.
1531 "a_key": "A String", # Declares a new parameter by name.
1532 },
1533 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
1534 "address": "A String", # The address where notifications are delivered for this channel.
1535 "type": "A String", # The type of delivery mechanism used for this channel.
1536 "id": "A String", # A UUID or similar unique string that identifies this channel.
1537 }
1538
1539 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
1540
1541Returns:
1542 An object of the form:
1543
1544 { # An notification channel used to watch for resource changes.
1545 "resourceUri": "A String", # A version-specific identifier for the watched resource.
1546 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
1547 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
1548 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
1549 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
1550 "params": { # Additional parameters controlling delivery channel behavior. Optional.
1551 "a_key": "A String", # Declares a new parameter by name.
1552 },
1553 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
1554 "address": "A String", # The address where notifications are delivered for this channel.
1555 "type": "A String", # The type of delivery mechanism used for this channel.
1556 "id": "A String", # A UUID or similar unique string that identifies this channel.
1557 }</pre>
1558</div>
1559
1560<div class="method">
1561 <code class="details" id="watch_media">watch_media(fileId, body, acknowledgeAbuse=None)</code>
1562 <pre>Subscribes to changes to a file
1563
1564Args:
1565 fileId: string, The ID of the file. (required)
1566 body: object, The request body. (required)
1567 The object takes the form of:
1568
1569{ # An notification channel used to watch for resource changes.
1570 "resourceUri": "A String", # A version-specific identifier for the watched resource.
1571 "kind": "api#channel", # Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel".
1572 "resourceId": "A String", # An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.
1573 "payload": True or False, # A Boolean value to indicate whether payload is wanted. Optional.
1574 "token": "A String", # An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.
1575 "params": { # Additional parameters controlling delivery channel behavior. Optional.
1576 "a_key": "A String", # Declares a new parameter by name.
1577 },
1578 "expiration": "A String", # Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.
1579 "address": "A String", # The address where notifications are delivered for this channel.
1580 "type": "A String", # The type of delivery mechanism used for this channel.
1581 "id": "A String", # A UUID or similar unique string that identifies this channel.
1582 }
1583
1584 acknowledgeAbuse: boolean, Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.
1585
1586Returns:
1587 The media object as a string.
1588
1589 </pre>
1590</div>
1591
1592</body></html>