blob: 74709ef577f608f023080ce00ad2a381aa90d18d [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="drive_v2.html">Drive API</a> . <a href="drive_v2.permissions.html">permissions</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040078 <code><a href="#delete">delete(fileId, permissionId, supportsTeamDrives=None)</a></code></p>
79<p class="firstline">Deletes a permission from a file or Team Drive.</p>
John Asmuth614db982014-04-24 15:46:26 -040080<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040081 <code><a href="#get">get(fileId, permissionId, supportsTeamDrives=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040082<p class="firstline">Gets a permission by ID.</p>
83<p class="toc_element">
84 <code><a href="#getIdForEmail">getIdForEmail(email)</a></code></p>
85<p class="firstline">Returns the permission ID for an email address.</p>
86<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040087 <code><a href="#insert">insert(fileId, body, supportsTeamDrives=None, sendNotificationEmails=None, emailMessage=None)</a></code></p>
88<p class="firstline">Inserts a permission for a file or Team Drive.</p>
John Asmuth614db982014-04-24 15:46:26 -040089<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040090 <code><a href="#list">list(fileId, pageToken=None, supportsTeamDrives=None, maxResults=None)</a></code></p>
91<p class="firstline">Lists a file's or Team Drive's permissions.</p>
John Asmuth614db982014-04-24 15:46:26 -040092<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040093 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
94<p class="firstline">Retrieves the next page of results.</p>
95<p class="toc_element">
96 <code><a href="#patch">patch(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, transferOwnership=None)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -070097<p class="firstline">Updates a permission using patch semantics.</p>
John Asmuth614db982014-04-24 15:46:26 -040098<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040099 <code><a href="#update">update(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, transferOwnership=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400100<p class="firstline">Updates a permission.</p>
101<h3>Method Details</h3>
102<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400103 <code class="details" id="delete">delete(fileId, permissionId, supportsTeamDrives=None)</code>
104 <pre>Deletes a permission from a file or Team Drive.
John Asmuth614db982014-04-24 15:46:26 -0400105
106Args:
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400107 fileId: string, The ID for the file or Team Drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400108 permissionId: string, The ID for the permission. (required)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400109 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
John Asmuth614db982014-04-24 15:46:26 -0400110</pre>
111</div>
112
113<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400114 <code class="details" id="get">get(fileId, permissionId, supportsTeamDrives=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400115 <pre>Gets a permission by ID.
116
117Args:
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400118 fileId: string, The ID for the file or Team Drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400119 permissionId: string, The ID for the permission. (required)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400120 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
John Asmuth614db982014-04-24 15:46:26 -0400121
122Returns:
123 An object of the form:
124
125 { # A permission for a file.
126 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700127 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400128 "name": "A String", # The name for this permission.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400129 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
130 {
131 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
132 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
133 # - organizer
134 # - reader
135 # - writer
136 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
137 "A String",
138 ],
139 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
140 # - file
141 # - member
142 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
143 },
144 ],
John Asmuth614db982014-04-24 15:46:26 -0400145 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800146 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
147 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400148 "authKey": "A String", # The authkey parameter required for this permission.
149 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800150 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400151 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
152 # - They can only be set on user and group permissions
153 # - The date must be in the future
154 # - The date cannot be more than a year in the future
155 # - The date can only be set on drive.permissions.update requests
156 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
157 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400158 # - owner
159 # - reader
160 # - writer
161 "type": "A String", # The account type. Allowed values are:
162 # - user
163 # - group
164 # - domain
165 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400166 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400167 "A String",
168 ],
169 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700170 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400171 }</pre>
172</div>
173
174<div class="method">
175 <code class="details" id="getIdForEmail">getIdForEmail(email)</code>
176 <pre>Returns the permission ID for an email address.
177
178Args:
179 email: string, The email address for which to return a permission ID (required)
180
181Returns:
182 An object of the form:
183
184 { # An ID for a user or group as seen in Permission items.
185 "kind": "drive#permissionId", # This is always drive#permissionId.
186 "id": "A String", # The permission ID.
187 }</pre>
188</div>
189
190<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400191 <code class="details" id="insert">insert(fileId, body, supportsTeamDrives=None, sendNotificationEmails=None, emailMessage=None)</code>
192 <pre>Inserts a permission for a file or Team Drive.
John Asmuth614db982014-04-24 15:46:26 -0400193
194Args:
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400195 fileId: string, The ID for the file or Team Drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400196 body: object, The request body. (required)
197 The object takes the form of:
198
199{ # A permission for a file.
200 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700201 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400202 "name": "A String", # The name for this permission.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400203 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
204 {
205 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
206 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
207 # - organizer
208 # - reader
209 # - writer
210 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
211 "A String",
212 ],
213 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
214 # - file
215 # - member
216 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
217 },
218 ],
John Asmuth614db982014-04-24 15:46:26 -0400219 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800220 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
221 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400222 "authKey": "A String", # The authkey parameter required for this permission.
223 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800224 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400225 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
226 # - They can only be set on user and group permissions
227 # - The date must be in the future
228 # - The date cannot be more than a year in the future
229 # - The date can only be set on drive.permissions.update requests
230 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
231 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400232 # - owner
233 # - reader
234 # - writer
235 "type": "A String", # The account type. Allowed values are:
236 # - user
237 # - group
238 # - domain
239 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400240 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400241 "A String",
242 ],
243 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700244 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400245}
246
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400247 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Craig Citro065b5302014-08-14 00:47:23 -0700248 sendNotificationEmails: boolean, Whether to send notification emails when sharing to users or groups. This parameter is ignored and an email is sent if the role is owner.
John Asmuth614db982014-04-24 15:46:26 -0400249 emailMessage: string, A custom message to include in notification emails.
250
251Returns:
252 An object of the form:
253
254 { # A permission for a file.
255 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700256 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400257 "name": "A String", # The name for this permission.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400258 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
259 {
260 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
261 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
262 # - organizer
263 # - reader
264 # - writer
265 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
266 "A String",
267 ],
268 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
269 # - file
270 # - member
271 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
272 },
273 ],
John Asmuth614db982014-04-24 15:46:26 -0400274 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800275 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
276 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400277 "authKey": "A String", # The authkey parameter required for this permission.
278 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800279 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400280 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
281 # - They can only be set on user and group permissions
282 # - The date must be in the future
283 # - The date cannot be more than a year in the future
284 # - The date can only be set on drive.permissions.update requests
285 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
286 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400287 # - owner
288 # - reader
289 # - writer
290 "type": "A String", # The account type. Allowed values are:
291 # - user
292 # - group
293 # - domain
294 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400295 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400296 "A String",
297 ],
298 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700299 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400300 }</pre>
301</div>
302
303<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400304 <code class="details" id="list">list(fileId, pageToken=None, supportsTeamDrives=None, maxResults=None)</code>
305 <pre>Lists a file's or Team Drive's permissions.
John Asmuth614db982014-04-24 15:46:26 -0400306
307Args:
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400308 fileId: string, The ID for the file or Team Drive. (required)
309 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.
310 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
311 maxResults: integer, The maximum number of permissions to return per page. When not set for files in a Team Drive, at most 100 results will be returned. When not set for files that are not in a Team Drive, the entire list will be returned.
John Asmuth614db982014-04-24 15:46:26 -0400312
313Returns:
314 An object of the form:
315
316 { # A list of permissions associated with a file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400317 "nextPageToken": "A String", # The page token for the next page of permissions. This field will be absent if the end of the permissions list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
318 "items": [ # The list of permissions.
John Asmuth614db982014-04-24 15:46:26 -0400319 { # A permission for a file.
320 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700321 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400322 "name": "A String", # The name for this permission.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400323 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
324 {
325 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
326 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
327 # - organizer
328 # - reader
329 # - writer
330 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
331 "A String",
332 ],
333 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
334 # - file
335 # - member
336 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
337 },
338 ],
John Asmuth614db982014-04-24 15:46:26 -0400339 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800340 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
341 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400342 "authKey": "A String", # The authkey parameter required for this permission.
343 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800344 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400345 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
346 # - They can only be set on user and group permissions
347 # - The date must be in the future
348 # - The date cannot be more than a year in the future
349 # - The date can only be set on drive.permissions.update requests
350 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
351 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400352 # - owner
353 # - reader
354 # - writer
355 "type": "A String", # The account type. Allowed values are:
356 # - user
357 # - group
358 # - domain
359 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400360 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400361 "A String",
362 ],
363 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700364 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400365 },
366 ],
367 "kind": "drive#permissionList", # This is always drive#permissionList.
368 "etag": "A String", # The ETag of the list.
369 "selfLink": "A String", # A link back to this list.
370 }</pre>
371</div>
372
373<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400374 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
375 <pre>Retrieves the next page of results.
376
377Args:
378 previous_request: The request for the previous page. (required)
379 previous_response: The response from the request for the previous page. (required)
380
381Returns:
382 A request object that you can call 'execute()' on to request the next
383 page. Returns None if there are no more items in the collection.
384 </pre>
385</div>
386
387<div class="method">
388 <code class="details" id="patch">patch(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, transferOwnership=None)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700389 <pre>Updates a permission using patch semantics.
John Asmuth614db982014-04-24 15:46:26 -0400390
391Args:
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400392 fileId: string, The ID for the file or Team Drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400393 permissionId: string, The ID for the permission. (required)
394 body: object, The request body. (required)
395 The object takes the form of:
396
397{ # A permission for a file.
398 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700399 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400400 "name": "A String", # The name for this permission.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400401 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
402 {
403 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
404 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
405 # - organizer
406 # - reader
407 # - writer
408 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
409 "A String",
410 ],
411 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
412 # - file
413 # - member
414 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
415 },
416 ],
John Asmuth614db982014-04-24 15:46:26 -0400417 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800418 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
419 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400420 "authKey": "A String", # The authkey parameter required for this permission.
421 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800422 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400423 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
424 # - They can only be set on user and group permissions
425 # - The date must be in the future
426 # - The date cannot be more than a year in the future
427 # - The date can only be set on drive.permissions.update requests
428 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
429 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400430 # - owner
431 # - reader
432 # - writer
433 "type": "A String", # The account type. Allowed values are:
434 # - user
435 # - group
436 # - domain
437 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400438 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400439 "A String",
440 ],
441 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700442 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400443}
444
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700445 removeExpiration: boolean, Whether to remove the expiration date.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400446 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000447 transferOwnership: boolean, Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.
John Asmuth614db982014-04-24 15:46:26 -0400448
449Returns:
450 An object of the form:
451
452 { # A permission for a file.
453 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700454 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400455 "name": "A String", # The name for this permission.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400456 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
457 {
458 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
459 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
460 # - organizer
461 # - reader
462 # - writer
463 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
464 "A String",
465 ],
466 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
467 # - file
468 # - member
469 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
470 },
471 ],
John Asmuth614db982014-04-24 15:46:26 -0400472 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800473 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
474 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400475 "authKey": "A String", # The authkey parameter required for this permission.
476 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800477 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400478 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
479 # - They can only be set on user and group permissions
480 # - The date must be in the future
481 # - The date cannot be more than a year in the future
482 # - The date can only be set on drive.permissions.update requests
483 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
484 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400485 # - owner
486 # - reader
487 # - writer
488 "type": "A String", # The account type. Allowed values are:
489 # - user
490 # - group
491 # - domain
492 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400493 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400494 "A String",
495 ],
496 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700497 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400498 }</pre>
499</div>
500
501<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400502 <code class="details" id="update">update(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, transferOwnership=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400503 <pre>Updates a permission.
504
505Args:
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400506 fileId: string, The ID for the file or Team Drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400507 permissionId: string, The ID for the permission. (required)
508 body: object, The request body. (required)
509 The object takes the form of:
510
511{ # A permission for a file.
512 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700513 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400514 "name": "A String", # The name for this permission.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400515 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
516 {
517 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
518 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
519 # - organizer
520 # - reader
521 # - writer
522 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
523 "A String",
524 ],
525 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
526 # - file
527 # - member
528 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
529 },
530 ],
John Asmuth614db982014-04-24 15:46:26 -0400531 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800532 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
533 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400534 "authKey": "A String", # The authkey parameter required for this permission.
535 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800536 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400537 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
538 # - They can only be set on user and group permissions
539 # - The date must be in the future
540 # - The date cannot be more than a year in the future
541 # - The date can only be set on drive.permissions.update requests
542 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
543 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400544 # - owner
545 # - reader
546 # - writer
547 "type": "A String", # The account type. Allowed values are:
548 # - user
549 # - group
550 # - domain
551 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400552 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400553 "A String",
554 ],
555 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700556 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400557}
558
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700559 removeExpiration: boolean, Whether to remove the expiration date.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400560 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000561 transferOwnership: boolean, Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.
John Asmuth614db982014-04-24 15:46:26 -0400562
563Returns:
564 An object of the form:
565
566 { # A permission for a file.
567 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700568 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
John Asmuth614db982014-04-24 15:46:26 -0400569 "name": "A String", # The name for this permission.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400570 "teamDrivePermissionDetails": [ # Details of whether the Permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
571 {
572 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive.
573 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
574 # - organizer
575 # - reader
576 # - writer
577 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
578 "A String",
579 ],
580 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
581 # - file
582 # - member
583 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
584 },
585 ],
John Asmuth614db982014-04-24 15:46:26 -0400586 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800587 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
588 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
John Asmuth614db982014-04-24 15:46:26 -0400589 "authKey": "A String", # The authkey parameter required for this permission.
590 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800591 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400592 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
593 # - They can only be set on user and group permissions
594 # - The date must be in the future
595 # - The date cannot be more than a year in the future
596 # - The date can only be set on drive.permissions.update requests
597 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
598 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400599 # - owner
600 # - reader
601 # - writer
602 "type": "A String", # The account type. Allowed values are:
603 # - user
604 # - group
605 # - domain
606 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400607 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400608 "A String",
609 ],
610 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700611 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400612 }</pre>
613</div>
614
615</body></html>