blob: 79866a93317f6ef135e23bd241d08c824f01ba48 [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;.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800129 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Bu Sun Kim65020912020-05-20 12:08:20 -0700130 &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 -0700131 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700132 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
133 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
134 &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:
135 # - file
136 # - member
137 &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 -0700138 # - organizer
139 # - fileOrganizer
140 # - writer
141 # - commenter
142 # - reader
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700143 },
144 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700145 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
146 &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 -0800147 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700148 # - organizer
149 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800150 # - writer
151 # - commenter
152 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700153 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
154 {
155 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
156 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
157 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
158 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
159 },
160 ],
161 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Valid values are:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800162 # - user
163 # - group
164 # - domain
Bu Sun Kim65020912020-05-20 12:08:20 -0700165 # - 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 -0700166 &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 -0800167}
168
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700169 emailMessage: string, A plain text custom message to include in the notification email.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800170 enforceSingleParent: boolean, Deprecated. See moveToNewOwnersRoot for details.
171 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 -0700172 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 -0700173 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700174 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
yoshi-code-bot1a4514d2021-07-13 00:20:24 -0700175 transferOwnership: boolean, Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. File owners can only transfer ownership of files existing on My Drive. Files existing in a shared drive are owned by the organization that owns that shared drive. Ownership transfers are not supported for files and folders in shared drives. Organizers of a shared drive can move items from that shared drive into their My Drive which transfers the ownership to them.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700176 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 -0800177
178Returns:
179 An object of the form:
180
181 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800182 &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.
183 &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.
184 &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:
185 # - user - User&#x27;s full name, as defined for their Google account, such as &quot;Joe Smith.&quot;
186 # - group - Name of the Google Group, such as &quot;The Company Administrators.&quot;
187 # - domain - String domain name, such as &quot;thecompany.com.&quot;
188 # - anyone - No displayName is present.
189 &quot;domain&quot;: &quot;A String&quot;, # The domain to which this permission refers.
190 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group to which this permission refers.
191 &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:
192 # - They can only be set on user and group permissions
193 # - The time must be in the future
194 # - The time cannot be more than a year in the future
195 &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.
196 &quot;kind&quot;: &quot;drive#permission&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#permission&quot;.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800197 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800198 &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.
199 {
200 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
201 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
202 &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:
203 # - file
204 # - member
205 &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:
206 # - organizer
207 # - fileOrganizer
208 # - writer
209 # - commenter
210 # - reader
211 },
212 ],
213 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
214 &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:
215 # - owner
216 # - organizer
217 # - fileOrganizer
218 # - writer
219 # - commenter
220 # - reader
221 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
222 {
223 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
224 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
225 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
226 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
227 },
228 ],
229 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Valid values are:
230 # - user
231 # - group
232 # - domain
233 # - 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.
234 &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.
235}</pre>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800236</div>
237
238<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700239 <code class="details" id="delete">delete(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800240 <pre>Deletes a permission.
241
242Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700243 fileId: string, The ID of the file or shared drive. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800244 permissionId: string, The ID of the permission. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700245 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700246 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700247 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 -0800248</pre>
249</div>
250
251<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700252 <code class="details" id="get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800253 <pre>Gets a permission by ID.
254
255Args:
256 fileId: string, The ID of the file. (required)
257 permissionId: string, The ID of the permission. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700258 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700259 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700260 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 -0800261
262Returns:
263 An object of the form:
264
265 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800266 &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.
267 &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.
268 &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:
269 # - user - User&#x27;s full name, as defined for their Google account, such as &quot;Joe Smith.&quot;
270 # - group - Name of the Google Group, such as &quot;The Company Administrators.&quot;
271 # - domain - String domain name, such as &quot;thecompany.com.&quot;
272 # - anyone - No displayName is present.
273 &quot;domain&quot;: &quot;A String&quot;, # The domain to which this permission refers.
274 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group to which this permission refers.
275 &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:
276 # - They can only be set on user and group permissions
277 # - The time must be in the future
278 # - The time cannot be more than a year in the future
279 &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.
280 &quot;kind&quot;: &quot;drive#permission&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#permission&quot;.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800281 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800282 &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.
283 {
284 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
285 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
286 &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:
287 # - file
288 # - member
289 &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:
290 # - organizer
291 # - fileOrganizer
292 # - writer
293 # - commenter
294 # - reader
295 },
296 ],
297 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
298 &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:
299 # - owner
300 # - organizer
301 # - fileOrganizer
302 # - writer
303 # - commenter
304 # - reader
305 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
306 {
307 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
308 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
309 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
310 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
311 },
312 ],
313 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Valid values are:
314 # - user
315 # - group
316 # - domain
317 # - 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.
318 &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.
319}</pre>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800320</div>
321
322<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700323 <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 -0700324 <pre>Lists a file&#x27;s or shared drive&#x27;s permissions.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800325
326Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700327 fileId: string, The ID of the file or shared drive. (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700328 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 -0700329 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 -0700330 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 -0700331 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700332 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700333 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 -0800334
335Returns:
336 An object of the form:
337
338 { # A list of permissions for a file.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800339 &quot;kind&quot;: &quot;drive#permissionList&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#permissionList&quot;.
340 &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.
341 &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.
342 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
343 &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.
344 &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.
345 &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:
346 # - user - User&#x27;s full name, as defined for their Google account, such as &quot;Joe Smith.&quot;
347 # - group - Name of the Google Group, such as &quot;The Company Administrators.&quot;
348 # - domain - String domain name, such as &quot;thecompany.com.&quot;
349 # - anyone - No displayName is present.
350 &quot;domain&quot;: &quot;A String&quot;, # The domain to which this permission refers.
351 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group to which this permission refers.
352 &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:
353 # - They can only be set on user and group permissions
354 # - The time must be in the future
355 # - The time cannot be more than a year in the future
356 &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.
357 &quot;kind&quot;: &quot;drive#permission&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#permission&quot;.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800358 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800359 &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.
360 {
361 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
362 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
363 &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:
364 # - file
365 # - member
366 &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:
367 # - organizer
368 # - fileOrganizer
369 # - writer
370 # - commenter
371 # - reader
372 },
373 ],
374 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
375 &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:
376 # - owner
377 # - organizer
378 # - fileOrganizer
379 # - writer
380 # - commenter
381 # - reader
382 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
383 {
384 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
385 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
386 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
387 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
388 },
389 ],
390 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Valid values are:
391 # - user
392 # - group
393 # - domain
394 # - 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.
395 &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.
396 },
397 ],
398}</pre>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800399</div>
400
401<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700402 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
403 <pre>Retrieves the next page of results.
404
405Args:
406 previous_request: The request for the previous page. (required)
407 previous_response: The response from the request for the previous page. (required)
408
409Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700410 A request object that you can call &#x27;execute()&#x27; on to request the next
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700411 page. Returns None if there are no more items in the collection.
412 </pre>
413</div>
414
415<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700416 <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 -0800417 <pre>Updates a permission with patch semantics.
418
419Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700420 fileId: string, The ID of the file or shared drive. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800421 permissionId: string, The ID of the permission. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700422 body: object, The request body.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800423 The object takes the form of:
424
425{ # 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 -0700426 &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.
427 &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.
428 &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:
429 # - user - User&#x27;s full name, as defined for their Google account, such as &quot;Joe Smith.&quot;
430 # - group - Name of the Google Group, such as &quot;The Company Administrators.&quot;
431 # - domain - String domain name, such as &quot;thecompany.com.&quot;
Dan O'Mearadd494642020-05-01 07:42:23 -0700432 # - anyone - No displayName is present.
Bu Sun Kim65020912020-05-20 12:08:20 -0700433 &quot;domain&quot;: &quot;A String&quot;, # The domain to which this permission refers.
434 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group to which this permission refers.
435 &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:
436 # - They can only be set on user and group permissions
437 # - The time must be in the future
438 # - The time cannot be more than a year in the future
439 &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.
440 &quot;kind&quot;: &quot;drive#permission&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#permission&quot;.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800441 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Bu Sun Kim65020912020-05-20 12:08:20 -0700442 &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 -0700443 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700444 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
445 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
446 &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:
447 # - file
448 # - member
449 &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 -0700450 # - organizer
451 # - fileOrganizer
452 # - writer
453 # - commenter
454 # - reader
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700455 },
456 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700457 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
458 &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 -0800459 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700460 # - organizer
461 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800462 # - writer
463 # - commenter
464 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700465 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
466 {
467 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
468 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
469 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
470 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
471 },
472 ],
473 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Valid values are:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800474 # - user
475 # - group
476 # - domain
Bu Sun Kim65020912020-05-20 12:08:20 -0700477 # - 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 -0700478 &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 -0800479}
480
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700481 removeExpiration: boolean, Whether to remove the expiration date.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700482 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700483 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
yoshi-code-bot1a4514d2021-07-13 00:20:24 -0700484 transferOwnership: boolean, Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. File owners can only transfer ownership of files existing on My Drive. Files existing in a shared drive are owned by the organization that owns that shared drive. Ownership transfers are not supported for files and folders in shared drives. Organizers of a shared drive can move items from that shared drive into their My Drive which transfers the ownership to them.
Bu Sun Kim65020912020-05-20 12:08:20 -0700485 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 -0800486
487Returns:
488 An object of the form:
489
490 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800491 &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.
492 &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.
493 &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:
494 # - user - User&#x27;s full name, as defined for their Google account, such as &quot;Joe Smith.&quot;
495 # - group - Name of the Google Group, such as &quot;The Company Administrators.&quot;
496 # - domain - String domain name, such as &quot;thecompany.com.&quot;
497 # - anyone - No displayName is present.
498 &quot;domain&quot;: &quot;A String&quot;, # The domain to which this permission refers.
499 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group to which this permission refers.
500 &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:
501 # - They can only be set on user and group permissions
502 # - The time must be in the future
503 # - The time cannot be more than a year in the future
504 &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.
505 &quot;kind&quot;: &quot;drive#permission&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;drive#permission&quot;.
yoshi-code-bot815c1ac2021-11-15 23:24:17 -0800506 &quot;pendingOwner&quot;: True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800507 &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.
508 {
509 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
510 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
511 &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:
512 # - file
513 # - member
514 &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:
515 # - organizer
516 # - fileOrganizer
517 # - writer
518 # - commenter
519 # - reader
520 },
521 ],
522 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the user&#x27;s profile photo, if available.
523 &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:
524 # - owner
525 # - organizer
526 # - fileOrganizer
527 # - writer
528 # - commenter
529 # - reader
530 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
531 {
532 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
533 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
534 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
535 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
536 },
537 ],
538 &quot;type&quot;: &quot;A String&quot;, # The type of the grantee. Valid values are:
539 # - user
540 # - group
541 # - domain
542 # - 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.
543 &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.
544}</pre>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800545</div>
546
547</body></html>