Debian Codegraph @

docs/dyn/drive_v3.permissions.html

raw
1 <html><body>
2 <style>
3
4 body, 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
15 body {
16 font-size: 13px;
17 padding: 1em;
18 }
19
20 h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23 }
24
25 h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28 }
29
30 h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34 }
35
36 pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39 }
40
41 pre {
42 margin-top: 0.5em;
43 }
44
45 h1, h2, h3, p {
46 font-family: Arial, sans serif;
47 }
48
49 h1, 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_v3.html">Google Drive API</a> . <a href="drive_v3.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="#create">create(fileId, body=None, emailMessage=None, enforceExpansiveAccess=None, enforceSingleParent=None, moveToNewOwnersRoot=None, sendNotificationEmail=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None, x__xgafv=None)</a></code></p>
82 <p class="firstline">Creates a permission for a file or shared drive. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing). **Warning:** Concurrent permissions operations on the same file aren't supported; only the last update is applied.</p>
83 <p class="toc_element">
84 <code><a href="#delete">delete(fileId, permissionId, enforceExpansiveAccess=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None, x__xgafv=None)</a></code></p>
85 <p class="firstline">Deletes a permission. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing). **Warning:** Concurrent permissions operations on the same file aren't supported; only the last update is applied.</p>
86 <p class="toc_element">
87 <code><a href="#get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None, x__xgafv=None)</a></code></p>
88 <p class="firstline">Gets a permission by ID. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing).</p>
89 <p class="toc_element">
90 <code><a href="#list">list(fileId, includePermissionsForView=None, pageSize=None, pageToken=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None, x__xgafv=None)</a></code></p>
91 <p class="firstline">Lists a file's or shared drive's permissions. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing).</p>
92 <p class="toc_element">
93 <code><a href="#list_next">list_next()</a></code></p>
94 <p class="firstline">Retrieves the next page of results.</p>
95 <p class="toc_element">
96 <code><a href="#update">update(fileId, permissionId, body=None, enforceExpansiveAccess=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None, x__xgafv=None)</a></code></p>
97 <p class="firstline">Updates a permission with patch semantics. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing). **Warning:** Concurrent permissions operations on the same file aren't supported; only the last update is applied.</p>
98 <h3>Method Details</h3>
99 <div class="method">
100 <code class="details" id="close">close()</code>
101 <pre>Close httplib2 connections.</pre>
102 </div>
103
104 <div class="method">
105 <code class="details" id="create">create(fileId, body=None, emailMessage=None, enforceExpansiveAccess=None, enforceSingleParent=None, moveToNewOwnersRoot=None, sendNotificationEmail=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None, x__xgafv=None)</code>
106 <pre>Creates a permission for a file or shared drive. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing). **Warning:** Concurrent permissions operations on the same file aren&#x27;t supported; only the last update is applied.
107
108 Args:
109 fileId: string, The ID of the file or shared drive. (required)
110 body: object, The request body.
111 The object takes the form of:
112
113 { # A permission for a file. A permission grants a user, group, domain, or the world access to a file or a folder hierarchy. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing). By default, permission requests only return a subset of fields. Permission `kind`, `ID`, `type`, and `role` are always returned. To retrieve specific fields, see [Return specific fields](https://developers.google.com/workspace/drive/api/guides/fields-parameter). Some resource methods (such as `permissions.update`) require a `permissionId`. Use the `permissions.list` method to retrieve the ID for a file, folder, or shared drive.
114 &quot;allowFileDiscovery&quot;: True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type `domain` or `anyone`.
115 &quot;deleted&quot;: True or False, # Output only. Whether the account associated with this permission has been deleted. This field only pertains to permissions of type `user` or `group`.
116 &quot;displayName&quot;: &quot;A String&quot;, # Output only. The &quot;pretty&quot; name of the value of the permission. The following is a list of examples for each type of permission: * `user` - User&#x27;s full name, as defined for their Google Account, such as &quot;Dana A.&quot; * `group` - Name of the Google Group, such as &quot;The Company Administrators.&quot; * `domain` - String domain name, such as &quot;cymbalgroup.com.&quot; * `anyone` - No `displayName` is present.
117 &quot;domain&quot;: &quot;A String&quot;, # Output only. The domain to which this permission refers.
118 &quot;emailAddress&quot;: &quot;A String&quot;, # Output only. The email address of the user or group to which this permission refers.
119 &quot;expirationTime&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: - They can only be set on user and group permissions - The time must be in the future - The time cannot be more than a year in the future
120 &quot;id&quot;: &quot;A String&quot;, # Output only. The ID of this permission. This is a unique identifier for the grantee, and is published in the [User resource](https://developers.google.com/workspace/drive/api/reference/rest/v3/User) as `permissionId`. IDs should be treated as opaque values.
121 &quot;inheritedPermissionsDisabled&quot;: True or False, # When `true`, only organizers, owners, and users with permissions added directly on the item can access it.
122 &quot;kind&quot;: &quot;drive#permission&quot;, # Output only. Identifies what kind of resource this is. Value: the fixed string `&quot;drive#permission&quot;`.
123 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for permissions of type `user` for files that aren&#x27;t in a shared drive.
124 &quot;permissionDetails&quot;: [ # Output only. Details of whether the permissions on this item are inherited or are directly on this item.
125 {
126 &quot;inherited&quot;: True or False, # Output only. Whether this permission is inherited. This field is always populated. This is an output-only field.
127 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Output only. The ID of the item from which this permission is inherited. This is only populated for items in shared drives.
128 &quot;permissionType&quot;: &quot;A String&quot;, # Output only. The permission type for this user. Supported values include: * `file` * `member`
129 &quot;role&quot;: &quot;A String&quot;, # Output only. The primary role for this user. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).
130 },
131 ],
132 &quot;photoLink&quot;: &quot;A String&quot;, # Output only. A link to the user&#x27;s profile photo, if available.
133 &quot;role&quot;: &quot;A String&quot;, # The role granted by this permission. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).
134 &quot;teamDrivePermissionDetails&quot;: [ # Output only. Deprecated: Output only. Use `permissionDetails` instead.
135 {
136 &quot;inherited&quot;: True or False, # Deprecated: Output only. Use `permissionDetails/inherited` instead.
137 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/inheritedFrom` instead.
138 &quot;role&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/role` instead.
139 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/permissionType` instead.
140 },
141 ],
142 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Supported values include: * `user` * `group` * `domain` * `anyone` When creating a permission, if `type` is `user` or `group`, you must provide an `emailAddress` for the user or group. If `type` is `domain`, you must provide a `domain`. If `type` is `anyone`, no extra information is required.
143 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. The only supported values are `published` and `metadata`: * `published`: The permission&#x27;s role is `publishedReader`. * `metadata`: The item is only visible to the `metadata` view because the item has limited access and the scope has at least read access to the parent. The `metadata` view is only supported on folders. For more information, see [Views](https://developers.google.com/workspace/drive/api/guides/ref-roles#views).
144 }
145
146 emailMessage: string, A plain text custom message to include in the notification email.
147 enforceExpansiveAccess: boolean, Deprecated: All requests use the expansive access rules.
148 enforceSingleParent: boolean, Deprecated: See `moveToNewOwnersRoot` for details.
149 moveToNewOwnersRoot: boolean, This parameter only takes effect if the item isn&#x27;t in a shared drive and the request is attempting to transfer the ownership of the item. If set to `true`, the item is moved to the new owner&#x27;s My Drive root folder and all prior parents removed. If set to `false`, parents aren&#x27;t changed.
150 sendNotificationEmail: boolean, Whether to send a notification email when sharing to users or groups. This defaults to `true` for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers.
151 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
152 supportsTeamDrives: boolean, Deprecated: Use `supportsAllDrives` instead.
153 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. For more information, see [Transfer file ownership](https://developers.google.com/workspace/drive/api/guides/transfer-file).
154 useDomainAdminAccess: boolean, Issue the request as a domain administrator. If set to `true`, and if the following additional conditions are met, the requester is granted access: 1. The file ID parameter refers to a shared drive. 2. The requester is an administrator of the domain to which the shared drive belongs. For more information, see [Manage shared drives as domain administrators](https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).
155 x__xgafv: string, V1 error format.
156 Allowed values
157 1 - v1 error format
158 2 - v2 error format
159
160 Returns:
161 An object of the form:
162
163 { # A permission for a file. A permission grants a user, group, domain, or the world access to a file or a folder hierarchy. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing). By default, permission requests only return a subset of fields. Permission `kind`, `ID`, `type`, and `role` are always returned. To retrieve specific fields, see [Return specific fields](https://developers.google.com/workspace/drive/api/guides/fields-parameter). Some resource methods (such as `permissions.update`) require a `permissionId`. Use the `permissions.list` method to retrieve the ID for a file, folder, or shared drive.
164 &quot;allowFileDiscovery&quot;: True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type `domain` or `anyone`.
165 &quot;deleted&quot;: True or False, # Output only. Whether the account associated with this permission has been deleted. This field only pertains to permissions of type `user` or `group`.
166 &quot;displayName&quot;: &quot;A String&quot;, # Output only. The &quot;pretty&quot; name of the value of the permission. The following is a list of examples for each type of permission: * `user` - User&#x27;s full name, as defined for their Google Account, such as &quot;Dana A.&quot; * `group` - Name of the Google Group, such as &quot;The Company Administrators.&quot; * `domain` - String domain name, such as &quot;cymbalgroup.com.&quot; * `anyone` - No `displayName` is present.
167 &quot;domain&quot;: &quot;A String&quot;, # Output only. The domain to which this permission refers.
168 &quot;emailAddress&quot;: &quot;A String&quot;, # Output only. The email address of the user or group to which this permission refers.
169 &quot;expirationTime&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: - They can only be set on user and group permissions - The time must be in the future - The time cannot be more than a year in the future
170 &quot;id&quot;: &quot;A String&quot;, # Output only. The ID of this permission. This is a unique identifier for the grantee, and is published in the [User resource](https://developers.google.com/workspace/drive/api/reference/rest/v3/User) as `permissionId`. IDs should be treated as opaque values.
171 &quot;inheritedPermissionsDisabled&quot;: True or False, # When `true`, only organizers, owners, and users with permissions added directly on the item can access it.
172 &quot;kind&quot;: &quot;drive#permission&quot;, # Output only. Identifies what kind of resource this is. Value: the fixed string `&quot;drive#permission&quot;`.
173 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for permissions of type `user` for files that aren&#x27;t in a shared drive.
174 &quot;permissionDetails&quot;: [ # Output only. Details of whether the permissions on this item are inherited or are directly on this item.
175 {
176 &quot;inherited&quot;: True or False, # Output only. Whether this permission is inherited. This field is always populated. This is an output-only field.
177 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Output only. The ID of the item from which this permission is inherited. This is only populated for items in shared drives.
178 &quot;permissionType&quot;: &quot;A String&quot;, # Output only. The permission type for this user. Supported values include: * `file` * `member`
179 &quot;role&quot;: &quot;A String&quot;, # Output only. The primary role for this user. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).
180 },
181 ],
182 &quot;photoLink&quot;: &quot;A String&quot;, # Output only. A link to the user&#x27;s profile photo, if available.
183 &quot;role&quot;: &quot;A String&quot;, # The role granted by this permission. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).
184 &quot;teamDrivePermissionDetails&quot;: [ # Output only. Deprecated: Output only. Use `permissionDetails` instead.
185 {
186 &quot;inherited&quot;: True or False, # Deprecated: Output only. Use `permissionDetails/inherited` instead.
187 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/inheritedFrom` instead.
188 &quot;role&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/role` instead.
189 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/permissionType` instead.
190 },
191 ],
192 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Supported values include: * `user` * `group` * `domain` * `anyone` When creating a permission, if `type` is `user` or `group`, you must provide an `emailAddress` for the user or group. If `type` is `domain`, you must provide a `domain`. If `type` is `anyone`, no extra information is required.
193 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. The only supported values are `published` and `metadata`: * `published`: The permission&#x27;s role is `publishedReader`. * `metadata`: The item is only visible to the `metadata` view because the item has limited access and the scope has at least read access to the parent. The `metadata` view is only supported on folders. For more information, see [Views](https://developers.google.com/workspace/drive/api/guides/ref-roles#views).
194 }</pre>
195 </div>
196
197 <div class="method">
198 <code class="details" id="delete">delete(fileId, permissionId, enforceExpansiveAccess=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None, x__xgafv=None)</code>
199 <pre>Deletes a permission. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing). **Warning:** Concurrent permissions operations on the same file aren&#x27;t supported; only the last update is applied.
200
201 Args:
202 fileId: string, The ID of the file or shared drive. (required)
203 permissionId: string, The ID of the permission. (required)
204 enforceExpansiveAccess: boolean, Deprecated: All requests use the expansive access rules.
205 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
206 supportsTeamDrives: boolean, Deprecated: Use `supportsAllDrives` instead.
207 useDomainAdminAccess: boolean, Issue the request as a domain administrator. If set to `true`, and if the following additional conditions are met, the requester is granted access: 1. The file ID parameter refers to a shared drive. 2. The requester is an administrator of the domain to which the shared drive belongs. For more information, see [Manage shared drives as domain administrators](https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).
208 x__xgafv: string, V1 error format.
209 Allowed values
210 1 - v1 error format
211 2 - v2 error format
212 </pre>
213 </div>
214
215 <div class="method">
216 <code class="details" id="get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None, x__xgafv=None)</code>
217 <pre>Gets a permission by ID. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing).
218
219 Args:
220 fileId: string, The ID of the file. (required)
221 permissionId: string, The ID of the permission. (required)
222 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
223 supportsTeamDrives: boolean, Deprecated: Use `supportsAllDrives` instead.
224 useDomainAdminAccess: boolean, Issue the request as a domain administrator. If set to `true`, and if the following additional conditions are met, the requester is granted access: 1. The file ID parameter refers to a shared drive. 2. The requester is an administrator of the domain to which the shared drive belongs. For more information, see [Manage shared drives as domain administrators](https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).
225 x__xgafv: string, V1 error format.
226 Allowed values
227 1 - v1 error format
228 2 - v2 error format
229
230 Returns:
231 An object of the form:
232
233 { # A permission for a file. A permission grants a user, group, domain, or the world access to a file or a folder hierarchy. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing). By default, permission requests only return a subset of fields. Permission `kind`, `ID`, `type`, and `role` are always returned. To retrieve specific fields, see [Return specific fields](https://developers.google.com/workspace/drive/api/guides/fields-parameter). Some resource methods (such as `permissions.update`) require a `permissionId`. Use the `permissions.list` method to retrieve the ID for a file, folder, or shared drive.
234 &quot;allowFileDiscovery&quot;: True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type `domain` or `anyone`.
235 &quot;deleted&quot;: True or False, # Output only. Whether the account associated with this permission has been deleted. This field only pertains to permissions of type `user` or `group`.
236 &quot;displayName&quot;: &quot;A String&quot;, # Output only. The &quot;pretty&quot; name of the value of the permission. The following is a list of examples for each type of permission: * `user` - User&#x27;s full name, as defined for their Google Account, such as &quot;Dana A.&quot; * `group` - Name of the Google Group, such as &quot;The Company Administrators.&quot; * `domain` - String domain name, such as &quot;cymbalgroup.com.&quot; * `anyone` - No `displayName` is present.
237 &quot;domain&quot;: &quot;A String&quot;, # Output only. The domain to which this permission refers.
238 &quot;emailAddress&quot;: &quot;A String&quot;, # Output only. The email address of the user or group to which this permission refers.
239 &quot;expirationTime&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: - They can only be set on user and group permissions - The time must be in the future - The time cannot be more than a year in the future
240 &quot;id&quot;: &quot;A String&quot;, # Output only. The ID of this permission. This is a unique identifier for the grantee, and is published in the [User resource](https://developers.google.com/workspace/drive/api/reference/rest/v3/User) as `permissionId`. IDs should be treated as opaque values.
241 &quot;inheritedPermissionsDisabled&quot;: True or False, # When `true`, only organizers, owners, and users with permissions added directly on the item can access it.
242 &quot;kind&quot;: &quot;drive#permission&quot;, # Output only. Identifies what kind of resource this is. Value: the fixed string `&quot;drive#permission&quot;`.
243 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for permissions of type `user` for files that aren&#x27;t in a shared drive.
244 &quot;permissionDetails&quot;: [ # Output only. Details of whether the permissions on this item are inherited or are directly on this item.
245 {
246 &quot;inherited&quot;: True or False, # Output only. Whether this permission is inherited. This field is always populated. This is an output-only field.
247 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Output only. The ID of the item from which this permission is inherited. This is only populated for items in shared drives.
248 &quot;permissionType&quot;: &quot;A String&quot;, # Output only. The permission type for this user. Supported values include: * `file` * `member`
249 &quot;role&quot;: &quot;A String&quot;, # Output only. The primary role for this user. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).
250 },
251 ],
252 &quot;photoLink&quot;: &quot;A String&quot;, # Output only. A link to the user&#x27;s profile photo, if available.
253 &quot;role&quot;: &quot;A String&quot;, # The role granted by this permission. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).
254 &quot;teamDrivePermissionDetails&quot;: [ # Output only. Deprecated: Output only. Use `permissionDetails` instead.
255 {
256 &quot;inherited&quot;: True or False, # Deprecated: Output only. Use `permissionDetails/inherited` instead.
257 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/inheritedFrom` instead.
258 &quot;role&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/role` instead.
259 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/permissionType` instead.
260 },
261 ],
262 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Supported values include: * `user` * `group` * `domain` * `anyone` When creating a permission, if `type` is `user` or `group`, you must provide an `emailAddress` for the user or group. If `type` is `domain`, you must provide a `domain`. If `type` is `anyone`, no extra information is required.
263 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. The only supported values are `published` and `metadata`: * `published`: The permission&#x27;s role is `publishedReader`. * `metadata`: The item is only visible to the `metadata` view because the item has limited access and the scope has at least read access to the parent. The `metadata` view is only supported on folders. For more information, see [Views](https://developers.google.com/workspace/drive/api/guides/ref-roles#views).
264 }</pre>
265 </div>
266
267 <div class="method">
268 <code class="details" id="list">list(fileId, includePermissionsForView=None, pageSize=None, pageToken=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None, x__xgafv=None)</code>
269 <pre>Lists a file&#x27;s or shared drive&#x27;s permissions. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing).
270
271 Args:
272 fileId: string, The ID of the file or shared drive. (required)
273 includePermissionsForView: string, Specifies which additional view&#x27;s permissions to include in the response. Only `published` is supported.
274 pageSize: 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.
275 pageToken: string, The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from the previous response.
276 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
277 supportsTeamDrives: boolean, Deprecated: Use `supportsAllDrives` instead.
278 useDomainAdminAccess: boolean, Issue the request as a domain administrator. If set to `true`, and if the following additional conditions are met, the requester is granted access: 1. The file ID parameter refers to a shared drive. 2. The requester is an administrator of the domain to which the shared drive belongs. For more information, see [Manage shared drives as domain administrators](https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).
279 x__xgafv: string, V1 error format.
280 Allowed values
281 1 - v1 error format
282 2 - v2 error format
283
284 Returns:
285 An object of the form:
286
287 { # A list of permissions for a file.
288 &quot;kind&quot;: &quot;drive#permissionList&quot;, # Identifies what kind of resource this is. Value: the fixed string `&quot;drive#permissionList&quot;`.
289 &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. The page token is typically valid for several hours. However, if new items are added or removed, your expected results might differ.
290 &quot;permissions&quot;: [ # The list of permissions. If `nextPageToken` is populated, then this list may be incomplete and an additional page of results should be fetched.
291 { # A permission for a file. A permission grants a user, group, domain, or the world access to a file or a folder hierarchy. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing). By default, permission requests only return a subset of fields. Permission `kind`, `ID`, `type`, and `role` are always returned. To retrieve specific fields, see [Return specific fields](https://developers.google.com/workspace/drive/api/guides/fields-parameter). Some resource methods (such as `permissions.update`) require a `permissionId`. Use the `permissions.list` method to retrieve the ID for a file, folder, or shared drive.
292 &quot;allowFileDiscovery&quot;: True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type `domain` or `anyone`.
293 &quot;deleted&quot;: True or False, # Output only. Whether the account associated with this permission has been deleted. This field only pertains to permissions of type `user` or `group`.
294 &quot;displayName&quot;: &quot;A String&quot;, # Output only. The &quot;pretty&quot; name of the value of the permission. The following is a list of examples for each type of permission: * `user` - User&#x27;s full name, as defined for their Google Account, such as &quot;Dana A.&quot; * `group` - Name of the Google Group, such as &quot;The Company Administrators.&quot; * `domain` - String domain name, such as &quot;cymbalgroup.com.&quot; * `anyone` - No `displayName` is present.
295 &quot;domain&quot;: &quot;A String&quot;, # Output only. The domain to which this permission refers.
296 &quot;emailAddress&quot;: &quot;A String&quot;, # Output only. The email address of the user or group to which this permission refers.
297 &quot;expirationTime&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: - They can only be set on user and group permissions - The time must be in the future - The time cannot be more than a year in the future
298 &quot;id&quot;: &quot;A String&quot;, # Output only. The ID of this permission. This is a unique identifier for the grantee, and is published in the [User resource](https://developers.google.com/workspace/drive/api/reference/rest/v3/User) as `permissionId`. IDs should be treated as opaque values.
299 &quot;inheritedPermissionsDisabled&quot;: True or False, # When `true`, only organizers, owners, and users with permissions added directly on the item can access it.
300 &quot;kind&quot;: &quot;drive#permission&quot;, # Output only. Identifies what kind of resource this is. Value: the fixed string `&quot;drive#permission&quot;`.
301 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for permissions of type `user` for files that aren&#x27;t in a shared drive.
302 &quot;permissionDetails&quot;: [ # Output only. Details of whether the permissions on this item are inherited or are directly on this item.
303 {
304 &quot;inherited&quot;: True or False, # Output only. Whether this permission is inherited. This field is always populated. This is an output-only field.
305 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Output only. The ID of the item from which this permission is inherited. This is only populated for items in shared drives.
306 &quot;permissionType&quot;: &quot;A String&quot;, # Output only. The permission type for this user. Supported values include: * `file` * `member`
307 &quot;role&quot;: &quot;A String&quot;, # Output only. The primary role for this user. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).
308 },
309 ],
310 &quot;photoLink&quot;: &quot;A String&quot;, # Output only. A link to the user&#x27;s profile photo, if available.
311 &quot;role&quot;: &quot;A String&quot;, # The role granted by this permission. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).
312 &quot;teamDrivePermissionDetails&quot;: [ # Output only. Deprecated: Output only. Use `permissionDetails` instead.
313 {
314 &quot;inherited&quot;: True or False, # Deprecated: Output only. Use `permissionDetails/inherited` instead.
315 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/inheritedFrom` instead.
316 &quot;role&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/role` instead.
317 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/permissionType` instead.
318 },
319 ],
320 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Supported values include: * `user` * `group` * `domain` * `anyone` When creating a permission, if `type` is `user` or `group`, you must provide an `emailAddress` for the user or group. If `type` is `domain`, you must provide a `domain`. If `type` is `anyone`, no extra information is required.
321 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. The only supported values are `published` and `metadata`: * `published`: The permission&#x27;s role is `publishedReader`. * `metadata`: The item is only visible to the `metadata` view because the item has limited access and the scope has at least read access to the parent. The `metadata` view is only supported on folders. For more information, see [Views](https://developers.google.com/workspace/drive/api/guides/ref-roles#views).
322 },
323 ],
324 }</pre>
325 </div>
326
327 <div class="method">
328 <code class="details" id="list_next">list_next()</code>
329 <pre>Retrieves the next page of results.
330
331 Args:
332 previous_request: The request for the previous page. (required)
333 previous_response: The response from the request for the previous page. (required)
334
335 Returns:
336 A request object that you can call &#x27;execute()&#x27; on to request the next
337 page. Returns None if there are no more items in the collection.
338 </pre>
339 </div>
340
341 <div class="method">
342 <code class="details" id="update">update(fileId, permissionId, body=None, enforceExpansiveAccess=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None, x__xgafv=None)</code>
343 <pre>Updates a permission with patch semantics. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing). **Warning:** Concurrent permissions operations on the same file aren&#x27;t supported; only the last update is applied.
344
345 Args:
346 fileId: string, The ID of the file or shared drive. (required)
347 permissionId: string, The ID of the permission. (required)
348 body: object, The request body.
349 The object takes the form of:
350
351 { # A permission for a file. A permission grants a user, group, domain, or the world access to a file or a folder hierarchy. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing). By default, permission requests only return a subset of fields. Permission `kind`, `ID`, `type`, and `role` are always returned. To retrieve specific fields, see [Return specific fields](https://developers.google.com/workspace/drive/api/guides/fields-parameter). Some resource methods (such as `permissions.update`) require a `permissionId`. Use the `permissions.list` method to retrieve the ID for a file, folder, or shared drive.
352 &quot;allowFileDiscovery&quot;: True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type `domain` or `anyone`.
353 &quot;deleted&quot;: True or False, # Output only. Whether the account associated with this permission has been deleted. This field only pertains to permissions of type `user` or `group`.
354 &quot;displayName&quot;: &quot;A String&quot;, # Output only. The &quot;pretty&quot; name of the value of the permission. The following is a list of examples for each type of permission: * `user` - User&#x27;s full name, as defined for their Google Account, such as &quot;Dana A.&quot; * `group` - Name of the Google Group, such as &quot;The Company Administrators.&quot; * `domain` - String domain name, such as &quot;cymbalgroup.com.&quot; * `anyone` - No `displayName` is present.
355 &quot;domain&quot;: &quot;A String&quot;, # Output only. The domain to which this permission refers.
356 &quot;emailAddress&quot;: &quot;A String&quot;, # Output only. The email address of the user or group to which this permission refers.
357 &quot;expirationTime&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: - They can only be set on user and group permissions - The time must be in the future - The time cannot be more than a year in the future
358 &quot;id&quot;: &quot;A String&quot;, # Output only. The ID of this permission. This is a unique identifier for the grantee, and is published in the [User resource](https://developers.google.com/workspace/drive/api/reference/rest/v3/User) as `permissionId`. IDs should be treated as opaque values.
359 &quot;inheritedPermissionsDisabled&quot;: True or False, # When `true`, only organizers, owners, and users with permissions added directly on the item can access it.
360 &quot;kind&quot;: &quot;drive#permission&quot;, # Output only. Identifies what kind of resource this is. Value: the fixed string `&quot;drive#permission&quot;`.
361 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for permissions of type `user` for files that aren&#x27;t in a shared drive.
362 &quot;permissionDetails&quot;: [ # Output only. Details of whether the permissions on this item are inherited or are directly on this item.
363 {
364 &quot;inherited&quot;: True or False, # Output only. Whether this permission is inherited. This field is always populated. This is an output-only field.
365 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Output only. The ID of the item from which this permission is inherited. This is only populated for items in shared drives.
366 &quot;permissionType&quot;: &quot;A String&quot;, # Output only. The permission type for this user. Supported values include: * `file` * `member`
367 &quot;role&quot;: &quot;A String&quot;, # Output only. The primary role for this user. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).
368 },
369 ],
370 &quot;photoLink&quot;: &quot;A String&quot;, # Output only. A link to the user&#x27;s profile photo, if available.
371 &quot;role&quot;: &quot;A String&quot;, # The role granted by this permission. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).
372 &quot;teamDrivePermissionDetails&quot;: [ # Output only. Deprecated: Output only. Use `permissionDetails` instead.
373 {
374 &quot;inherited&quot;: True or False, # Deprecated: Output only. Use `permissionDetails/inherited` instead.
375 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/inheritedFrom` instead.
376 &quot;role&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/role` instead.
377 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/permissionType` instead.
378 },
379 ],
380 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Supported values include: * `user` * `group` * `domain` * `anyone` When creating a permission, if `type` is `user` or `group`, you must provide an `emailAddress` for the user or group. If `type` is `domain`, you must provide a `domain`. If `type` is `anyone`, no extra information is required.
381 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. The only supported values are `published` and `metadata`: * `published`: The permission&#x27;s role is `publishedReader`. * `metadata`: The item is only visible to the `metadata` view because the item has limited access and the scope has at least read access to the parent. The `metadata` view is only supported on folders. For more information, see [Views](https://developers.google.com/workspace/drive/api/guides/ref-roles#views).
382 }
383
384 enforceExpansiveAccess: boolean, Deprecated: All requests use the expansive access rules.
385 removeExpiration: boolean, Whether to remove the expiration date.
386 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
387 supportsTeamDrives: boolean, Deprecated: Use `supportsAllDrives` instead.
388 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. For more information, see [Transfer file ownership](https://developers.google.com//workspace/drive/api/guides/transfer-file).
389 useDomainAdminAccess: boolean, Issue the request as a domain administrator. If set to `true`, and if the following additional conditions are met, the requester is granted access: 1. The file ID parameter refers to a shared drive. 2. The requester is an administrator of the domain to which the shared drive belongs. For more information, see [Manage shared drives as domain administrators](https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).
390 x__xgafv: string, V1 error format.
391 Allowed values
392 1 - v1 error format
393 2 - v2 error format
394
395 Returns:
396 An object of the form:
397
398 { # A permission for a file. A permission grants a user, group, domain, or the world access to a file or a folder hierarchy. For more information, see [Share files, folders, and drives](https://developers.google.com/workspace/drive/api/guides/manage-sharing). By default, permission requests only return a subset of fields. Permission `kind`, `ID`, `type`, and `role` are always returned. To retrieve specific fields, see [Return specific fields](https://developers.google.com/workspace/drive/api/guides/fields-parameter). Some resource methods (such as `permissions.update`) require a `permissionId`. Use the `permissions.list` method to retrieve the ID for a file, folder, or shared drive.
399 &quot;allowFileDiscovery&quot;: True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type `domain` or `anyone`.
400 &quot;deleted&quot;: True or False, # Output only. Whether the account associated with this permission has been deleted. This field only pertains to permissions of type `user` or `group`.
401 &quot;displayName&quot;: &quot;A String&quot;, # Output only. The &quot;pretty&quot; name of the value of the permission. The following is a list of examples for each type of permission: * `user` - User&#x27;s full name, as defined for their Google Account, such as &quot;Dana A.&quot; * `group` - Name of the Google Group, such as &quot;The Company Administrators.&quot; * `domain` - String domain name, such as &quot;cymbalgroup.com.&quot; * `anyone` - No `displayName` is present.
402 &quot;domain&quot;: &quot;A String&quot;, # Output only. The domain to which this permission refers.
403 &quot;emailAddress&quot;: &quot;A String&quot;, # Output only. The email address of the user or group to which this permission refers.
404 &quot;expirationTime&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: - They can only be set on user and group permissions - The time must be in the future - The time cannot be more than a year in the future
405 &quot;id&quot;: &quot;A String&quot;, # Output only. The ID of this permission. This is a unique identifier for the grantee, and is published in the [User resource](https://developers.google.com/workspace/drive/api/reference/rest/v3/User) as `permissionId`. IDs should be treated as opaque values.
406 &quot;inheritedPermissionsDisabled&quot;: True or False, # When `true`, only organizers, owners, and users with permissions added directly on the item can access it.
407 &quot;kind&quot;: &quot;drive#permission&quot;, # Output only. Identifies what kind of resource this is. Value: the fixed string `&quot;drive#permission&quot;`.
408 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for permissions of type `user` for files that aren&#x27;t in a shared drive.
409 &quot;permissionDetails&quot;: [ # Output only. Details of whether the permissions on this item are inherited or are directly on this item.
410 {
411 &quot;inherited&quot;: True or False, # Output only. Whether this permission is inherited. This field is always populated. This is an output-only field.
412 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Output only. The ID of the item from which this permission is inherited. This is only populated for items in shared drives.
413 &quot;permissionType&quot;: &quot;A String&quot;, # Output only. The permission type for this user. Supported values include: * `file` * `member`
414 &quot;role&quot;: &quot;A String&quot;, # Output only. The primary role for this user. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).
415 },
416 ],
417 &quot;photoLink&quot;: &quot;A String&quot;, # Output only. A link to the user&#x27;s profile photo, if available.
418 &quot;role&quot;: &quot;A String&quot;, # The role granted by this permission. Supported values include: * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader` For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles).
419 &quot;teamDrivePermissionDetails&quot;: [ # Output only. Deprecated: Output only. Use `permissionDetails` instead.
420 {
421 &quot;inherited&quot;: True or False, # Deprecated: Output only. Use `permissionDetails/inherited` instead.
422 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/inheritedFrom` instead.
423 &quot;role&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/role` instead.
424 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated: Output only. Use `permissionDetails/permissionType` instead.
425 },
426 ],
427 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Supported values include: * `user` * `group` * `domain` * `anyone` When creating a permission, if `type` is `user` or `group`, you must provide an `emailAddress` for the user or group. If `type` is `domain`, you must provide a `domain`. If `type` is `anyone`, no extra information is required.
428 &quot;view&quot;: &quot;A String&quot;, # Indicates the view for this permission. Only populated for permissions that belong to a view. The only supported values are `published` and `metadata`: * `published`: The permission&#x27;s role is `publishedReader`. * `metadata`: The item is only visible to the `metadata` view because the item has limited access and the scope has at least read access to the parent. The `metadata` view is only supported on folders. For more information, see [Views](https://developers.google.com/workspace/drive/api/guides/ref-roles#views).
429 }</pre>
430 </div>
431
432 </body></html>