blob: 1acb3aea38eda1c206d87b39f2962ac59dcee2c5 [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">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070078 <code><a href="#delete">delete(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</a></code></p>
79<p class="firstline">Deletes a permission from a file or shared drive.</p>
John Asmuth614db982014-04-24 15:46:26 -040080<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070081 <code><a href="#get">get(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=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">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#insert">insert(fileId, body=None, moveToNewOwnersRoot=None, enforceSingleParent=None, supportsTeamDrives=None, supportsAllDrives=None, sendNotificationEmails=None, emailMessage=None, useDomainAdminAccess=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070088<p class="firstline">Inserts a permission for a file or shared drive.</p>
John Asmuth614db982014-04-24 15:46:26 -040089<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070090 <code><a href="#list">list(fileId, pageToken=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, maxResults=None)</a></code></p>
91<p class="firstline">Lists a file's or shared 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">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code><a href="#patch">patch(fileId, permissionId, body=None, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=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">
Dan O'Mearadd494642020-05-01 07:42:23 -070099 <code><a href="#update">update(fileId, permissionId, body=None, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=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">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700103 <code class="details" id="delete">delete(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</code>
104 <pre>Deletes a permission from a file or shared drive.
John Asmuth614db982014-04-24 15:46:26 -0400105
106Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700107 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400108 permissionId: string, The ID for the permission. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700109 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
110 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
111 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
John Asmuth614db982014-04-24 15:46:26 -0400112</pre>
113</div>
114
115<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700116 <code class="details" id="get">get(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400117 <pre>Gets a permission by ID.
118
119Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700120 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400121 permissionId: string, The ID for the permission. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700122 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
123 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
124 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
John Asmuth614db982014-04-24 15:46:26 -0400125
126Returns:
127 An object of the form:
128
129 { # A permission for a file.
130 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700131 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700132 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400133 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400134 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
135 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700136 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400137 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700138 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -0700139 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700140 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
141 # - file
142 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400143 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
144 "A String",
145 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400146 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
147 },
148 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700149 "name": "A String", # The name for this permission.
150 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
151 {
152 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
153 "role": "A String", # Deprecated - use permissionDetails/role instead.
154 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
155 "A String",
156 ],
157 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
158 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
159 },
160 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400161 "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 -0400162 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800163 "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.
164 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700165 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400166 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800167 "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 -0400168 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700169 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400170 # - They can only be set on user and group permissions
171 # - The date must be in the future
172 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700173 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400174 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400175 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700176 # - organizer
177 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400178 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700179 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400180 "type": "A String", # The account type. Allowed values are:
181 # - user
182 # - group
183 # - domain
184 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400185 "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 -0400186 "A String",
187 ],
188 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700189 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400190 }</pre>
191</div>
192
193<div class="method">
194 <code class="details" id="getIdForEmail">getIdForEmail(email)</code>
195 <pre>Returns the permission ID for an email address.
196
197Args:
198 email: string, The email address for which to return a permission ID (required)
199
200Returns:
201 An object of the form:
202
203 { # An ID for a user or group as seen in Permission items.
204 "kind": "drive#permissionId", # This is always drive#permissionId.
205 "id": "A String", # The permission ID.
206 }</pre>
207</div>
208
209<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700210 <code class="details" id="insert">insert(fileId, body=None, moveToNewOwnersRoot=None, enforceSingleParent=None, supportsTeamDrives=None, supportsAllDrives=None, sendNotificationEmails=None, emailMessage=None, useDomainAdminAccess=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700211 <pre>Inserts a permission for a file or shared drive.
John Asmuth614db982014-04-24 15:46:26 -0400212
213Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700214 fileId: string, The ID for the file or shared drive. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700215 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400216 The object takes the form of:
217
218{ # A permission for a file.
219 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700220 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700221 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400222 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400223 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
224 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700225 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400226 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700227 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -0700228 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700229 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
230 # - file
231 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400232 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
233 "A String",
234 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400235 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
236 },
237 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700238 "name": "A String", # The name for this permission.
239 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
240 {
241 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
242 "role": "A String", # Deprecated - use permissionDetails/role instead.
243 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
244 "A String",
245 ],
246 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
247 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
248 },
249 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400250 "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 -0400251 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800252 "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.
253 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700254 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400255 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800256 "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 -0400257 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700258 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400259 # - They can only be set on user and group permissions
260 # - The date must be in the future
261 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700262 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400263 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400264 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700265 # - organizer
266 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400267 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700268 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400269 "type": "A String", # The account type. Allowed values are:
270 # - user
271 # - group
272 # - domain
273 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400274 "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 -0400275 "A String",
276 ],
277 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700278 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400279}
280
Dan O'Mearadd494642020-05-01 07:42:23 -0700281 moveToNewOwnersRoot: boolean, This parameter only takes effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. When set to true, the item will be moved to the new owner's My Drive root folder and all prior parents removed. If set to false, when enforceSingleParent=true, parents are not changed. If set to false, when enforceSingleParent=false, existing parents are not changed; however, the file will be added to the new owner's My Drive root folder, unless it is already in the new owner's My Drive.
282 enforceSingleParent: boolean, Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. See moveToNewOwnersRoot for details.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700283 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
284 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
Craig Citro065b5302014-08-14 00:47:23 -0700285 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700286 emailMessage: string, A plain text custom message to include in notification emails.
287 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
John Asmuth614db982014-04-24 15:46:26 -0400288
289Returns:
290 An object of the form:
291
292 { # A permission for a file.
293 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700294 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700295 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400296 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400297 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
298 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700299 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400300 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700301 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -0700302 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700303 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
304 # - file
305 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400306 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
307 "A String",
308 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400309 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
310 },
311 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700312 "name": "A String", # The name for this permission.
313 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
314 {
315 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
316 "role": "A String", # Deprecated - use permissionDetails/role instead.
317 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
318 "A String",
319 ],
320 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
321 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
322 },
323 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400324 "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 -0400325 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800326 "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.
327 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700328 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400329 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800330 "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 -0400331 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700332 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400333 # - They can only be set on user and group permissions
334 # - The date must be in the future
335 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700336 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400337 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400338 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700339 # - organizer
340 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400341 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700342 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400343 "type": "A String", # The account type. Allowed values are:
344 # - user
345 # - group
346 # - domain
347 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400348 "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 -0400349 "A String",
350 ],
351 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700352 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400353 }</pre>
354</div>
355
356<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700357 <code class="details" id="list">list(fileId, pageToken=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, maxResults=None)</code>
358 <pre>Lists a file's or shared drive's permissions.
John Asmuth614db982014-04-24 15:46:26 -0400359
360Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700361 fileId: string, The ID for the file or shared drive. (required)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400362 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700363 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
364 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
365 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
366 maxResults: integer, The maximum number of permissions to return per page. When not set for files in a shared drive, at most 100 results will be returned. When not set for files that are not in a shared drive, the entire list will be returned.
John Asmuth614db982014-04-24 15:46:26 -0400367
368Returns:
369 An object of the form:
370
371 { # A list of permissions associated with a file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400372 "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.
373 "items": [ # The list of permissions.
John Asmuth614db982014-04-24 15:46:26 -0400374 { # A permission for a file.
375 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700376 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700377 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400378 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400379 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
380 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700381 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400382 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700383 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -0700384 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700385 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
386 # - file
387 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400388 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
389 "A String",
390 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400391 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
392 },
393 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700394 "name": "A String", # The name for this permission.
395 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
396 {
397 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
398 "role": "A String", # Deprecated - use permissionDetails/role instead.
399 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
400 "A String",
401 ],
402 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
403 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
404 },
405 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400406 "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 -0400407 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800408 "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.
409 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700410 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400411 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800412 "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 -0400413 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700414 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400415 # - They can only be set on user and group permissions
416 # - The date must be in the future
417 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700418 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400419 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400420 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700421 # - organizer
422 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400423 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700424 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400425 "type": "A String", # The account type. Allowed values are:
426 # - user
427 # - group
428 # - domain
429 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400430 "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 -0400431 "A String",
432 ],
433 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700434 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400435 },
436 ],
437 "kind": "drive#permissionList", # This is always drive#permissionList.
438 "etag": "A String", # The ETag of the list.
439 "selfLink": "A String", # A link back to this list.
440 }</pre>
441</div>
442
443<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400444 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
445 <pre>Retrieves the next page of results.
446
447Args:
448 previous_request: The request for the previous page. (required)
449 previous_response: The response from the request for the previous page. (required)
450
451Returns:
452 A request object that you can call 'execute()' on to request the next
453 page. Returns None if there are no more items in the collection.
454 </pre>
455</div>
456
457<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700458 <code class="details" id="patch">patch(fileId, permissionId, body=None, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, transferOwnership=None)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700459 <pre>Updates a permission using patch semantics.
John Asmuth614db982014-04-24 15:46:26 -0400460
461Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700462 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400463 permissionId: string, The ID for the permission. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700464 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400465 The object takes the form of:
466
467{ # A permission for a file.
468 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700469 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700470 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400471 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400472 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
473 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700474 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400475 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700476 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -0700477 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700478 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
479 # - file
480 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400481 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
482 "A String",
483 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400484 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
485 },
486 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700487 "name": "A String", # The name for this permission.
488 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
489 {
490 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
491 "role": "A String", # Deprecated - use permissionDetails/role instead.
492 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
493 "A String",
494 ],
495 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
496 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
497 },
498 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400499 "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 -0400500 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800501 "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.
502 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700503 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400504 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800505 "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 -0400506 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700507 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400508 # - They can only be set on user and group permissions
509 # - The date must be in the future
510 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700511 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400512 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400513 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700514 # - organizer
515 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400516 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700517 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400518 "type": "A String", # The account type. Allowed values are:
519 # - user
520 # - group
521 # - domain
522 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400523 "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 -0400524 "A String",
525 ],
526 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700527 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400528}
529
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700530 removeExpiration: boolean, Whether to remove the expiration date.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700531 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
532 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
533 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000534 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 -0400535
536Returns:
537 An object of the form:
538
539 { # A permission for a file.
540 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700541 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700542 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400543 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400544 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
545 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700546 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400547 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700548 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -0700549 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700550 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
551 # - file
552 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400553 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
554 "A String",
555 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400556 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
557 },
558 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700559 "name": "A String", # The name for this permission.
560 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
561 {
562 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
563 "role": "A String", # Deprecated - use permissionDetails/role instead.
564 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
565 "A String",
566 ],
567 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
568 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
569 },
570 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400571 "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 -0400572 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800573 "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.
574 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700575 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400576 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800577 "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 -0400578 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700579 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400580 # - They can only be set on user and group permissions
581 # - The date must be in the future
582 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700583 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400584 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400585 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700586 # - organizer
587 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400588 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700589 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400590 "type": "A String", # The account type. Allowed values are:
591 # - user
592 # - group
593 # - domain
594 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400595 "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 -0400596 "A String",
597 ],
598 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700599 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400600 }</pre>
601</div>
602
603<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700604 <code class="details" id="update">update(fileId, permissionId, body=None, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, transferOwnership=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400605 <pre>Updates a permission.
606
607Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700608 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400609 permissionId: string, The ID for the permission. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700610 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400611 The object takes the form of:
612
613{ # A permission for a file.
614 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700615 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700616 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400617 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400618 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
619 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700620 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400621 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700622 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -0700623 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700624 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
625 # - file
626 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400627 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
628 "A String",
629 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400630 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
631 },
632 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700633 "name": "A String", # The name for this permission.
634 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
635 {
636 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
637 "role": "A String", # Deprecated - use permissionDetails/role instead.
638 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
639 "A String",
640 ],
641 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
642 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
643 },
644 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400645 "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 -0400646 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800647 "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.
648 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700649 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400650 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800651 "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 -0400652 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700653 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400654 # - They can only be set on user and group permissions
655 # - The date must be in the future
656 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700657 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400658 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400659 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700660 # - organizer
661 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400662 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700663 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400664 "type": "A String", # The account type. Allowed values are:
665 # - user
666 # - group
667 # - domain
668 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400669 "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 -0400670 "A String",
671 ],
672 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700673 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400674}
675
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700676 removeExpiration: boolean, Whether to remove the expiration date.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700677 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
678 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
679 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000680 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 -0400681
682Returns:
683 An object of the form:
684
685 { # A permission for a file.
686 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700687 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700688 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400689 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400690 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
691 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700692 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400693 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700694 # - reader
Dan O'Mearadd494642020-05-01 07:42:23 -0700695 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700696 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
697 # - file
698 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400699 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
700 "A String",
701 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400702 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
703 },
704 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700705 "name": "A String", # The name for this permission.
706 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
707 {
708 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
709 "role": "A String", # Deprecated - use permissionDetails/role instead.
710 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
711 "A String",
712 ],
713 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
714 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
715 },
716 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400717 "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 -0400718 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800719 "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.
720 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700721 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400722 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800723 "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 -0400724 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700725 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400726 # - They can only be set on user and group permissions
727 # - The date must be in the future
728 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700729 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400730 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400731 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700732 # - organizer
733 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400734 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700735 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400736 "type": "A String", # The account type. Allowed values are:
737 # - user
738 # - group
739 # - domain
740 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400741 "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 -0400742 "A String",
743 ],
744 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700745 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400746 }</pre>
747</div>
748
749</body></html>