1<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">
78  <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
81  <code><a href="#delete">delete(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p>
82<p class="firstline">Deletes a permission from a file or shared drive.</p>
83<p class="toc_element">
84  <code><a href="#get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p>
85<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">
90  <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>
91<p class="firstline">Inserts a permission for a file or shared drive.</p>
92<p class="toc_element">
93  <code><a href="#list">list(fileId, includePermissionsForView=None, maxResults=None, pageToken=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p>
94<p class="firstline">Lists a file's or shared drive's permissions.</p>
95<p class="toc_element">
96  <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">
99  <code><a href="#patch">patch(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</a></code></p>
100<p class="firstline">Updates a permission using patch semantics.</p>
101<p class="toc_element">
102  <code><a href="#update">update(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</a></code></p>
103<p class="firstline">Updates a permission.</p>
104<h3>Method Details</h3>
105<div class="method">
106    <code class="details" id="close">close()</code>
107  <pre>Close httplib2 connections.</pre>
108</div>
109
110<div class="method">
111    <code class="details" id="delete">delete(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
112  <pre>Deletes a permission from a file or shared drive.
113
114Args:
115  fileId: string, The ID for the file or shared drive. (required)
116  permissionId: string, The ID for the permission. (required)
117  supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
118  supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
119  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.
120</pre>
121</div>
122
123<div class="method">
124    <code class="details" id="get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
125  <pre>Gets a permission by ID.
126
127Args:
128  fileId: string, The ID for the file or shared drive. (required)
129  permissionId: string, The ID for the permission. (required)
130  supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
131  supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
132  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.
133
134Returns:
135  An object of the form:
136
137    { # A permission for a file.
138  &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.
155  &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.
156  &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>
201</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.
214  &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>
217</div>
218
219<div class="method">
220    <code class="details" id="insert">insert(fileId, body=None, emailMessage=None, enforceSingleParent=None, moveToNewOwnersRoot=None, sendNotificationEmails=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
221  <pre>Inserts a permission for a file or shared drive.
222
223Args:
224  fileId: string, The ID for the file or shared drive. (required)
225  body: object, The request body.
226    The object takes the form of:
227
228{ # A permission for a file.
229  &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;,
231  ],
232  &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:
238      # - They cannot be set on shared drive items
239      # - 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
242      # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
243  &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.
246  &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.
247  &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:
266      # - owner
267      # - organizer
268      # - fileOrganizer
269      # - writer
270      # - reader
271  &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:
284      # - user
285      # - group
286      # - domain
287      # - anyone
288  &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.
289  &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.
290  &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
291}
292
293  emailMessage: string, A plain text custom message to include in notification emails.
294  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.
296  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.
297  supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
298  supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
299  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.
300
301Returns:
302  An object of the form:
303
304    { # A permission for a file.
305  &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.
322  &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.
323  &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>
368</div>
369
370<div class="method">
371    <code class="details" id="list">list(fileId, includePermissionsForView=None, maxResults=None, pageToken=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
372  <pre>Lists a file&#x27;s or shared drive&#x27;s permissions.
373
374Args:
375  fileId: string, The ID for the file or shared drive. (required)
376  includePermissionsForView: string, Specifies which additional view&#x27;s permissions to include in the response. Only &#x27;published&#x27; is supported.
377  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.
378  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.
379  supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
380  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.
382
383Returns:
384  An object of the form:
385
386    { # A list of permissions associated with a file.
387  &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.
407      &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.
408      &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>
458</div>
459
460<div class="method">
461    <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:
469  A request object that you can call &#x27;execute()&#x27; on to request the next
470  page. Returns None if there are no more items in the collection.
471    </pre>
472</div>
473
474<div class="method">
475    <code class="details" id="patch">patch(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</code>
476  <pre>Updates a permission using patch semantics.
477
478Args:
479  fileId: string, The ID for the file or shared drive. (required)
480  permissionId: string, The ID for the permission. (required)
481  body: object, The request body.
482    The object takes the form of:
483
484{ # A permission for a file.
485  &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;,
487  ],
488  &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:
494      # - They cannot be set on shared drive items
495      # - 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
498      # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
499  &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.
502  &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.
503  &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:
522      # - owner
523      # - organizer
524      # - fileOrganizer
525      # - writer
526      # - reader
527  &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:
540      # - user
541      # - group
542      # - domain
543      # - anyone
544  &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.
545  &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.
546  &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
547}
548
549  removeExpiration: boolean, Whether to remove the expiration date.
550  supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
551  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;.
553  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.
554
555Returns:
556  An object of the form:
557
558    { # A permission for a file.
559  &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.
576  &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.
577  &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>
622</div>
623
624<div class="method">
625    <code class="details" id="update">update(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</code>
626  <pre>Updates a permission.
627
628Args:
629  fileId: string, The ID for the file or shared drive. (required)
630  permissionId: string, The ID for the permission. (required)
631  body: object, The request body.
632    The object takes the form of:
633
634{ # A permission for a file.
635  &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;,
637  ],
638  &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:
644      # - They cannot be set on shared drive items
645      # - 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
648      # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
649  &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.
652  &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.
653  &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:
672      # - owner
673      # - organizer
674      # - fileOrganizer
675      # - writer
676      # - reader
677  &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:
690      # - user
691      # - group
692      # - domain
693      # - anyone
694  &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.
695  &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.
696  &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
697}
698
699  removeExpiration: boolean, Whether to remove the expiration date.
700  supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
701  supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
702  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.
703  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.
704
705Returns:
706  An object of the form:
707
708    { # A permission for a file.
709  &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.
726  &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.
727  &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>
772</div>
773
774</body></html>