blob: a72ca7c8d3730e79f210277fbe06b011ed423cac [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 Cheemalapati4ba8c232017-06-06 18:46:08 -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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400130 {
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 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400145 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400146 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800147 "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.
148 "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 -0400149 "authKey": "A String", # The authkey parameter required for this permission.
150 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800151 "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 -0400152 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
153 # - They can only be set on user and group permissions
154 # - The date must be in the future
155 # - The date cannot be more than a year in the future
156 # - The date can only be set on drive.permissions.update requests
157 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
158 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400159 # - owner
160 # - reader
161 # - writer
162 "type": "A String", # The account type. Allowed values are:
163 # - user
164 # - group
165 # - domain
166 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400167 "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 -0400168 "A String",
169 ],
170 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700171 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400172 }</pre>
173</div>
174
175<div class="method">
176 <code class="details" id="getIdForEmail">getIdForEmail(email)</code>
177 <pre>Returns the permission ID for an email address.
178
179Args:
180 email: string, The email address for which to return a permission ID (required)
181
182Returns:
183 An object of the form:
184
185 { # An ID for a user or group as seen in Permission items.
186 "kind": "drive#permissionId", # This is always drive#permissionId.
187 "id": "A String", # The permission ID.
188 }</pre>
189</div>
190
191<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400192 <code class="details" id="insert">insert(fileId, body, supportsTeamDrives=None, sendNotificationEmails=None, emailMessage=None)</code>
193 <pre>Inserts a permission for a file or Team Drive.
John Asmuth614db982014-04-24 15:46:26 -0400194
195Args:
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400196 fileId: string, The ID for the file or Team Drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400197 body: object, The request body. (required)
198 The object takes the form of:
199
200{ # A permission for a file.
201 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700202 "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 -0400203 "name": "A String", # The name for this permission.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400204 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400205 {
206 "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.
207 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
208 # - organizer
209 # - reader
210 # - writer
211 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
212 "A String",
213 ],
214 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
215 # - file
216 # - member
217 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
218 },
219 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400220 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400221 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800222 "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.
223 "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 -0400224 "authKey": "A String", # The authkey parameter required for this permission.
225 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800226 "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 -0400227 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
228 # - They can only be set on user and group permissions
229 # - The date must be in the future
230 # - The date cannot be more than a year in the future
231 # - The date can only be set on drive.permissions.update requests
232 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
233 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400234 # - owner
235 # - reader
236 # - writer
237 "type": "A String", # The account type. Allowed values are:
238 # - user
239 # - group
240 # - domain
241 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400242 "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 -0400243 "A String",
244 ],
245 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700246 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400247}
248
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400249 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Craig Citro065b5302014-08-14 00:47:23 -0700250 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 -0400251 emailMessage: string, A custom message to include in notification emails.
252
253Returns:
254 An object of the form:
255
256 { # A permission for a file.
257 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700258 "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 -0400259 "name": "A String", # The name for this permission.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400260 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400261 {
262 "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.
263 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
264 # - organizer
265 # - reader
266 # - writer
267 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
268 "A String",
269 ],
270 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
271 # - file
272 # - member
273 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
274 },
275 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400276 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400277 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800278 "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.
279 "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 -0400280 "authKey": "A String", # The authkey parameter required for this permission.
281 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800282 "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 -0400283 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
284 # - They can only be set on user and group permissions
285 # - The date must be in the future
286 # - The date cannot be more than a year in the future
287 # - The date can only be set on drive.permissions.update requests
288 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
289 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400290 # - owner
291 # - reader
292 # - writer
293 "type": "A String", # The account type. Allowed values are:
294 # - user
295 # - group
296 # - domain
297 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400298 "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 -0400299 "A String",
300 ],
301 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700302 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400303 }</pre>
304</div>
305
306<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400307 <code class="details" id="list">list(fileId, pageToken=None, supportsTeamDrives=None, maxResults=None)</code>
308 <pre>Lists a file's or Team Drive's permissions.
John Asmuth614db982014-04-24 15:46:26 -0400309
310Args:
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400311 fileId: string, The ID for the file or Team Drive. (required)
312 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.
313 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
314 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 -0400315
316Returns:
317 An object of the form:
318
319 { # A list of permissions associated with a file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400320 "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.
321 "items": [ # The list of permissions.
John Asmuth614db982014-04-24 15:46:26 -0400322 { # A permission for a file.
323 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700324 "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 -0400325 "name": "A String", # The name for this permission.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400326 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400327 {
328 "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.
329 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
330 # - organizer
331 # - reader
332 # - writer
333 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
334 "A String",
335 ],
336 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
337 # - file
338 # - member
339 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
340 },
341 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400342 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400343 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800344 "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.
345 "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 -0400346 "authKey": "A String", # The authkey parameter required for this permission.
347 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800348 "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 -0400349 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
350 # - They can only be set on user and group permissions
351 # - The date must be in the future
352 # - The date cannot be more than a year in the future
353 # - The date can only be set on drive.permissions.update requests
354 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
355 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400356 # - owner
357 # - reader
358 # - writer
359 "type": "A String", # The account type. Allowed values are:
360 # - user
361 # - group
362 # - domain
363 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400364 "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 -0400365 "A String",
366 ],
367 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700368 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400369 },
370 ],
371 "kind": "drive#permissionList", # This is always drive#permissionList.
372 "etag": "A String", # The ETag of the list.
373 "selfLink": "A String", # A link back to this list.
374 }</pre>
375</div>
376
377<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400378 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
379 <pre>Retrieves the next page of results.
380
381Args:
382 previous_request: The request for the previous page. (required)
383 previous_response: The response from the request for the previous page. (required)
384
385Returns:
386 A request object that you can call 'execute()' on to request the next
387 page. Returns None if there are no more items in the collection.
388 </pre>
389</div>
390
391<div class="method">
392 <code class="details" id="patch">patch(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, transferOwnership=None)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700393 <pre>Updates a permission using patch semantics.
John Asmuth614db982014-04-24 15:46:26 -0400394
395Args:
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400396 fileId: string, The ID for the file or Team Drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400397 permissionId: string, The ID for the permission. (required)
398 body: object, The request body. (required)
399 The object takes the form of:
400
401{ # A permission for a file.
402 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700403 "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 -0400404 "name": "A String", # The name for this permission.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400405 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400406 {
407 "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.
408 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
409 # - organizer
410 # - reader
411 # - writer
412 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
413 "A String",
414 ],
415 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
416 # - file
417 # - member
418 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
419 },
420 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400421 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400422 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800423 "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.
424 "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 -0400425 "authKey": "A String", # The authkey parameter required for this permission.
426 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800427 "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 -0400428 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
429 # - They can only be set on user and group permissions
430 # - The date must be in the future
431 # - The date cannot be more than a year in the future
432 # - The date can only be set on drive.permissions.update requests
433 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
434 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400435 # - owner
436 # - reader
437 # - writer
438 "type": "A String", # The account type. Allowed values are:
439 # - user
440 # - group
441 # - domain
442 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400443 "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 -0400444 "A String",
445 ],
446 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700447 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400448}
449
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700450 removeExpiration: boolean, Whether to remove the expiration date.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400451 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000452 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 -0400453
454Returns:
455 An object of the form:
456
457 { # A permission for a file.
458 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700459 "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 -0400460 "name": "A String", # The name for this permission.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400461 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400462 {
463 "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.
464 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
465 # - organizer
466 # - reader
467 # - writer
468 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
469 "A String",
470 ],
471 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
472 # - file
473 # - member
474 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
475 },
476 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400477 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400478 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800479 "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.
480 "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 -0400481 "authKey": "A String", # The authkey parameter required for this permission.
482 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800483 "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 -0400484 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
485 # - They can only be set on user and group permissions
486 # - The date must be in the future
487 # - The date cannot be more than a year in the future
488 # - The date can only be set on drive.permissions.update requests
489 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
490 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400491 # - owner
492 # - reader
493 # - writer
494 "type": "A String", # The account type. Allowed values are:
495 # - user
496 # - group
497 # - domain
498 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400499 "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 -0400500 "A String",
501 ],
502 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700503 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400504 }</pre>
505</div>
506
507<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400508 <code class="details" id="update">update(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, transferOwnership=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400509 <pre>Updates a permission.
510
511Args:
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400512 fileId: string, The ID for the file or Team Drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400513 permissionId: string, The ID for the permission. (required)
514 body: object, The request body. (required)
515 The object takes the form of:
516
517{ # A permission for a file.
518 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700519 "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 -0400520 "name": "A String", # The name for this permission.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400521 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400522 {
523 "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.
524 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
525 # - organizer
526 # - reader
527 # - writer
528 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
529 "A String",
530 ],
531 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
532 # - file
533 # - member
534 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
535 },
536 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400537 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400538 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800539 "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.
540 "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 -0400541 "authKey": "A String", # The authkey parameter required for this permission.
542 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800543 "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 -0400544 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
545 # - They can only be set on user and group permissions
546 # - The date must be in the future
547 # - The date cannot be more than a year in the future
548 # - The date can only be set on drive.permissions.update requests
549 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
550 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400551 # - owner
552 # - reader
553 # - writer
554 "type": "A String", # The account type. Allowed values are:
555 # - user
556 # - group
557 # - domain
558 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400559 "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 -0400560 "A String",
561 ],
562 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700563 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400564}
565
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700566 removeExpiration: boolean, Whether to remove the expiration date.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400567 supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000568 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 -0400569
570Returns:
571 An object of the form:
572
573 { # A permission for a file.
574 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700575 "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 -0400576 "name": "A String", # The name for this permission.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400577 "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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400578 {
579 "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.
580 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
581 # - organizer
582 # - reader
583 # - writer
584 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
585 "A String",
586 ],
587 "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
588 # - file
589 # - member
590 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
591 },
592 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400593 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400594 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800595 "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.
596 "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 -0400597 "authKey": "A String", # The authkey parameter required for this permission.
598 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800599 "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 -0400600 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
601 # - They can only be set on user and group permissions
602 # - The date must be in the future
603 # - The date cannot be more than a year in the future
604 # - The date can only be set on drive.permissions.update requests
605 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
606 # - organizer
John Asmuth614db982014-04-24 15:46:26 -0400607 # - owner
608 # - reader
609 # - writer
610 "type": "A String", # The account type. Allowed values are:
611 # - user
612 # - group
613 # - domain
614 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400615 "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 -0400616 "A String",
617 ],
618 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700619 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400620 }</pre>
621</div>
622
623</body></html>