blob: e02358243774fd20c6e0823b99347352653fb093 [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">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070081 <code><a href="#delete">delete(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070082<p class="firstline">Deletes a permission from a file or shared drive.</p>
John Asmuth614db982014-04-24 15:46:26 -040083<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070084 <code><a href="#get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040085<p class="firstline">Gets a permission by ID.</p>
86<p class="toc_element">
87 <code><a href="#getIdForEmail">getIdForEmail(email)</a></code></p>
88<p class="firstline">Returns the permission ID for an email address.</p>
89<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070090 <code><a href="#insert">insert(fileId, body=None, emailMessage=None, enforceSingleParent=None, moveToNewOwnersRoot=None, sendNotificationEmails=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070091<p class="firstline">Inserts a permission for a file or shared drive.</p>
John Asmuth614db982014-04-24 15:46:26 -040092<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070093 <code><a href="#list">list(fileId, includePermissionsForView=None, maxResults=None, pageToken=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094<p class="firstline">Lists a file's or shared drive's permissions.</p>
John Asmuth614db982014-04-24 15:46:26 -040095<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040096 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
97<p class="firstline">Retrieves the next page of results.</p>
98<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070099 <code><a href="#patch">patch(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -0700100<p class="firstline">Updates a permission using patch semantics.</p>
John Asmuth614db982014-04-24 15:46:26 -0400101<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -0700102 <code><a href="#update">update(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400103<p class="firstline">Updates a permission.</p>
104<h3>Method Details</h3>
105<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700106 <code class="details" id="close">close()</code>
107 <pre>Close httplib2 connections.</pre>
108</div>
109
110<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700111 <code class="details" id="delete">delete(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112 <pre>Deletes a permission from a file or shared drive.
John Asmuth614db982014-04-24 15:46:26 -0400113
114Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700115 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400116 permissionId: string, The ID for the permission. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700117 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700118 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700119 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 -0400120</pre>
121</div>
122
123<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700124 <code class="details" id="get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400125 <pre>Gets a permission by ID.
126
127Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700128 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400129 permissionId: string, The ID for the permission. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700130 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700131 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700132 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 -0400133
134Returns:
135 An object of the form:
136
137 { # A permission for a file.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800138 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
139 &quot;A String&quot;,
140 ],
141 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
142 &quot;deleted&quot;: True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
143 &quot;domain&quot;: &quot;A String&quot;, # 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.
144 &quot;emailAddress&quot;: &quot;A String&quot;, # 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.
145 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
146 &quot;expirationDate&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
147 # - They cannot be set on shared drive items
148 # - They can only be set on user and group permissions
149 # - The date must be in the future
150 # - The date cannot be more than a year in the future
151 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
152 &quot;id&quot;: &quot;A String&quot;, # 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.
153 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
154 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800155 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800156 &quot;permissionDetails&quot;: [ # 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.
157 {
158 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
159 &quot;A String&quot;,
160 ],
161 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
162 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
163 &quot;permissionType&quot;: &quot;A String&quot;, # The permission type for this user. While new values may be added in future, the following are currently possible:
164 # - file
165 # - member
166 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be added in the future, the following are currently possible:
167 # - organizer
168 # - fileOrganizer
169 # - writer
170 # - reader
171 },
172 ],
173 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
174 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
175 # - owner
176 # - organizer
177 # - fileOrganizer
178 # - writer
179 # - reader
180 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
181 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
182 {
183 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
184 &quot;A String&quot;,
185 ],
186 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
187 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
188 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
189 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
190 },
191 ],
192 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
193 # - user
194 # - group
195 # - domain
196 # - anyone
197 &quot;value&quot;: &quot;A String&quot;, # 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.
198 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.
199 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
200}</pre>
John Asmuth614db982014-04-24 15:46:26 -0400201</div>
202
203<div class="method">
204 <code class="details" id="getIdForEmail">getIdForEmail(email)</code>
205 <pre>Returns the permission ID for an email address.
206
207Args:
208 email: string, The email address for which to return a permission ID (required)
209
210Returns:
211 An object of the form:
212
213 { # An ID for a user or group as seen in Permission items.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800214 &quot;id&quot;: &quot;A String&quot;, # The permission ID.
215 &quot;kind&quot;: &quot;drive#permissionId&quot;, # This is always drive#permissionId.
216}</pre>
John Asmuth614db982014-04-24 15:46:26 -0400217</div>
218
219<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700220 <code class="details" id="insert">insert(fileId, body=None, emailMessage=None, enforceSingleParent=None, moveToNewOwnersRoot=None, sendNotificationEmails=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700221 <pre>Inserts a permission for a file or shared drive.
John Asmuth614db982014-04-24 15:46:26 -0400222
223Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700224 fileId: string, The ID for the file or shared drive. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700225 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400226 The object takes the form of:
227
228{ # A permission for a file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700229 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
230 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400231 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700232 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
233 &quot;deleted&quot;: True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
234 &quot;domain&quot;: &quot;A String&quot;, # 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.
235 &quot;emailAddress&quot;: &quot;A String&quot;, # 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.
236 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
237 &quot;expirationDate&quot;: &quot;A String&quot;, # 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 -0700238 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400239 # - They can only be set on user and group permissions
240 # - The date must be in the future
241 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700242 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Bu Sun Kim65020912020-05-20 12:08:20 -0700243 &quot;id&quot;: &quot;A String&quot;, # 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.
244 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
245 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800246 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Bu Sun Kim65020912020-05-20 12:08:20 -0700247 &quot;permissionDetails&quot;: [ # 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.
248 {
249 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
250 &quot;A String&quot;,
251 ],
252 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
253 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
254 &quot;permissionType&quot;: &quot;A String&quot;, # The permission type for this user. While new values may be added in future, the following are currently possible:
255 # - file
256 # - member
257 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be added in the future, the following are currently possible:
258 # - organizer
259 # - fileOrganizer
260 # - writer
261 # - reader
262 },
263 ],
264 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
265 &quot;role&quot;: &quot;A String&quot;, # 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 -0400266 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700267 # - organizer
268 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400269 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700270 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700271 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
272 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
273 {
274 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
275 &quot;A String&quot;,
276 ],
277 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
278 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
279 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
280 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
281 },
282 ],
283 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
John Asmuth614db982014-04-24 15:46:26 -0400284 # - user
285 # - group
286 # - domain
287 # - anyone
Bu Sun Kim65020912020-05-20 12:08:20 -0700288 &quot;value&quot;: &quot;A String&quot;, # 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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700289 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.
Bu Sun Kim65020912020-05-20 12:08:20 -0700290 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
John Asmuth614db982014-04-24 15:46:26 -0400291}
292
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700293 emailMessage: string, A plain text custom message to include in notification emails.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800294 enforceSingleParent: boolean, Deprecated. See moveToNewOwnersRoot for details.
295 moveToNewOwnersRoot: boolean, This parameter will only take effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. If set to true, the item will be moved to the new owner&#x27;s My Drive root folder and all prior parents removed. If set to false, parents are not changed.
Bu Sun Kim65020912020-05-20 12:08:20 -0700296 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 Kimd059ad82020-07-22 17:02:09 -0700297 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700298 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700299 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 -0400300
301Returns:
302 An object of the form:
303
304 { # A permission for a file.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800305 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
306 &quot;A String&quot;,
307 ],
308 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
309 &quot;deleted&quot;: True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
310 &quot;domain&quot;: &quot;A String&quot;, # 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.
311 &quot;emailAddress&quot;: &quot;A String&quot;, # 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.
312 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
313 &quot;expirationDate&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
314 # - They cannot be set on shared drive items
315 # - They can only be set on user and group permissions
316 # - The date must be in the future
317 # - The date cannot be more than a year in the future
318 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
319 &quot;id&quot;: &quot;A String&quot;, # 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.
320 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
321 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800322 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800323 &quot;permissionDetails&quot;: [ # 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.
324 {
325 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
326 &quot;A String&quot;,
327 ],
328 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
329 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
330 &quot;permissionType&quot;: &quot;A String&quot;, # The permission type for this user. While new values may be added in future, the following are currently possible:
331 # - file
332 # - member
333 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be added in the future, the following are currently possible:
334 # - organizer
335 # - fileOrganizer
336 # - writer
337 # - reader
338 },
339 ],
340 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
341 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
342 # - owner
343 # - organizer
344 # - fileOrganizer
345 # - writer
346 # - reader
347 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
348 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
349 {
350 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
351 &quot;A String&quot;,
352 ],
353 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
354 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
355 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
356 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
357 },
358 ],
359 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
360 # - user
361 # - group
362 # - domain
363 # - anyone
364 &quot;value&quot;: &quot;A String&quot;, # 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.
365 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.
366 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
367}</pre>
John Asmuth614db982014-04-24 15:46:26 -0400368</div>
369
370<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700371 <code class="details" id="list">list(fileId, includePermissionsForView=None, maxResults=None, pageToken=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700372 <pre>Lists a file&#x27;s or shared drive&#x27;s permissions.
John Asmuth614db982014-04-24 15:46:26 -0400373
374Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700375 fileId: string, The ID for the file or shared drive. (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700376 includePermissionsForView: string, Specifies which additional view&#x27;s permissions to include in the response. Only &#x27;published&#x27; is supported.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700377 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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700378 pageToken: string, The token for continuing a previous list request on the next page. This should be set to the value of &#x27;nextPageToken&#x27; from the previous response.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700379 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700380 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
381 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 -0400382
383Returns:
384 An object of the form:
385
386 { # A list of permissions associated with a file.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800387 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the list.
388 &quot;items&quot;: [ # The list of permissions.
389 { # A permission for a file.
390 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
391 &quot;A String&quot;,
392 ],
393 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
394 &quot;deleted&quot;: True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
395 &quot;domain&quot;: &quot;A String&quot;, # 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.
396 &quot;emailAddress&quot;: &quot;A String&quot;, # 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.
397 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
398 &quot;expirationDate&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
399 # - They cannot be set on shared drive items
400 # - They can only be set on user and group permissions
401 # - The date must be in the future
402 # - The date cannot be more than a year in the future
403 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
404 &quot;id&quot;: &quot;A String&quot;, # 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.
405 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
406 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800407 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800408 &quot;permissionDetails&quot;: [ # 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.
409 {
410 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
411 &quot;A String&quot;,
412 ],
413 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
414 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
415 &quot;permissionType&quot;: &quot;A String&quot;, # The permission type for this user. While new values may be added in future, the following are currently possible:
416 # - file
417 # - member
418 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be added in the future, the following are currently possible:
419 # - organizer
420 # - fileOrganizer
421 # - writer
422 # - reader
423 },
424 ],
425 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
426 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
427 # - owner
428 # - organizer
429 # - fileOrganizer
430 # - writer
431 # - reader
432 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
433 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
434 {
435 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
436 &quot;A String&quot;,
437 ],
438 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
439 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
440 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
441 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
442 },
443 ],
444 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
445 # - user
446 # - group
447 # - domain
448 # - anyone
449 &quot;value&quot;: &quot;A String&quot;, # 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.
450 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.
451 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
452 },
453 ],
454 &quot;kind&quot;: &quot;drive#permissionList&quot;, # This is always drive#permissionList.
455 &quot;nextPageToken&quot;: &quot;A String&quot;, # 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.
456 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this list.
457}</pre>
John Asmuth614db982014-04-24 15:46:26 -0400458</div>
459
460<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400461 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
462 <pre>Retrieves the next page of results.
463
464Args:
465 previous_request: The request for the previous page. (required)
466 previous_response: The response from the request for the previous page. (required)
467
468Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700469 A request object that you can call &#x27;execute()&#x27; on to request the next
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400470 page. Returns None if there are no more items in the collection.
471 </pre>
472</div>
473
474<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700475 <code class="details" id="patch">patch(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700476 <pre>Updates a permission using patch semantics.
John Asmuth614db982014-04-24 15:46:26 -0400477
478Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700479 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400480 permissionId: string, The ID for the permission. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700481 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400482 The object takes the form of:
483
484{ # A permission for a file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700485 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
486 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400487 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700488 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
489 &quot;deleted&quot;: True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
490 &quot;domain&quot;: &quot;A String&quot;, # 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.
491 &quot;emailAddress&quot;: &quot;A String&quot;, # 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.
492 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
493 &quot;expirationDate&quot;: &quot;A String&quot;, # 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 -0700494 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400495 # - They can only be set on user and group permissions
496 # - The date must be in the future
497 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700498 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Bu Sun Kim65020912020-05-20 12:08:20 -0700499 &quot;id&quot;: &quot;A String&quot;, # 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.
500 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
501 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800502 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Bu Sun Kim65020912020-05-20 12:08:20 -0700503 &quot;permissionDetails&quot;: [ # 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.
504 {
505 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
506 &quot;A String&quot;,
507 ],
508 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
509 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
510 &quot;permissionType&quot;: &quot;A String&quot;, # The permission type for this user. While new values may be added in future, the following are currently possible:
511 # - file
512 # - member
513 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be added in the future, the following are currently possible:
514 # - organizer
515 # - fileOrganizer
516 # - writer
517 # - reader
518 },
519 ],
520 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
521 &quot;role&quot;: &quot;A String&quot;, # 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 -0400522 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700523 # - organizer
524 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400525 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700526 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700527 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
528 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
529 {
530 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
531 &quot;A String&quot;,
532 ],
533 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
534 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
535 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
536 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
537 },
538 ],
539 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
John Asmuth614db982014-04-24 15:46:26 -0400540 # - user
541 # - group
542 # - domain
543 # - anyone
Bu Sun Kim65020912020-05-20 12:08:20 -0700544 &quot;value&quot;: &quot;A String&quot;, # 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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700545 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.
Bu Sun Kim65020912020-05-20 12:08:20 -0700546 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
John Asmuth614db982014-04-24 15:46:26 -0400547}
548
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700549 removeExpiration: boolean, Whether to remove the expiration date.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700550 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700551 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
552 transferOwnership: boolean, Whether changing a role to &#x27;owner&#x27; downgrades the current owners to writers. Does nothing if the specified role is not &#x27;owner&#x27;.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700553 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 -0400554
555Returns:
556 An object of the form:
557
558 { # A permission for a file.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800559 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
560 &quot;A String&quot;,
561 ],
562 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
563 &quot;deleted&quot;: True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
564 &quot;domain&quot;: &quot;A String&quot;, # 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.
565 &quot;emailAddress&quot;: &quot;A String&quot;, # 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.
566 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
567 &quot;expirationDate&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
568 # - They cannot be set on shared drive items
569 # - They can only be set on user and group permissions
570 # - The date must be in the future
571 # - The date cannot be more than a year in the future
572 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
573 &quot;id&quot;: &quot;A String&quot;, # 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.
574 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
575 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800576 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800577 &quot;permissionDetails&quot;: [ # 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.
578 {
579 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
580 &quot;A String&quot;,
581 ],
582 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
583 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
584 &quot;permissionType&quot;: &quot;A String&quot;, # The permission type for this user. While new values may be added in future, the following are currently possible:
585 # - file
586 # - member
587 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be added in the future, the following are currently possible:
588 # - organizer
589 # - fileOrganizer
590 # - writer
591 # - reader
592 },
593 ],
594 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
595 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
596 # - owner
597 # - organizer
598 # - fileOrganizer
599 # - writer
600 # - reader
601 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
602 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
603 {
604 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
605 &quot;A String&quot;,
606 ],
607 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
608 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
609 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
610 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
611 },
612 ],
613 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
614 # - user
615 # - group
616 # - domain
617 # - anyone
618 &quot;value&quot;: &quot;A String&quot;, # 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.
619 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.
620 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
621}</pre>
John Asmuth614db982014-04-24 15:46:26 -0400622</div>
623
624<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700625 <code class="details" id="update">update(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400626 <pre>Updates a permission.
627
628Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700629 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400630 permissionId: string, The ID for the permission. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700631 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400632 The object takes the form of:
633
634{ # A permission for a file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700635 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
636 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400637 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700638 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
639 &quot;deleted&quot;: True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
640 &quot;domain&quot;: &quot;A String&quot;, # 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.
641 &quot;emailAddress&quot;: &quot;A String&quot;, # 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.
642 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
643 &quot;expirationDate&quot;: &quot;A String&quot;, # 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 -0700644 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400645 # - They can only be set on user and group permissions
646 # - The date must be in the future
647 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700648 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Bu Sun Kim65020912020-05-20 12:08:20 -0700649 &quot;id&quot;: &quot;A String&quot;, # 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.
650 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
651 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800652 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Bu Sun Kim65020912020-05-20 12:08:20 -0700653 &quot;permissionDetails&quot;: [ # 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.
654 {
655 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
656 &quot;A String&quot;,
657 ],
658 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
659 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
660 &quot;permissionType&quot;: &quot;A String&quot;, # The permission type for this user. While new values may be added in future, the following are currently possible:
661 # - file
662 # - member
663 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be added in the future, the following are currently possible:
664 # - organizer
665 # - fileOrganizer
666 # - writer
667 # - reader
668 },
669 ],
670 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
671 &quot;role&quot;: &quot;A String&quot;, # 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 -0400672 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700673 # - organizer
674 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400675 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700676 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700677 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
678 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
679 {
680 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
681 &quot;A String&quot;,
682 ],
683 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
684 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
685 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
686 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
687 },
688 ],
689 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
John Asmuth614db982014-04-24 15:46:26 -0400690 # - user
691 # - group
692 # - domain
693 # - anyone
Bu Sun Kim65020912020-05-20 12:08:20 -0700694 &quot;value&quot;: &quot;A String&quot;, # 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.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700695 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.
Bu Sun Kim65020912020-05-20 12:08:20 -0700696 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
John Asmuth614db982014-04-24 15:46:26 -0400697}
698
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700699 removeExpiration: boolean, Whether to remove the expiration date.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700700 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700701 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
yoshi-code-bot1a4514d2021-07-13 00:20:24 -0700702 transferOwnership: boolean, Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. File owners can only transfer ownership of files existing on My Drive. Files existing in a shared drive are owned by the organization that owns that shared drive. Ownership transfers are not supported for files and folders in shared drives. Organizers of a shared drive can move items from that shared drive into their My Drive which transfers the ownership to them.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700703 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 -0400704
705Returns:
706 An object of the form:
707
708 { # A permission for a file.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800709 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
710 &quot;A String&quot;,
711 ],
712 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
713 &quot;deleted&quot;: True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
714 &quot;domain&quot;: &quot;A String&quot;, # 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.
715 &quot;emailAddress&quot;: &quot;A String&quot;, # 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.
716 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
717 &quot;expirationDate&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
718 # - They cannot be set on shared drive items
719 # - They can only be set on user and group permissions
720 # - The date must be in the future
721 # - The date cannot be more than a year in the future
722 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
723 &quot;id&quot;: &quot;A String&quot;, # 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.
724 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
725 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800726 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800727 &quot;permissionDetails&quot;: [ # 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.
728 {
729 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
730 &quot;A String&quot;,
731 ],
732 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
733 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
734 &quot;permissionType&quot;: &quot;A String&quot;, # The permission type for this user. While new values may be added in future, the following are currently possible:
735 # - file
736 # - member
737 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be added in the future, the following are currently possible:
738 # - organizer
739 # - fileOrganizer
740 # - writer
741 # - reader
742 },
743 ],
744 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
745 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
746 # - owner
747 # - organizer
748 # - fileOrganizer
749 # - writer
750 # - reader
751 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
752 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
753 {
754 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
755 &quot;A String&quot;,
756 ],
757 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
758 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
759 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
760 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
761 },
762 ],
763 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
764 # - user
765 # - group
766 # - domain
767 # - anyone
768 &quot;value&quot;: &quot;A String&quot;, # 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.
769 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value.
770 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
771}</pre>
John Asmuth614db982014-04-24 15:46:26 -0400772</div>
773
774</body></html>