blob: 399625854e35a9f4bdd2002e4f5d0779677d53ba [file] [log] [blame]
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001<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_v3.html">Drive API</a> . <a href="drive_v3.permissions.html">permissions</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070081 <code><a href="#create">create(fileId, body=None, emailMessage=None, enforceSingleParent=None, moveToNewOwnersRoot=None, sendNotificationEmail=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070082<p class="firstline">Creates a permission for a file or shared drive.</p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080083<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070084 <code><a href="#delete">delete(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080085<p class="firstline">Deletes a permission.</p>
86<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070087 <code><a href="#get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080088<p class="firstline">Gets a permission by ID.</p>
89<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070090 <code><a href="#list">list(fileId, includePermissionsForView=None, pageSize=None, pageToken=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070091<p class="firstline">Lists a file's or shared drive's permissions.</p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080092<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070093 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
94<p class="firstline">Retrieves the next page of results.</p>
95<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070096 <code><a href="#update">update(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080097<p class="firstline">Updates a permission with patch semantics.</p>
98<h3>Method Details</h3>
99<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700100 <code class="details" id="close">close()</code>
101 <pre>Close httplib2 connections.</pre>
102</div>
103
104<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700105 <code class="details" id="create">create(fileId, body=None, emailMessage=None, enforceSingleParent=None, moveToNewOwnersRoot=None, sendNotificationEmail=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700106 <pre>Creates a permission for a file or shared drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800107
108Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700109 fileId: string, The ID of the file or shared drive. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700110 body: object, The request body.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800111 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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700114 &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, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
116 &quot;displayName&quot;: &quot;A String&quot;, # The &quot;pretty&quot; name of the value of the permission. The following is a list of examples for each type of permission:
117 # - user - User&#x27;s full name, as defined for their Google account, such as &quot;Joe Smith.&quot;
118 # - group - Name of the Google Group, such as &quot;The Company Administrators.&quot;
119 # - domain - String domain name, such as &quot;thecompany.com.&quot;
Dan O'Mearadd494642020-05-01 07:42:23 -0700120 # - anyone - No displayName is present.
Bu Sun Kim65020912020-05-20 12:08:20 -0700121 &quot;domain&quot;: &quot;A String&quot;, # The domain to which this permission refers.
122 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group to which this permission refers.
123 &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:
124 # - They can only be set on user and group permissions
125 # - The time must be in the future
126 # - The time cannot be more than a year in the future
127 &quot;id&quot;: &quot;A String&quot;, # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values.
128 &quot;kind&quot;: &quot;drive#permission&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#permission&quot;.
129 &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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700130 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700131 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
132 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
133 &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:
134 # - file
135 # - member
136 &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:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700137 # - organizer
138 # - fileOrganizer
139 # - writer
140 # - commenter
141 # - reader
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700142 },
143 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700144 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
145 &quot;role&quot;: &quot;A String&quot;, # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800146 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700147 # - organizer
148 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800149 # - writer
150 # - commenter
151 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700152 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
153 {
154 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
155 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
156 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
157 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
158 },
159 ],
160 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Valid values are:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800161 # - user
162 # - group
163 # - domain
Bu Sun Kim65020912020-05-20 12:08:20 -0700164 # - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn&#x27;t extra information required for a anyone type.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700165 &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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800166}
167
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700168 emailMessage: string, A plain text custom message to include in the notification email.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800169 enforceSingleParent: boolean, Deprecated. See moveToNewOwnersRoot for details.
170 moveToNewOwnersRoot: boolean, This parameter will only take effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. If set to true, the item will be moved to the new owner&#x27;s My Drive root folder and all prior parents removed. If set to false, parents are not changed.
Bu Sun Kim65020912020-05-20 12:08:20 -0700171 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.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700172 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700173 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
174 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700175 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800176
177Returns:
178 An object of the form:
179
180 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
Bu Sun Kim65020912020-05-20 12:08:20 -0700181 &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.
182 &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.
183 &quot;displayName&quot;: &quot;A String&quot;, # The &quot;pretty&quot; name of the value of the permission. The following is a list of examples for each type of permission:
184 # - user - User&#x27;s full name, as defined for their Google account, such as &quot;Joe Smith.&quot;
185 # - group - Name of the Google Group, such as &quot;The Company Administrators.&quot;
186 # - domain - String domain name, such as &quot;thecompany.com.&quot;
Dan O'Mearadd494642020-05-01 07:42:23 -0700187 # - anyone - No displayName is present.
Bu Sun Kim65020912020-05-20 12:08:20 -0700188 &quot;domain&quot;: &quot;A String&quot;, # The domain to which this permission refers.
189 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group to which this permission refers.
190 &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:
191 # - They can only be set on user and group permissions
192 # - The time must be in the future
193 # - The time cannot be more than a year in the future
194 &quot;id&quot;: &quot;A String&quot;, # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values.
195 &quot;kind&quot;: &quot;drive#permission&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#permission&quot;.
196 &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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700197 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700198 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
199 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
200 &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:
201 # - file
202 # - member
203 &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:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700204 # - organizer
205 # - fileOrganizer
206 # - writer
207 # - commenter
208 # - reader
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700209 },
210 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700211 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
212 &quot;role&quot;: &quot;A String&quot;, # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800213 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700214 # - organizer
215 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800216 # - writer
217 # - commenter
218 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700219 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
220 {
221 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
222 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
223 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
224 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
225 },
226 ],
227 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Valid values are:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800228 # - user
229 # - group
230 # - domain
Bu Sun Kim65020912020-05-20 12:08:20 -0700231 # - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn&#x27;t extra information required for a anyone type.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700232 &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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800233 }</pre>
234</div>
235
236<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700237 <code class="details" id="delete">delete(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800238 <pre>Deletes a permission.
239
240Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700241 fileId: string, The ID of the file or shared drive. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800242 permissionId: string, The ID of the permission. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700243 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700244 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700245 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800246</pre>
247</div>
248
249<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700250 <code class="details" id="get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800251 <pre>Gets a permission by ID.
252
253Args:
254 fileId: string, The ID of the file. (required)
255 permissionId: string, The ID of the permission. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700256 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700257 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700258 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800259
260Returns:
261 An object of the form:
262
263 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
Bu Sun Kim65020912020-05-20 12:08:20 -0700264 &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.
265 &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.
266 &quot;displayName&quot;: &quot;A String&quot;, # The &quot;pretty&quot; name of the value of the permission. The following is a list of examples for each type of permission:
267 # - user - User&#x27;s full name, as defined for their Google account, such as &quot;Joe Smith.&quot;
268 # - group - Name of the Google Group, such as &quot;The Company Administrators.&quot;
269 # - domain - String domain name, such as &quot;thecompany.com.&quot;
Dan O'Mearadd494642020-05-01 07:42:23 -0700270 # - anyone - No displayName is present.
Bu Sun Kim65020912020-05-20 12:08:20 -0700271 &quot;domain&quot;: &quot;A String&quot;, # The domain to which this permission refers.
272 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group to which this permission refers.
273 &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:
274 # - They can only be set on user and group permissions
275 # - The time must be in the future
276 # - The time cannot be more than a year in the future
277 &quot;id&quot;: &quot;A String&quot;, # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values.
278 &quot;kind&quot;: &quot;drive#permission&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#permission&quot;.
279 &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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700280 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700281 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
282 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
283 &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:
284 # - file
285 # - member
286 &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:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700287 # - organizer
288 # - fileOrganizer
289 # - writer
290 # - commenter
291 # - reader
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700292 },
293 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700294 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
295 &quot;role&quot;: &quot;A String&quot;, # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800296 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700297 # - organizer
298 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800299 # - writer
300 # - commenter
301 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700302 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
303 {
304 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
305 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
306 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
307 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
308 },
309 ],
310 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Valid values are:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800311 # - user
312 # - group
313 # - domain
Bu Sun Kim65020912020-05-20 12:08:20 -0700314 # - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn&#x27;t extra information required for a anyone type.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700315 &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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800316 }</pre>
317</div>
318
319<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700320 <code class="details" id="list">list(fileId, includePermissionsForView=None, pageSize=None, pageToken=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700321 <pre>Lists a file&#x27;s or shared drive&#x27;s permissions.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800322
323Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700324 fileId: string, The ID of the file or shared drive. (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700325 includePermissionsForView: string, Specifies which additional view&#x27;s permissions to include in the response. Only &#x27;published&#x27; is supported.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700326 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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700327 pageToken: string, The token for continuing a previous list request on the next page. This should be set to the value of &#x27;nextPageToken&#x27; from the previous response.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700328 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700329 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700330 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800331
332Returns:
333 An object of the form:
334
335 { # A list of permissions for a file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700336 &quot;kind&quot;: &quot;drive#permissionList&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#permissionList&quot;.
337 &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.
338 &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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800339 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
Bu Sun Kim65020912020-05-20 12:08:20 -0700340 &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.
341 &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.
342 &quot;displayName&quot;: &quot;A String&quot;, # The &quot;pretty&quot; name of the value of the permission. The following is a list of examples for each type of permission:
343 # - user - User&#x27;s full name, as defined for their Google account, such as &quot;Joe Smith.&quot;
344 # - group - Name of the Google Group, such as &quot;The Company Administrators.&quot;
345 # - domain - String domain name, such as &quot;thecompany.com.&quot;
Dan O'Mearadd494642020-05-01 07:42:23 -0700346 # - anyone - No displayName is present.
Bu Sun Kim65020912020-05-20 12:08:20 -0700347 &quot;domain&quot;: &quot;A String&quot;, # The domain to which this permission refers.
348 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group to which this permission refers.
349 &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:
350 # - They can only be set on user and group permissions
351 # - The time must be in the future
352 # - The time cannot be more than a year in the future
353 &quot;id&quot;: &quot;A String&quot;, # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values.
354 &quot;kind&quot;: &quot;drive#permission&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#permission&quot;.
355 &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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700356 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700357 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
358 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
359 &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:
360 # - file
361 # - member
362 &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:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700363 # - organizer
364 # - fileOrganizer
365 # - writer
366 # - commenter
367 # - reader
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700368 },
369 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700370 &quot;photoLink&quot;: &quot;A String&quot;, # 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. While new values may be supported in the future, the following are currently allowed:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800372 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700373 # - organizer
374 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800375 # - writer
376 # - commenter
377 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700378 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
379 {
380 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
381 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
382 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
383 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
384 },
385 ],
386 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Valid values are:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800387 # - user
388 # - group
389 # - domain
Bu Sun Kim65020912020-05-20 12:08:20 -0700390 # - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn&#x27;t extra information required for a anyone type.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700391 &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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800392 },
393 ],
394 }</pre>
395</div>
396
397<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700398 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
399 <pre>Retrieves the next page of results.
400
401Args:
402 previous_request: The request for the previous page. (required)
403 previous_response: The response from the request for the previous page. (required)
404
405Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700406 A request object that you can call &#x27;execute()&#x27; on to request the next
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700407 page. Returns None if there are no more items in the collection.
408 </pre>
409</div>
410
411<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700412 <code class="details" id="update">update(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800413 <pre>Updates a permission with patch semantics.
414
415Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700416 fileId: string, The ID of the file or shared drive. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800417 permissionId: string, The ID of the permission. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700418 body: object, The request body.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800419 The object takes the form of:
420
421{ # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
Bu Sun Kim65020912020-05-20 12:08:20 -0700422 &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.
423 &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.
424 &quot;displayName&quot;: &quot;A String&quot;, # The &quot;pretty&quot; name of the value of the permission. The following is a list of examples for each type of permission:
425 # - user - User&#x27;s full name, as defined for their Google account, such as &quot;Joe Smith.&quot;
426 # - group - Name of the Google Group, such as &quot;The Company Administrators.&quot;
427 # - domain - String domain name, such as &quot;thecompany.com.&quot;
Dan O'Mearadd494642020-05-01 07:42:23 -0700428 # - anyone - No displayName is present.
Bu Sun Kim65020912020-05-20 12:08:20 -0700429 &quot;domain&quot;: &quot;A String&quot;, # The domain to which this permission refers.
430 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group to which this permission refers.
431 &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:
432 # - They can only be set on user and group permissions
433 # - The time must be in the future
434 # - The time cannot be more than a year in the future
435 &quot;id&quot;: &quot;A String&quot;, # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values.
436 &quot;kind&quot;: &quot;drive#permission&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#permission&quot;.
437 &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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700438 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700439 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
440 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
441 &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:
442 # - file
443 # - member
444 &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:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700445 # - organizer
446 # - fileOrganizer
447 # - writer
448 # - commenter
449 # - reader
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700450 },
451 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700452 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
453 &quot;role&quot;: &quot;A String&quot;, # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800454 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700455 # - organizer
456 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800457 # - writer
458 # - commenter
459 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700460 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
461 {
462 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
463 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
464 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
465 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
466 },
467 ],
468 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Valid values are:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800469 # - user
470 # - group
471 # - domain
Bu Sun Kim65020912020-05-20 12:08:20 -0700472 # - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn&#x27;t extra information required for a anyone type.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700473 &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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800474}
475
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700476 removeExpiration: boolean, Whether to remove the expiration date.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700477 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700478 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800479 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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700480 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800481
482Returns:
483 An object of the form:
484
485 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
Bu Sun Kim65020912020-05-20 12:08:20 -0700486 &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.
487 &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.
488 &quot;displayName&quot;: &quot;A String&quot;, # The &quot;pretty&quot; name of the value of the permission. The following is a list of examples for each type of permission:
489 # - user - User&#x27;s full name, as defined for their Google account, such as &quot;Joe Smith.&quot;
490 # - group - Name of the Google Group, such as &quot;The Company Administrators.&quot;
491 # - domain - String domain name, such as &quot;thecompany.com.&quot;
Dan O'Mearadd494642020-05-01 07:42:23 -0700492 # - anyone - No displayName is present.
Bu Sun Kim65020912020-05-20 12:08:20 -0700493 &quot;domain&quot;: &quot;A String&quot;, # The domain to which this permission refers.
494 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group to which this permission refers.
495 &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:
496 # - They can only be set on user and group permissions
497 # - The time must be in the future
498 # - The time cannot be more than a year in the future
499 &quot;id&quot;: &quot;A String&quot;, # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values.
500 &quot;kind&quot;: &quot;drive#permission&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#permission&quot;.
501 &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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700502 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700503 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
504 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
505 &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:
506 # - file
507 # - member
508 &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:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700509 # - organizer
510 # - fileOrganizer
511 # - writer
512 # - commenter
513 # - reader
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700514 },
515 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700516 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
517 &quot;role&quot;: &quot;A String&quot;, # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800518 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700519 # - organizer
520 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800521 # - writer
522 # - commenter
523 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700524 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
525 {
526 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
527 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
528 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
529 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
530 },
531 ],
532 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Valid values are:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800533 # - user
534 # - group
535 # - domain
Bu Sun Kim65020912020-05-20 12:08:20 -0700536 # - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn&#x27;t extra information required for a anyone type.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700537 &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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800538 }</pre>
539</div>
540
541</body></html>