• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5  margin: 0;
6  padding: 0;
7  border: 0;
8  font-weight: inherit;
9  font-style: inherit;
10  font-size: 100%;
11  font-family: inherit;
12  vertical-align: baseline;
13}
14
15body {
16  font-size: 13px;
17  padding: 1em;
18}
19
20h1 {
21  font-size: 26px;
22  margin-bottom: 1em;
23}
24
25h2 {
26  font-size: 24px;
27  margin-bottom: 1em;
28}
29
30h3 {
31  font-size: 20px;
32  margin-bottom: 1em;
33  margin-top: 1em;
34}
35
36pre, code {
37  line-height: 1.5;
38  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42  margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46  font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50  border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54  margin-top: 0.5em;
55}
56
57.firstline {
58  margin-left: 2 em;
59}
60
61.method  {
62  margin-top: 1em;
63  border: solid 1px #CCC;
64  padding: 1em;
65  background: #EEE;
66}
67
68.details {
69  font-weight: bold;
70  font-size: 14px;
71}
72
73</style>
74
75<h1><a href="drive_v2.html">Drive API</a> . <a href="drive_v2.permissions.html">permissions</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78  <code><a href="#delete">delete(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</a></code></p>
79<p class="firstline">Deletes a permission from a file or shared drive.</p>
80<p class="toc_element">
81  <code><a href="#get">get(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</a></code></p>
82<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">
87  <code><a href="#insert">insert(fileId, body, supportsTeamDrives=None, supportsAllDrives=None, sendNotificationEmails=None, emailMessage=None, useDomainAdminAccess=None)</a></code></p>
88<p class="firstline">Inserts a permission for a file or shared drive.</p>
89<p class="toc_element">
90  <code><a href="#list">list(fileId, pageToken=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, maxResults=None)</a></code></p>
91<p class="firstline">Lists a file's or shared drive's permissions.</p>
92<p class="toc_element">
93  <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">
96  <code><a href="#patch">patch(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, transferOwnership=None)</a></code></p>
97<p class="firstline">Updates a permission using patch semantics.</p>
98<p class="toc_element">
99  <code><a href="#update">update(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, transferOwnership=None)</a></code></p>
100<p class="firstline">Updates a permission.</p>
101<h3>Method Details</h3>
102<div class="method">
103    <code class="details" id="delete">delete(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</code>
104  <pre>Deletes a permission from a file or shared drive.
105
106Args:
107  fileId: string, The ID for the file or shared drive. (required)
108  permissionId: string, The ID for the permission. (required)
109  supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
110  supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
111  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.
112</pre>
113</div>
114
115<div class="method">
116    <code class="details" id="get">get(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</code>
117  <pre>Gets a permission by ID.
118
119Args:
120  fileId: string, The ID for the file or shared drive. (required)
121  permissionId: string, The ID for the permission. (required)
122  supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
123  supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
124  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.
125
126Returns:
127  An object of the form:
128
129    { # A permission for a file.
130    "withLink": True or False, # Whether the link is required for this permission.
131    "domain": "A String", # 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.
132    "permissionDetails": [ # 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.
133      {
134        "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
135            # - organizer
136            # - fileOrganizer
137            # - writer
138            # - reader
139        "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
140        "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
141            # - file
142            # - member
143        "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
144          "A String",
145        ],
146        "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
147      },
148    ],
149    "name": "A String", # The name for this permission.
150    "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
151      {
152        "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
153        "role": "A String", # Deprecated - use permissionDetails/role instead.
154        "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
155          "A String",
156        ],
157        "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
158        "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
159      },
160    ],
161    "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
162    "kind": "drive#permission", # This is always drive#permission.
163    "value": "A String", # 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.
164    "id": "A String", # 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.
165    "authKey": "A String", # Deprecated.
166    "etag": "A String", # The ETag of the permission.
167    "emailAddress": "A String", # 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.
168    "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
169        # - They can only be set on user and group permissions
170        # - The date must be in the future
171        # - The date cannot be more than a year in the future
172        # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
173    "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
174        # - owner
175        # - organizer
176        # - fileOrganizer
177        # - writer
178        # - reader
179    "type": "A String", # The account type. Allowed values are:
180        # - user
181        # - group
182        # - domain
183        # - anyone
184    "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
185      "A String",
186    ],
187    "selfLink": "A String", # A link back to this permission.
188    "photoLink": "A String", # A link to the profile photo, if available.
189  }</pre>
190</div>
191
192<div class="method">
193    <code class="details" id="getIdForEmail">getIdForEmail(email)</code>
194  <pre>Returns the permission ID for an email address.
195
196Args:
197  email: string, The email address for which to return a permission ID (required)
198
199Returns:
200  An object of the form:
201
202    { # An ID for a user or group as seen in Permission items.
203    "kind": "drive#permissionId", # This is always drive#permissionId.
204    "id": "A String", # The permission ID.
205  }</pre>
206</div>
207
208<div class="method">
209    <code class="details" id="insert">insert(fileId, body, supportsTeamDrives=None, supportsAllDrives=None, sendNotificationEmails=None, emailMessage=None, useDomainAdminAccess=None)</code>
210  <pre>Inserts a permission for a file or shared drive.
211
212Args:
213  fileId: string, The ID for the file or shared drive. (required)
214  body: object, The request body. (required)
215    The object takes the form of:
216
217{ # A permission for a file.
218  "withLink": True or False, # Whether the link is required for this permission.
219  "domain": "A String", # 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.
220  "permissionDetails": [ # 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.
221    {
222      "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
223          # - organizer
224          # - fileOrganizer
225          # - writer
226          # - reader
227      "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
228      "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
229          # - file
230          # - member
231      "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
232        "A String",
233      ],
234      "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
235    },
236  ],
237  "name": "A String", # The name for this permission.
238  "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
239    {
240      "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
241      "role": "A String", # Deprecated - use permissionDetails/role instead.
242      "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
243        "A String",
244      ],
245      "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
246      "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
247    },
248  ],
249  "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
250  "kind": "drive#permission", # This is always drive#permission.
251  "value": "A String", # 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.
252  "id": "A String", # 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.
253  "authKey": "A String", # Deprecated.
254  "etag": "A String", # The ETag of the permission.
255  "emailAddress": "A String", # 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.
256  "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
257      # - They can only be set on user and group permissions
258      # - The date must be in the future
259      # - The date cannot be more than a year in the future
260      # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
261  "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
262      # - owner
263      # - organizer
264      # - fileOrganizer
265      # - writer
266      # - reader
267  "type": "A String", # The account type. Allowed values are:
268      # - user
269      # - group
270      # - domain
271      # - anyone
272  "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
273    "A String",
274  ],
275  "selfLink": "A String", # A link back to this permission.
276  "photoLink": "A String", # A link to the profile photo, if available.
277}
278
279  supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
280  supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
281  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.
282  emailMessage: string, A plain text custom message to include in notification emails.
283  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.
284
285Returns:
286  An object of the form:
287
288    { # A permission for a file.
289    "withLink": True or False, # Whether the link is required for this permission.
290    "domain": "A String", # 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.
291    "permissionDetails": [ # 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.
292      {
293        "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
294            # - organizer
295            # - fileOrganizer
296            # - writer
297            # - reader
298        "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
299        "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
300            # - file
301            # - member
302        "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
303          "A String",
304        ],
305        "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
306      },
307    ],
308    "name": "A String", # The name for this permission.
309    "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
310      {
311        "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
312        "role": "A String", # Deprecated - use permissionDetails/role instead.
313        "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
314          "A String",
315        ],
316        "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
317        "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
318      },
319    ],
320    "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
321    "kind": "drive#permission", # This is always drive#permission.
322    "value": "A String", # 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.
323    "id": "A String", # 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.
324    "authKey": "A String", # Deprecated.
325    "etag": "A String", # The ETag of the permission.
326    "emailAddress": "A String", # 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.
327    "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
328        # - They can only be set on user and group permissions
329        # - The date must be in the future
330        # - The date cannot be more than a year in the future
331        # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
332    "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
333        # - owner
334        # - organizer
335        # - fileOrganizer
336        # - writer
337        # - reader
338    "type": "A String", # The account type. Allowed values are:
339        # - user
340        # - group
341        # - domain
342        # - anyone
343    "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
344      "A String",
345    ],
346    "selfLink": "A String", # A link back to this permission.
347    "photoLink": "A String", # A link to the profile photo, if available.
348  }</pre>
349</div>
350
351<div class="method">
352    <code class="details" id="list">list(fileId, pageToken=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, maxResults=None)</code>
353  <pre>Lists a file's or shared drive's permissions.
354
355Args:
356  fileId: string, The ID for the file or shared drive. (required)
357  pageToken: string, The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.
358  supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
359  supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
360  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.
361  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.
362
363Returns:
364  An object of the form:
365
366    { # A list of permissions associated with a file.
367    "nextPageToken": "A String", # 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.
368    "items": [ # The list of permissions.
369      { # A permission for a file.
370        "withLink": True or False, # Whether the link is required for this permission.
371        "domain": "A String", # 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.
372        "permissionDetails": [ # 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.
373          {
374            "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
375                # - organizer
376                # - fileOrganizer
377                # - writer
378                # - reader
379            "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
380            "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
381                # - file
382                # - member
383            "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
384              "A String",
385            ],
386            "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
387          },
388        ],
389        "name": "A String", # The name for this permission.
390        "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
391          {
392            "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
393            "role": "A String", # Deprecated - use permissionDetails/role instead.
394            "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
395              "A String",
396            ],
397            "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
398            "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
399          },
400        ],
401        "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
402        "kind": "drive#permission", # This is always drive#permission.
403        "value": "A String", # 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.
404        "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
405        "authKey": "A String", # Deprecated.
406        "etag": "A String", # The ETag of the permission.
407        "emailAddress": "A String", # 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.
408        "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
409            # - They can only be set on user and group permissions
410            # - The date must be in the future
411            # - The date cannot be more than a year in the future
412            # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
413        "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
414            # - owner
415            # - organizer
416            # - fileOrganizer
417            # - writer
418            # - reader
419        "type": "A String", # The account type. Allowed values are:
420            # - user
421            # - group
422            # - domain
423            # - anyone
424        "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
425          "A String",
426        ],
427        "selfLink": "A String", # A link back to this permission.
428        "photoLink": "A String", # A link to the profile photo, if available.
429      },
430    ],
431    "kind": "drive#permissionList", # This is always drive#permissionList.
432    "etag": "A String", # The ETag of the list.
433    "selfLink": "A String", # A link back to this list.
434  }</pre>
435</div>
436
437<div class="method">
438    <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
439  <pre>Retrieves the next page of results.
440
441Args:
442  previous_request: The request for the previous page. (required)
443  previous_response: The response from the request for the previous page. (required)
444
445Returns:
446  A request object that you can call 'execute()' on to request the next
447  page. Returns None if there are no more items in the collection.
448    </pre>
449</div>
450
451<div class="method">
452    <code class="details" id="patch">patch(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, transferOwnership=None)</code>
453  <pre>Updates a permission using patch semantics.
454
455Args:
456  fileId: string, The ID for the file or shared drive. (required)
457  permissionId: string, The ID for the permission. (required)
458  body: object, The request body. (required)
459    The object takes the form of:
460
461{ # A permission for a file.
462  "withLink": True or False, # Whether the link is required for this permission.
463  "domain": "A String", # 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.
464  "permissionDetails": [ # 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.
465    {
466      "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
467          # - organizer
468          # - fileOrganizer
469          # - writer
470          # - reader
471      "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
472      "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
473          # - file
474          # - member
475      "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
476        "A String",
477      ],
478      "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
479    },
480  ],
481  "name": "A String", # The name for this permission.
482  "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
483    {
484      "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
485      "role": "A String", # Deprecated - use permissionDetails/role instead.
486      "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
487        "A String",
488      ],
489      "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
490      "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
491    },
492  ],
493  "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
494  "kind": "drive#permission", # This is always drive#permission.
495  "value": "A String", # 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.
496  "id": "A String", # 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.
497  "authKey": "A String", # Deprecated.
498  "etag": "A String", # The ETag of the permission.
499  "emailAddress": "A String", # 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.
500  "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
501      # - They can only be set on user and group permissions
502      # - The date must be in the future
503      # - The date cannot be more than a year in the future
504      # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
505  "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
506      # - owner
507      # - organizer
508      # - fileOrganizer
509      # - writer
510      # - reader
511  "type": "A String", # The account type. Allowed values are:
512      # - user
513      # - group
514      # - domain
515      # - anyone
516  "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
517    "A String",
518  ],
519  "selfLink": "A String", # A link back to this permission.
520  "photoLink": "A String", # A link to the profile photo, if available.
521}
522
523  removeExpiration: boolean, Whether to remove the expiration date.
524  supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
525  supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
526  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.
527  transferOwnership: boolean, Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.
528
529Returns:
530  An object of the form:
531
532    { # A permission for a file.
533    "withLink": True or False, # Whether the link is required for this permission.
534    "domain": "A String", # 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.
535    "permissionDetails": [ # 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.
536      {
537        "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
538            # - organizer
539            # - fileOrganizer
540            # - writer
541            # - reader
542        "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
543        "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
544            # - file
545            # - member
546        "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
547          "A String",
548        ],
549        "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
550      },
551    ],
552    "name": "A String", # The name for this permission.
553    "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
554      {
555        "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
556        "role": "A String", # Deprecated - use permissionDetails/role instead.
557        "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
558          "A String",
559        ],
560        "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
561        "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
562      },
563    ],
564    "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
565    "kind": "drive#permission", # This is always drive#permission.
566    "value": "A String", # 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.
567    "id": "A String", # 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.
568    "authKey": "A String", # Deprecated.
569    "etag": "A String", # The ETag of the permission.
570    "emailAddress": "A String", # 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.
571    "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
572        # - They can only be set on user and group permissions
573        # - The date must be in the future
574        # - The date cannot be more than a year in the future
575        # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
576    "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
577        # - owner
578        # - organizer
579        # - fileOrganizer
580        # - writer
581        # - reader
582    "type": "A String", # The account type. Allowed values are:
583        # - user
584        # - group
585        # - domain
586        # - anyone
587    "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
588      "A String",
589    ],
590    "selfLink": "A String", # A link back to this permission.
591    "photoLink": "A String", # A link to the profile photo, if available.
592  }</pre>
593</div>
594
595<div class="method">
596    <code class="details" id="update">update(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, transferOwnership=None)</code>
597  <pre>Updates a permission.
598
599Args:
600  fileId: string, The ID for the file or shared drive. (required)
601  permissionId: string, The ID for the permission. (required)
602  body: object, The request body. (required)
603    The object takes the form of:
604
605{ # A permission for a file.
606  "withLink": True or False, # Whether the link is required for this permission.
607  "domain": "A String", # 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.
608  "permissionDetails": [ # 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.
609    {
610      "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
611          # - organizer
612          # - fileOrganizer
613          # - writer
614          # - reader
615      "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
616      "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
617          # - file
618          # - member
619      "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
620        "A String",
621      ],
622      "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
623    },
624  ],
625  "name": "A String", # The name for this permission.
626  "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
627    {
628      "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
629      "role": "A String", # Deprecated - use permissionDetails/role instead.
630      "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
631        "A String",
632      ],
633      "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
634      "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
635    },
636  ],
637  "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
638  "kind": "drive#permission", # This is always drive#permission.
639  "value": "A String", # 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.
640  "id": "A String", # 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.
641  "authKey": "A String", # Deprecated.
642  "etag": "A String", # The ETag of the permission.
643  "emailAddress": "A String", # 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.
644  "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
645      # - They can only be set on user and group permissions
646      # - The date must be in the future
647      # - The date cannot be more than a year in the future
648      # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
649  "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
650      # - owner
651      # - organizer
652      # - fileOrganizer
653      # - writer
654      # - reader
655  "type": "A String", # The account type. Allowed values are:
656      # - user
657      # - group
658      # - domain
659      # - anyone
660  "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
661    "A String",
662  ],
663  "selfLink": "A String", # A link back to this permission.
664  "photoLink": "A String", # A link to the profile photo, if available.
665}
666
667  removeExpiration: boolean, Whether to remove the expiration date.
668  supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
669  supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
670  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.
671  transferOwnership: boolean, Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.
672
673Returns:
674  An object of the form:
675
676    { # A permission for a file.
677    "withLink": True or False, # Whether the link is required for this permission.
678    "domain": "A String", # 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.
679    "permissionDetails": [ # 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.
680      {
681        "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
682            # - organizer
683            # - fileOrganizer
684            # - writer
685            # - reader
686        "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
687        "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
688            # - file
689            # - member
690        "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
691          "A String",
692        ],
693        "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
694      },
695    ],
696    "name": "A String", # The name for this permission.
697    "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
698      {
699        "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
700        "role": "A String", # Deprecated - use permissionDetails/role instead.
701        "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
702          "A String",
703        ],
704        "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
705        "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
706      },
707    ],
708    "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
709    "kind": "drive#permission", # This is always drive#permission.
710    "value": "A String", # 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.
711    "id": "A String", # 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.
712    "authKey": "A String", # Deprecated.
713    "etag": "A String", # The ETag of the permission.
714    "emailAddress": "A String", # 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.
715    "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
716        # - They can only be set on user and group permissions
717        # - The date must be in the future
718        # - The date cannot be more than a year in the future
719        # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
720    "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
721        # - owner
722        # - organizer
723        # - fileOrganizer
724        # - writer
725        # - reader
726    "type": "A String", # The account type. Allowed values are:
727        # - user
728        # - group
729        # - domain
730        # - anyone
731    "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
732      "A String",
733    ],
734    "selfLink": "A String", # A link back to this permission.
735    "photoLink": "A String", # A link to the profile photo, if available.
736  }</pre>
737</div>
738
739</body></html>