blob: 4f3048aa580ec44c21dc4593956ae3198693b651 [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">
90 <code><a href="#patch">patch(fileId, permissionId, body)</a></code></p>
91<p class="firstline">Updates a permission. This method supports patch semantics.</p>
92<p class="toc_element">
93 <code><a href="#update">update(fileId, permissionId, body)</a></code></p>
94<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.
119 "kind": "drive#permission", # This is always drive#permission.
120 "name": "A String", # The name for this permission.
121 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
122 "id": "A String", # The ID of the permission.
123 "authKey": "A String", # The authkey parameter required for this permission.
124 "etag": "A String", # The ETag of the permission.
125 "role": "A String", # The primary role for this user. Allowed values are:
126 # - owner
127 # - reader
128 # - writer
129 "photoLink": "A String", # A link to the profile photo, if available.
130 "type": "A String", # The account type. Allowed values are:
131 # - user
132 # - group
133 # - domain
134 # - anyone
135 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
136 "A String",
137 ],
138 "selfLink": "A String", # A link back to this permission.
139 }</pre>
140</div>
141
142<div class="method">
Joe Gregorio41be8e82013-03-07 10:31:47 -0500143 <code class="details" id="insert">insert(fileId, body, sendNotificationEmails=None, emailMessage=None)</code>
Joe Gregorio075572b2012-07-09 16:53:09 -0400144 <pre>Inserts a permission for a file.
145
146Args:
147 fileId: string, The ID for the file. (required)
148 body: object, The request body. (required)
149 The object takes the form of:
150
Joe Gregorio41be8e82013-03-07 10:31:47 -0500151{ # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400152 "withLink": True or False, # Whether the link is required for this permission.
153 "kind": "drive#permission", # This is always drive#permission.
154 "name": "A String", # The name for this permission.
155 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
156 "id": "A String", # The ID of the permission.
157 "authKey": "A String", # The authkey parameter required for this permission.
158 "etag": "A String", # The ETag of the permission.
159 "role": "A String", # The primary role for this user. Allowed values are:
160 # - owner
161 # - reader
162 # - writer
163 "photoLink": "A String", # A link to the profile photo, if available.
164 "type": "A String", # The account type. Allowed values are:
165 # - user
166 # - group
167 # - domain
168 # - anyone
169 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
170 "A String",
171 ],
172 "selfLink": "A String", # A link back to this permission.
173}
174
Joe Gregorio41be8e82013-03-07 10:31:47 -0500175 sendNotificationEmails: boolean, Whether to send notification emails when sharing to users or groups.
176 emailMessage: string, A custom message to include in notification emails.
Joe Gregorio075572b2012-07-09 16:53:09 -0400177
178Returns:
179 An object of the form:
180
Joe Gregorio41be8e82013-03-07 10:31:47 -0500181 { # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400182 "withLink": True or False, # Whether the link is required for this permission.
183 "kind": "drive#permission", # This is always drive#permission.
184 "name": "A String", # The name for this permission.
185 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
186 "id": "A String", # The ID of the permission.
187 "authKey": "A String", # The authkey parameter required for this permission.
188 "etag": "A String", # The ETag of the permission.
189 "role": "A String", # The primary role for this user. Allowed values are:
190 # - owner
191 # - reader
192 # - writer
193 "photoLink": "A String", # A link to the profile photo, if available.
194 "type": "A String", # The account type. Allowed values are:
195 # - user
196 # - group
197 # - domain
198 # - anyone
199 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
200 "A String",
201 ],
202 "selfLink": "A String", # A link back to this permission.
203 }</pre>
204</div>
205
206<div class="method">
207 <code class="details" id="list">list(fileId)</code>
208 <pre>Lists a file's permissions.
209
210Args:
211 fileId: string, The ID for the file. (required)
212
213Returns:
214 An object of the form:
215
216 { # A list of permissions associated with a file.
217 "items": [ # The actual list of permissions.
Joe Gregorio41be8e82013-03-07 10:31:47 -0500218 { # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400219 "withLink": True or False, # Whether the link is required for this permission.
220 "kind": "drive#permission", # This is always drive#permission.
221 "name": "A String", # The name for this permission.
222 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
223 "id": "A String", # The ID of the permission.
224 "authKey": "A String", # The authkey parameter required for this permission.
225 "etag": "A String", # The ETag of the permission.
226 "role": "A String", # The primary role for this user. Allowed values are:
227 # - owner
228 # - reader
229 # - writer
230 "photoLink": "A String", # A link to the profile photo, if available.
231 "type": "A String", # The account type. Allowed values are:
232 # - user
233 # - group
234 # - domain
235 # - anyone
236 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
237 "A String",
238 ],
239 "selfLink": "A String", # A link back to this permission.
240 },
241 ],
242 "kind": "drive#permissionList", # This is always drive#permissionList.
243 "etag": "A String", # The ETag of the list.
244 "selfLink": "A String", # A link back to this list.
245 }</pre>
246</div>
247
248<div class="method">
249 <code class="details" id="patch">patch(fileId, permissionId, body)</code>
250 <pre>Updates a permission. This method supports patch semantics.
251
252Args:
253 fileId: string, The ID for the file. (required)
254 permissionId: string, The ID for the permission. (required)
255 body: object, The request body. (required)
256 The object takes the form of:
257
Joe Gregorio41be8e82013-03-07 10:31:47 -0500258{ # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400259 "withLink": True or False, # Whether the link is required for this permission.
260 "kind": "drive#permission", # This is always drive#permission.
261 "name": "A String", # The name for this permission.
262 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
263 "id": "A String", # The ID of the permission.
264 "authKey": "A String", # The authkey parameter required for this permission.
265 "etag": "A String", # The ETag of the permission.
266 "role": "A String", # The primary role for this user. Allowed values are:
267 # - owner
268 # - reader
269 # - writer
270 "photoLink": "A String", # A link to the profile photo, if available.
271 "type": "A String", # The account type. Allowed values are:
272 # - user
273 # - group
274 # - domain
275 # - anyone
276 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
277 "A String",
278 ],
279 "selfLink": "A String", # A link back to this permission.
280}
281
282
283Returns:
284 An object of the form:
285
Joe Gregorio41be8e82013-03-07 10:31:47 -0500286 { # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400287 "withLink": True or False, # Whether the link is required for this permission.
288 "kind": "drive#permission", # This is always drive#permission.
289 "name": "A String", # The name for this permission.
290 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
291 "id": "A String", # The ID of the permission.
292 "authKey": "A String", # The authkey parameter required for this permission.
293 "etag": "A String", # The ETag of the permission.
294 "role": "A String", # The primary role for this user. Allowed values are:
295 # - owner
296 # - reader
297 # - writer
298 "photoLink": "A String", # A link to the profile photo, if available.
299 "type": "A String", # The account type. Allowed values are:
300 # - user
301 # - group
302 # - domain
303 # - anyone
304 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
305 "A String",
306 ],
307 "selfLink": "A String", # A link back to this permission.
308 }</pre>
309</div>
310
311<div class="method">
312 <code class="details" id="update">update(fileId, permissionId, body)</code>
313 <pre>Updates a permission.
314
315Args:
316 fileId: string, The ID for the file. (required)
317 permissionId: string, The ID for the permission. (required)
318 body: object, The request body. (required)
319 The object takes the form of:
320
Joe Gregorio41be8e82013-03-07 10:31:47 -0500321{ # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400322 "withLink": True or False, # Whether the link is required for this permission.
323 "kind": "drive#permission", # This is always drive#permission.
324 "name": "A String", # The name for this permission.
325 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
326 "id": "A String", # The ID of the permission.
327 "authKey": "A String", # The authkey parameter required for this permission.
328 "etag": "A String", # The ETag of the permission.
329 "role": "A String", # The primary role for this user. Allowed values are:
330 # - owner
331 # - reader
332 # - writer
333 "photoLink": "A String", # A link to the profile photo, if available.
334 "type": "A String", # The account type. Allowed values are:
335 # - user
336 # - group
337 # - domain
338 # - anyone
339 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
340 "A String",
341 ],
342 "selfLink": "A String", # A link back to this permission.
343}
344
345
346Returns:
347 An object of the form:
348
Joe Gregorio41be8e82013-03-07 10:31:47 -0500349 { # A permission for a file.
Joe Gregorio075572b2012-07-09 16:53:09 -0400350 "withLink": True or False, # Whether the link is required for this permission.
351 "kind": "drive#permission", # This is always drive#permission.
352 "name": "A String", # The name for this permission.
353 "value": "A String", # The email address or domain name for the entity. This is not populated in responses.
354 "id": "A String", # The ID of the permission.
355 "authKey": "A String", # The authkey parameter required for this permission.
356 "etag": "A String", # The ETag of the permission.
357 "role": "A String", # The primary role for this user. Allowed values are:
358 # - owner
359 # - reader
360 # - writer
361 "photoLink": "A String", # A link to the profile photo, if available.
362 "type": "A String", # The account type. Allowed values are:
363 # - user
364 # - group
365 # - domain
366 # - anyone
367 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed.
368 "A String",
369 ],
370 "selfLink": "A String", # A link back to this permission.
371 }</pre>
372</div>
373
374</body></html>