blob: dddaf83ead446f0621caf8a3d5e16e6794001664 [file] [log] [blame]
Joe Gregorio075572b2012-07-09 16:53:09 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="drive_v2.html">Drive API</a> . <a href="drive_v2.permissions.html">permissions</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#delete">delete(fileId, permissionId)</a></code></p>
79<p class="firstline">Deletes a permission from a file.</p>
80<p class="toc_element">
81 <code><a href="#get">get(fileId, permissionId)</a></code></p>
82<p class="firstline">Gets a permission by ID.</p>
83<p class="toc_element">
Joe Gregorio41be8e82013-03-07 10:31:47 -050084 <code><a href="#insert">insert(fileId, body, sendNotificationEmails=None, emailMessage=None)</a></code></p>
Joe Gregorio075572b2012-07-09 16:53:09 -040085<p class="firstline">Inserts a permission for a file.</p>
86<p class="toc_element">
87 <code><a href="#list">list(fileId)</a></code></p>
88<p class="firstline">Lists a file's permissions.</p>
89<p class="toc_element">
Joe Gregorio37802c32013-08-06 12:24:05 -040090 <code><a href="#patch">patch(fileId, permissionId, body, transferOwnership=None)</a></code></p>
Joe Gregorio075572b2012-07-09 16:53:09 -040091<p class="firstline">Updates a permission. This method supports patch semantics.</p>
92<p class="toc_element">
Joe Gregorio37802c32013-08-06 12:24:05 -040093 <code><a href="#update">update(fileId, permissionId, body, transferOwnership=None)</a></code></p>
Joe Gregorio075572b2012-07-09 16:53:09 -040094<p class="firstline">Updates a permission.</p>
95<h3>Method Details</h3>
96<div class="method">
97 <code class="details" id="delete">delete(fileId, permissionId)</code>
98 <pre>Deletes a permission from a file.
99
100Args:
101 fileId: string, The ID for the file. (required)
102 permissionId: string, The ID for the permission. (required)
103</pre>
104</div>
105
106<div class="method">
107 <code class="details" id="get">get(fileId, permissionId)</code>
108 <pre>Gets a permission by ID.
109
110Args:
111 fileId: string, The ID for the file. (required)
112 permissionId: string, The ID for the permission. (required)
113
114Returns:
115 An object of the form:
116
Joe Gregorio41be8e82013-03-07 10:31:47 -0500117 { # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400118 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400119 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -0400120 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400121 "kind": "drive#permission", # This is always drive#permission.
122 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -0400123 "id": "A String", # The ID of the permission.
124 "authKey": "A String", # The authkey parameter required for this permission.
125 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400126 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
127 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -0400128 "role": "A String", # The primary role for this user. Allowed values are:
129 # - owner
130 # - reader
131 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -0400132 "type": "A String", # The account type. Allowed values are:
133 # - user
134 # - group
135 # - domain
136 # - anyone
137 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
138 "A String",
139 ],
140 "selfLink": "A String", # A link back to this permission.
141 }</pre>
142</div>
143
144<div class="method">
Joe Gregorio41be8e82013-03-07 10:31:47 -0500145 <code class="details" id="insert">insert(fileId, body, sendNotificationEmails=None, emailMessage=None)</code>
Joe Gregorio075572b2012-07-09 16:53:09 -0400146 <pre>Inserts a permission for a file.
147
148Args:
149 fileId: string, The ID for the file. (required)
150 body: object, The request body. (required)
151 The object takes the form of:
152
Joe Gregorio41be8e82013-03-07 10:31:47 -0500153{ # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400154 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400155 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -0400156 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400157 "kind": "drive#permission", # This is always drive#permission.
158 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -0400159 "id": "A String", # The ID of the permission.
160 "authKey": "A String", # The authkey parameter required for this permission.
161 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400162 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
163 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -0400164 "role": "A String", # The primary role for this user. Allowed values are:
165 # - owner
166 # - reader
167 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -0400168 "type": "A String", # The account type. Allowed values are:
169 # - user
170 # - group
171 # - domain
172 # - anyone
173 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
174 "A String",
175 ],
176 "selfLink": "A String", # A link back to this permission.
177}
178
Joe Gregorio41be8e82013-03-07 10:31:47 -0500179 sendNotificationEmails: boolean, Whether to send notification emails when sharing to users or groups.
180 emailMessage: string, A custom message to include in notification emails.
Joe Gregorio075572b2012-07-09 16:53:09 -0400181
182Returns:
183 An object of the form:
184
Joe Gregorio41be8e82013-03-07 10:31:47 -0500185 { # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400186 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400187 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -0400188 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400189 "kind": "drive#permission", # This is always drive#permission.
190 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -0400191 "id": "A String", # The ID of the permission.
192 "authKey": "A String", # The authkey parameter required for this permission.
193 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400194 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
195 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -0400196 "role": "A String", # The primary role for this user. Allowed values are:
197 # - owner
198 # - reader
199 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -0400200 "type": "A String", # The account type. Allowed values are:
201 # - user
202 # - group
203 # - domain
204 # - anyone
205 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
206 "A String",
207 ],
208 "selfLink": "A String", # A link back to this permission.
209 }</pre>
210</div>
211
212<div class="method">
213 <code class="details" id="list">list(fileId)</code>
214 <pre>Lists a file's permissions.
215
216Args:
217 fileId: string, The ID for the file. (required)
218
219Returns:
220 An object of the form:
221
222 { # A list of permissions associated with a file.
223 "items": [ # The actual list of permissions.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500224 { # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400225 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400226 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -0400227 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400228 "kind": "drive#permission", # This is always drive#permission.
229 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -0400230 "id": "A String", # The ID of the permission.
231 "authKey": "A String", # The authkey parameter required for this permission.
232 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400233 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
234 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -0400235 "role": "A String", # The primary role for this user. Allowed values are:
236 # - owner
237 # - reader
238 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -0400239 "type": "A String", # The account type. Allowed values are:
240 # - user
241 # - group
242 # - domain
243 # - anyone
244 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
245 "A String",
246 ],
247 "selfLink": "A String", # A link back to this permission.
248 },
249 ],
250 "kind": "drive#permissionList", # This is always drive#permissionList.
251 "etag": "A String", # The ETag of the list.
252 "selfLink": "A String", # A link back to this list.
253 }</pre>
254</div>
255
256<div class="method">
Joe Gregorio37802c32013-08-06 12:24:05 -0400257 <code class="details" id="patch">patch(fileId, permissionId, body, transferOwnership=None)</code>
Joe Gregorio075572b2012-07-09 16:53:09 -0400258 <pre>Updates a permission. This method supports patch semantics.
259
260Args:
261 fileId: string, The ID for the file. (required)
262 permissionId: string, The ID for the permission. (required)
263 body: object, The request body. (required)
264 The object takes the form of:
265
Joe Gregorio41be8e82013-03-07 10:31:47 -0500266{ # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400267 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400268 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -0400269 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400270 "kind": "drive#permission", # This is always drive#permission.
271 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -0400272 "id": "A String", # The ID of the permission.
273 "authKey": "A String", # The authkey parameter required for this permission.
274 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400275 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
276 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -0400277 "role": "A String", # The primary role for this user. Allowed values are:
278 # - owner
279 # - reader
280 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -0400281 "type": "A String", # The account type. Allowed values are:
282 # - user
283 # - group
284 # - domain
285 # - anyone
286 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
287 "A String",
288 ],
289 "selfLink": "A String", # A link back to this permission.
290}
291
Joe Gregorio37802c32013-08-06 12:24:05 -0400292 transferOwnership: boolean, Whether changing a role to 'owner' should also downgrade the current owners to writers.
Joe Gregorio075572b2012-07-09 16:53:09 -0400293
294Returns:
295 An object of the form:
296
Joe Gregorio41be8e82013-03-07 10:31:47 -0500297 { # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400298 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400299 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -0400300 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400301 "kind": "drive#permission", # This is always drive#permission.
302 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -0400303 "id": "A String", # The ID of the permission.
304 "authKey": "A String", # The authkey parameter required for this permission.
305 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400306 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
307 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -0400308 "role": "A String", # The primary role for this user. Allowed values are:
309 # - owner
310 # - reader
311 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -0400312 "type": "A String", # The account type. Allowed values are:
313 # - user
314 # - group
315 # - domain
316 # - anyone
317 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
318 "A String",
319 ],
320 "selfLink": "A String", # A link back to this permission.
321 }</pre>
322</div>
323
324<div class="method">
Joe Gregorio37802c32013-08-06 12:24:05 -0400325 <code class="details" id="update">update(fileId, permissionId, body, transferOwnership=None)</code>
Joe Gregorio075572b2012-07-09 16:53:09 -0400326 <pre>Updates a permission.
327
328Args:
329 fileId: string, The ID for the file. (required)
330 permissionId: string, The ID for the permission. (required)
331 body: object, The request body. (required)
332 The object takes the form of:
333
Joe Gregorio41be8e82013-03-07 10:31:47 -0500334{ # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400335 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400336 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -0400337 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400338 "kind": "drive#permission", # This is always drive#permission.
339 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -0400340 "id": "A String", # The ID of the permission.
341 "authKey": "A String", # The authkey parameter required for this permission.
342 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400343 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
344 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -0400345 "role": "A String", # The primary role for this user. Allowed values are:
346 # - owner
347 # - reader
348 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -0400349 "type": "A String", # The account type. Allowed values are:
350 # - user
351 # - group
352 # - domain
353 # - anyone
354 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
355 "A String",
356 ],
357 "selfLink": "A String", # A link back to this permission.
358}
359
Joe Gregorio37802c32013-08-06 12:24:05 -0400360 transferOwnership: boolean, Whether changing a role to 'owner' should also downgrade the current owners to writers.
Joe Gregorio075572b2012-07-09 16:53:09 -0400361
362Returns:
363 An object of the form:
364
Joe Gregorio41be8e82013-03-07 10:31:47 -0500365 { # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400366 "withLink": True or False, # Whether the link is required for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400367 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain".
Joe Gregorio075572b2012-07-09 16:53:09 -0400368 "name": "A String", # The name for this permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400369 "kind": "drive#permission", # This is always drive#permission.
370 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses.
Joe Gregorio075572b2012-07-09 16:53:09 -0400371 "id": "A String", # The ID of the permission.
372 "authKey": "A String", # The authkey parameter required for this permission.
373 "etag": "A String", # The ETag of the permission.
Joe Gregorio37802c32013-08-06 12:24:05 -0400374 "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address.
375 "photoLink": "A String", # A link to the profile photo, if available.
Joe Gregorio075572b2012-07-09 16:53:09 -0400376 "role": "A String", # The primary role for this user. Allowed values are:
377 # - owner
378 # - reader
379 # - writer
Joe Gregorio075572b2012-07-09 16:53:09 -0400380 "type": "A String", # The account type. Allowed values are:
381 # - user
382 # - group
383 # - domain
384 # - anyone
385 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
386 "A String",
387 ],
388 "selfLink": "A String", # A link back to this permission.
389 }</pre>
390</div>
391
392</body></html>