blob: d2b3764ad6a81bdb2fe3c8f44936374f0ef62e5f [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.permissions.html">permissions</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#create">create(fileId, body, sendNotificationEmail=None, transferOwnership=None, emailMessage=None)</a></code></p>
79<p class="firstline">Creates a permission for a file.</p>
80<p class="toc_element">
81 <code><a href="#delete">delete(fileId, permissionId)</a></code></p>
82<p class="firstline">Deletes a permission.</p>
83<p class="toc_element">
84 <code><a href="#get">get(fileId, permissionId)</a></code></p>
85<p class="firstline">Gets a permission by ID.</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="#update">update(fileId, permissionId, body, transferOwnership=None)</a></code></p>
91<p class="firstline">Updates a permission with patch semantics.</p>
92<h3>Method Details</h3>
93<div class="method">
94 <code class="details" id="create">create(fileId, body, sendNotificationEmail=None, transferOwnership=None, emailMessage=None)</code>
95 <pre>Creates a permission for a file.
96
97Args:
98 fileId: string, The ID of the file. (required)
99 body: object, The request body. (required)
100 The object takes the form of:
101
102{ # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
103 "domain": "A String", # The domain to which this permission refers.
104 "displayName": "A String", # A displayable name for users, groups or domains.
105 "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.
106 "kind": "drive#permission", # This is always drive#permission.
107 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
108 "photoLink": "A String", # A link to the user's profile photo, if available.
109 "role": "A String", # The role granted by this permission. Valid values are:
110 # - owner
111 # - writer
112 # - commenter
113 # - reader
114 "type": "A String", # The type of the grantee. Valid values are:
115 # - user
116 # - group
117 # - domain
118 # - anyone
119 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
120}
121
122 sendNotificationEmail: boolean, Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers.
123 transferOwnership: boolean, Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect.
124 emailMessage: string, A custom message to include in the notification email.
125
126Returns:
127 An object of the form:
128
129 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
130 "domain": "A String", # The domain to which this permission refers.
131 "displayName": "A String", # A displayable name for users, groups or domains.
132 "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.
133 "kind": "drive#permission", # This is always drive#permission.
134 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
135 "photoLink": "A String", # A link to the user's profile photo, if available.
136 "role": "A String", # The role granted by this permission. Valid values are:
137 # - owner
138 # - writer
139 # - commenter
140 # - reader
141 "type": "A String", # The type of the grantee. Valid values are:
142 # - user
143 # - group
144 # - domain
145 # - anyone
146 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
147 }</pre>
148</div>
149
150<div class="method">
151 <code class="details" id="delete">delete(fileId, permissionId)</code>
152 <pre>Deletes a permission.
153
154Args:
155 fileId: string, The ID of the file. (required)
156 permissionId: string, The ID of the permission. (required)
157</pre>
158</div>
159
160<div class="method">
161 <code class="details" id="get">get(fileId, permissionId)</code>
162 <pre>Gets a permission by ID.
163
164Args:
165 fileId: string, The ID of the file. (required)
166 permissionId: string, The ID of the permission. (required)
167
168Returns:
169 An object of the form:
170
171 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
172 "domain": "A String", # The domain to which this permission refers.
173 "displayName": "A String", # A displayable name for users, groups or domains.
174 "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.
175 "kind": "drive#permission", # This is always drive#permission.
176 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
177 "photoLink": "A String", # A link to the user's profile photo, if available.
178 "role": "A String", # The role granted by this permission. Valid values are:
179 # - owner
180 # - writer
181 # - commenter
182 # - reader
183 "type": "A String", # The type of the grantee. Valid values are:
184 # - user
185 # - group
186 # - domain
187 # - anyone
188 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
189 }</pre>
190</div>
191
192<div class="method">
193 <code class="details" id="list">list(fileId)</code>
194 <pre>Lists a file's permissions.
195
196Args:
197 fileId: string, The ID of the file. (required)
198
199Returns:
200 An object of the form:
201
202 { # A list of permissions for a file.
203 "kind": "drive#permissionList", # This is always drive#permissionList.
204 "permissions": [ # The full list of permissions.
205 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
206 "domain": "A String", # The domain to which this permission refers.
207 "displayName": "A String", # A displayable name for users, groups or domains.
208 "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.
209 "kind": "drive#permission", # This is always drive#permission.
210 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
211 "photoLink": "A String", # A link to the user's profile photo, if available.
212 "role": "A String", # The role granted by this permission. Valid values are:
213 # - owner
214 # - writer
215 # - commenter
216 # - reader
217 "type": "A String", # The type of the grantee. Valid values are:
218 # - user
219 # - group
220 # - domain
221 # - anyone
222 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
223 },
224 ],
225 }</pre>
226</div>
227
228<div class="method">
229 <code class="details" id="update">update(fileId, permissionId, body, transferOwnership=None)</code>
230 <pre>Updates a permission with patch semantics.
231
232Args:
233 fileId: string, The ID of the file. (required)
234 permissionId: string, The ID of the permission. (required)
235 body: object, The request body. (required)
236 The object takes the form of:
237
238{ # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
239 "domain": "A String", # The domain to which this permission refers.
240 "displayName": "A String", # A displayable name for users, groups or domains.
241 "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.
242 "kind": "drive#permission", # This is always drive#permission.
243 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
244 "photoLink": "A String", # A link to the user's profile photo, if available.
245 "role": "A String", # The role granted by this permission. Valid values are:
246 # - owner
247 # - writer
248 # - commenter
249 # - reader
250 "type": "A String", # The type of the grantee. Valid values are:
251 # - user
252 # - group
253 # - domain
254 # - anyone
255 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
256}
257
258 transferOwnership: boolean, Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect.
259
260Returns:
261 An object of the form:
262
263 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
264 "domain": "A String", # The domain to which this permission refers.
265 "displayName": "A String", # A displayable name for users, groups or domains.
266 "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.
267 "kind": "drive#permission", # This is always drive#permission.
268 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
269 "photoLink": "A String", # A link to the user's profile photo, if available.
270 "role": "A String", # The role granted by this permission. Valid values are:
271 # - owner
272 # - writer
273 # - commenter
274 # - reader
275 "type": "A String", # The type of the grantee. Valid values are:
276 # - user
277 # - group
278 # - domain
279 # - anyone
280 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
281 }</pre>
282</div>
283
284</body></html>