blob: 710f4b145def0341970ea487edc4771f23fd4ed3 [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="drive_v2.html">Drive API</a> . <a href="drive_v2.permissions.html">permissions</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070078 <code><a href="#delete">delete(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Deletes a permission from a file or shared drive.</p>
John Asmuth614db982014-04-24 15:46:26 -040080<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070081 <code><a href="#get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040082<p class="firstline">Gets a permission by ID.</p>
83<p class="toc_element">
84 <code><a href="#getIdForEmail">getIdForEmail(email)</a></code></p>
85<p class="firstline">Returns the permission ID for an email address.</p>
86<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070087 <code><a href="#insert">insert(fileId, body=None, emailMessage=None, enforceSingleParent=None, moveToNewOwnersRoot=None, sendNotificationEmails=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070088<p class="firstline">Inserts a permission for a file or shared drive.</p>
John Asmuth614db982014-04-24 15:46:26 -040089<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070090 <code><a href="#list">list(fileId, maxResults=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>
John Asmuth614db982014-04-24 15:46:26 -040092<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040093 <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="#patch">patch(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -070097<p class="firstline">Updates a permission using patch semantics.</p>
John Asmuth614db982014-04-24 15:46:26 -040098<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070099 <code><a href="#update">update(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400100<p class="firstline">Updates a permission.</p>
101<h3>Method Details</h3>
102<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700103 <code class="details" id="delete">delete(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700104 <pre>Deletes a permission from a file or shared drive.
John Asmuth614db982014-04-24 15:46:26 -0400105
106Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700107 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400108 permissionId: string, The ID for the permission. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700109 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700110 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700111 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
John Asmuth614db982014-04-24 15:46:26 -0400112</pre>
113</div>
114
115<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700116 <code class="details" id="get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400117 <pre>Gets a permission by ID.
118
119Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700120 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400121 permissionId: string, The ID for the permission. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700122 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700123 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700124 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
John Asmuth614db982014-04-24 15:46:26 -0400125
126Returns:
127 An object of the form:
128
129 { # A permission for a file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700130 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
131 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400132 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700133 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
134 &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.
135 &quot;domain&quot;: &quot;A String&quot;, # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
136 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
137 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
138 &quot;expirationDate&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700139 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400140 # - They can only be set on user and group permissions
141 # - The date must be in the future
142 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700143 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Bu Sun Kim65020912020-05-20 12:08:20 -0700144 &quot;id&quot;: &quot;A String&quot;, # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
145 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
146 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
147 &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.
148 {
149 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
150 &quot;A String&quot;,
151 ],
152 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
153 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
154 &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:
155 # - file
156 # - member
157 &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:
158 # - organizer
159 # - fileOrganizer
160 # - writer
161 # - reader
162 },
163 ],
164 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
165 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400166 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700167 # - organizer
168 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400169 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700170 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700171 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
172 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
173 {
174 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
175 &quot;A String&quot;,
176 ],
177 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
178 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
179 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
180 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
181 },
182 ],
183 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
John Asmuth614db982014-04-24 15:46:26 -0400184 # - user
185 # - group
186 # - domain
187 # - anyone
Bu Sun Kim65020912020-05-20 12:08:20 -0700188 &quot;value&quot;: &quot;A String&quot;, # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
189 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
John Asmuth614db982014-04-24 15:46:26 -0400190 }</pre>
191</div>
192
193<div class="method">
194 <code class="details" id="getIdForEmail">getIdForEmail(email)</code>
195 <pre>Returns the permission ID for an email address.
196
197Args:
198 email: string, The email address for which to return a permission ID (required)
199
200Returns:
201 An object of the form:
202
203 { # An ID for a user or group as seen in Permission items.
Bu Sun Kim65020912020-05-20 12:08:20 -0700204 &quot;id&quot;: &quot;A String&quot;, # The permission ID.
205 &quot;kind&quot;: &quot;drive#permissionId&quot;, # This is always drive#permissionId.
John Asmuth614db982014-04-24 15:46:26 -0400206 }</pre>
207</div>
208
209<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700210 <code class="details" id="insert">insert(fileId, body=None, emailMessage=None, enforceSingleParent=None, moveToNewOwnersRoot=None, sendNotificationEmails=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700211 <pre>Inserts a permission for a file or shared drive.
John Asmuth614db982014-04-24 15:46:26 -0400212
213Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700214 fileId: string, The ID for the file or shared drive. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700215 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400216 The object takes the form of:
217
218{ # A permission for a file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700219 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
220 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400221 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700222 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
223 &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.
224 &quot;domain&quot;: &quot;A String&quot;, # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
225 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
226 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
227 &quot;expirationDate&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700228 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400229 # - They can only be set on user and group permissions
230 # - The date must be in the future
231 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700232 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Bu Sun Kim65020912020-05-20 12:08:20 -0700233 &quot;id&quot;: &quot;A String&quot;, # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
234 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
235 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
236 &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.
237 {
238 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
239 &quot;A String&quot;,
240 ],
241 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
242 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
243 &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:
244 # - file
245 # - member
246 &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:
247 # - organizer
248 # - fileOrganizer
249 # - writer
250 # - reader
251 },
252 ],
253 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
254 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400255 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700256 # - organizer
257 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400258 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700259 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700260 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
261 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
262 {
263 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
264 &quot;A String&quot;,
265 ],
266 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
267 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
268 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
269 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
270 },
271 ],
272 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
John Asmuth614db982014-04-24 15:46:26 -0400273 # - user
274 # - group
275 # - domain
276 # - anyone
Bu Sun Kim65020912020-05-20 12:08:20 -0700277 &quot;value&quot;: &quot;A String&quot;, # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
278 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
John Asmuth614db982014-04-24 15:46:26 -0400279}
280
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700281 emailMessage: string, A plain text custom message to include in notification emails.
Bu Sun Kim65020912020-05-20 12:08:20 -0700282 enforceSingleParent: boolean, Set to true to opt in to API behavior that aims for all items to have exactly one parent. This parameter only takes effect if the item is not in a shared drive. See moveToNewOwnersRoot for details.
283 moveToNewOwnersRoot: boolean, This parameter only takes effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. When 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, when enforceSingleParent=true, parents are not changed. If set to false, when enforceSingleParent=false, existing parents are not changed; however, the file will be added to the new owner&#x27;s My Drive root folder, unless it is already in the new owner&#x27;s My Drive.
284 sendNotificationEmails: boolean, Whether to send notification emails when sharing to users or groups. This parameter is ignored and an email is sent if the role is owner.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700285 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700286 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700287 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
John Asmuth614db982014-04-24 15:46:26 -0400288
289Returns:
290 An object of the form:
291
292 { # A permission for a file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700293 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
294 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400295 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700296 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
297 &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.
298 &quot;domain&quot;: &quot;A String&quot;, # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
299 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
300 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
301 &quot;expirationDate&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700302 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400303 # - They can only be set on user and group permissions
304 # - The date must be in the future
305 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700306 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Bu Sun Kim65020912020-05-20 12:08:20 -0700307 &quot;id&quot;: &quot;A String&quot;, # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
308 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
309 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
310 &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.
311 {
312 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
313 &quot;A String&quot;,
314 ],
315 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
316 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
317 &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:
318 # - file
319 # - member
320 &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:
321 # - organizer
322 # - fileOrganizer
323 # - writer
324 # - reader
325 },
326 ],
327 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
328 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400329 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700330 # - organizer
331 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400332 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700333 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700334 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
335 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
336 {
337 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
338 &quot;A String&quot;,
339 ],
340 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
341 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
342 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
343 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
344 },
345 ],
346 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
John Asmuth614db982014-04-24 15:46:26 -0400347 # - user
348 # - group
349 # - domain
350 # - anyone
Bu Sun Kim65020912020-05-20 12:08:20 -0700351 &quot;value&quot;: &quot;A String&quot;, # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
352 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
John Asmuth614db982014-04-24 15:46:26 -0400353 }</pre>
354</div>
355
356<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700357 <code class="details" id="list">list(fileId, maxResults=None, pageToken=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code>
358 <pre>Lists a file&#x27;s or shared drive&#x27;s permissions.
John Asmuth614db982014-04-24 15:46:26 -0400359
360Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700361 fileId: string, The ID for the file or shared drive. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700362 maxResults: integer, The maximum number of permissions to return per page. When not set for files in a shared drive, at most 100 results will be returned. When not set for files that are not in a shared drive, the entire list will be returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700363 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 -0700364 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700365 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
366 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
John Asmuth614db982014-04-24 15:46:26 -0400367
368Returns:
369 An object of the form:
370
371 { # A list of permissions associated with a file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700372 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the list.
373 &quot;items&quot;: [ # The list of permissions.
John Asmuth614db982014-04-24 15:46:26 -0400374 { # A permission for a file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700375 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
376 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400377 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700378 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
379 &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.
380 &quot;domain&quot;: &quot;A String&quot;, # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
381 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
382 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
383 &quot;expirationDate&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700384 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400385 # - They can only be set on user and group permissions
386 # - The date must be in the future
387 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700388 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Bu Sun Kim65020912020-05-20 12:08:20 -0700389 &quot;id&quot;: &quot;A String&quot;, # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
390 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
391 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
392 &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.
393 {
394 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
395 &quot;A String&quot;,
396 ],
397 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
398 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
399 &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:
400 # - file
401 # - member
402 &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:
403 # - organizer
404 # - fileOrganizer
405 # - writer
406 # - reader
407 },
408 ],
409 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
410 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400411 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700412 # - organizer
413 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400414 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700415 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700416 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
417 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
418 {
419 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
420 &quot;A String&quot;,
421 ],
422 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
423 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
424 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
425 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
426 },
427 ],
428 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
John Asmuth614db982014-04-24 15:46:26 -0400429 # - user
430 # - group
431 # - domain
432 # - anyone
Bu Sun Kim65020912020-05-20 12:08:20 -0700433 &quot;value&quot;: &quot;A String&quot;, # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
434 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
John Asmuth614db982014-04-24 15:46:26 -0400435 },
436 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700437 &quot;kind&quot;: &quot;drive#permissionList&quot;, # This is always drive#permissionList.
438 &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.
439 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this list.
John Asmuth614db982014-04-24 15:46:26 -0400440 }</pre>
441</div>
442
443<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400444 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
445 <pre>Retrieves the next page of results.
446
447Args:
448 previous_request: The request for the previous page. (required)
449 previous_response: The response from the request for the previous page. (required)
450
451Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700452 A request object that you can call &#x27;execute()&#x27; on to request the next
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400453 page. Returns None if there are no more items in the collection.
454 </pre>
455</div>
456
457<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700458 <code class="details" id="patch">patch(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700459 <pre>Updates a permission using patch semantics.
John Asmuth614db982014-04-24 15:46:26 -0400460
461Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700462 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400463 permissionId: string, The ID for the permission. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700464 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400465 The object takes the form of:
466
467{ # A permission for a file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700468 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
469 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400470 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700471 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
472 &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.
473 &quot;domain&quot;: &quot;A String&quot;, # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
474 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
475 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
476 &quot;expirationDate&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700477 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400478 # - They can only be set on user and group permissions
479 # - The date must be in the future
480 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700481 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Bu Sun Kim65020912020-05-20 12:08:20 -0700482 &quot;id&quot;: &quot;A String&quot;, # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
483 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
484 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
485 &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.
486 {
487 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
488 &quot;A String&quot;,
489 ],
490 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
491 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
492 &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:
493 # - file
494 # - member
495 &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:
496 # - organizer
497 # - fileOrganizer
498 # - writer
499 # - reader
500 },
501 ],
502 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
503 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400504 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700505 # - organizer
506 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400507 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700508 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700509 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
510 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
511 {
512 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
513 &quot;A String&quot;,
514 ],
515 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
516 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
517 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
518 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
519 },
520 ],
521 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
John Asmuth614db982014-04-24 15:46:26 -0400522 # - user
523 # - group
524 # - domain
525 # - anyone
Bu Sun Kim65020912020-05-20 12:08:20 -0700526 &quot;value&quot;: &quot;A String&quot;, # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
527 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
John Asmuth614db982014-04-24 15:46:26 -0400528}
529
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700530 removeExpiration: boolean, Whether to remove the expiration date.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700531 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700532 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
533 transferOwnership: boolean, Whether changing a role to &#x27;owner&#x27; downgrades the current owners to writers. Does nothing if the specified role is not &#x27;owner&#x27;.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700534 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
John Asmuth614db982014-04-24 15:46:26 -0400535
536Returns:
537 An object of the form:
538
539 { # A permission for a file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700540 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
541 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400542 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700543 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
544 &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.
545 &quot;domain&quot;: &quot;A String&quot;, # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
546 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
547 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
548 &quot;expirationDate&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700549 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400550 # - They can only be set on user and group permissions
551 # - The date must be in the future
552 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700553 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Bu Sun Kim65020912020-05-20 12:08:20 -0700554 &quot;id&quot;: &quot;A String&quot;, # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
555 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
556 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
557 &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.
558 {
559 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
560 &quot;A String&quot;,
561 ],
562 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
563 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
564 &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:
565 # - file
566 # - member
567 &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:
568 # - organizer
569 # - fileOrganizer
570 # - writer
571 # - reader
572 },
573 ],
574 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
575 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400576 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700577 # - organizer
578 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400579 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700580 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700581 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
582 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
583 {
584 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
585 &quot;A String&quot;,
586 ],
587 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
588 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
589 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
590 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
591 },
592 ],
593 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
John Asmuth614db982014-04-24 15:46:26 -0400594 # - user
595 # - group
596 # - domain
597 # - anyone
Bu Sun Kim65020912020-05-20 12:08:20 -0700598 &quot;value&quot;: &quot;A String&quot;, # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
599 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
John Asmuth614db982014-04-24 15:46:26 -0400600 }</pre>
601</div>
602
603<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700604 <code class="details" id="update">update(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400605 <pre>Updates a permission.
606
607Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700608 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400609 permissionId: string, The ID for the permission. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700610 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400611 The object takes the form of:
612
613{ # A permission for a file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700614 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
615 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400616 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700617 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
618 &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.
619 &quot;domain&quot;: &quot;A String&quot;, # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
620 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
621 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
622 &quot;expirationDate&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700623 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400624 # - They can only be set on user and group permissions
625 # - The date must be in the future
626 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700627 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Bu Sun Kim65020912020-05-20 12:08:20 -0700628 &quot;id&quot;: &quot;A String&quot;, # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
629 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
630 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
631 &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.
632 {
633 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
634 &quot;A String&quot;,
635 ],
636 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
637 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
638 &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:
639 # - file
640 # - member
641 &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:
642 # - organizer
643 # - fileOrganizer
644 # - writer
645 # - reader
646 },
647 ],
648 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
649 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400650 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700651 # - organizer
652 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400653 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700654 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700655 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
656 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
657 {
658 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
659 &quot;A String&quot;,
660 ],
661 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
662 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
663 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
664 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
665 },
666 ],
667 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
John Asmuth614db982014-04-24 15:46:26 -0400668 # - user
669 # - group
670 # - domain
671 # - anyone
Bu Sun Kim65020912020-05-20 12:08:20 -0700672 &quot;value&quot;: &quot;A String&quot;, # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
673 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
John Asmuth614db982014-04-24 15:46:26 -0400674}
675
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700676 removeExpiration: boolean, Whether to remove the expiration date.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700677 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives.
Bu Sun Kim65020912020-05-20 12:08:20 -0700678 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
679 transferOwnership: boolean, Whether changing a role to &#x27;owner&#x27; downgrades the current owners to writers. Does nothing if the specified role is not &#x27;owner&#x27;.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700680 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
John Asmuth614db982014-04-24 15:46:26 -0400681
682Returns:
683 An object of the form:
684
685 { # A permission for a file.
Bu Sun Kim65020912020-05-20 12:08:20 -0700686 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
687 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400688 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700689 &quot;authKey&quot;: &quot;A String&quot;, # Deprecated.
690 &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.
691 &quot;domain&quot;: &quot;A String&quot;, # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
692 &quot;emailAddress&quot;: &quot;A String&quot;, # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
693 &quot;etag&quot;: &quot;A String&quot;, # The ETag of the permission.
694 &quot;expirationDate&quot;: &quot;A String&quot;, # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
Dan O'Mearadd494642020-05-01 07:42:23 -0700695 # - They cannot be set on shared drive items
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400696 # - They can only be set on user and group permissions
697 # - The date must be in the future
698 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700699 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Bu Sun Kim65020912020-05-20 12:08:20 -0700700 &quot;id&quot;: &quot;A String&quot;, # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
701 &quot;kind&quot;: &quot;drive#permission&quot;, # This is always drive#permission.
702 &quot;name&quot;: &quot;A String&quot;, # The name for this permission.
703 &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.
704 {
705 &quot;additionalRoles&quot;: [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
706 &quot;A String&quot;,
707 ],
708 &quot;inherited&quot;: True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
709 &quot;inheritedFrom&quot;: &quot;A String&quot;, # The ID of the item from which this permission is inherited. This is an output-only field.
710 &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:
711 # - file
712 # - member
713 &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:
714 # - organizer
715 # - fileOrganizer
716 # - writer
717 # - reader
718 },
719 ],
720 &quot;photoLink&quot;: &quot;A String&quot;, # A link to the profile photo, if available.
721 &quot;role&quot;: &quot;A String&quot;, # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400722 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700723 # - organizer
724 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400725 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700726 # - reader
Bu Sun Kim65020912020-05-20 12:08:20 -0700727 &quot;selfLink&quot;: &quot;A String&quot;, # A link back to this permission.
728 &quot;teamDrivePermissionDetails&quot;: [ # Deprecated - use permissionDetails instead.
729 {
730 &quot;additionalRoles&quot;: [ # Deprecated - use permissionDetails/additionalRoles instead.
731 &quot;A String&quot;,
732 ],
733 &quot;inherited&quot;: True or False, # Deprecated - use permissionDetails/inherited instead.
734 &quot;inheritedFrom&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/inheritedFrom instead.
735 &quot;role&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/role instead.
736 &quot;teamDrivePermissionType&quot;: &quot;A String&quot;, # Deprecated - use permissionDetails/permissionType instead.
737 },
738 ],
739 &quot;type&quot;: &quot;A String&quot;, # The account type. Allowed values are:
John Asmuth614db982014-04-24 15:46:26 -0400740 # - user
741 # - group
742 # - domain
743 # - anyone
Bu Sun Kim65020912020-05-20 12:08:20 -0700744 &quot;value&quot;: &quot;A String&quot;, # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
745 &quot;withLink&quot;: True or False, # Whether the link is required for this permission.
John Asmuth614db982014-04-24 15:46:26 -0400746 }</pre>
747</div>
748
749</body></html>