• 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)</a></code></p>
79<p class="firstline">Deletes a permission from a file or Team Drive.</p>
80<p class="toc_element">
81  <code><a href="#get">get(fileId, permissionId, supportsTeamDrives=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, sendNotificationEmails=None, emailMessage=None)</a></code></p>
88<p class="firstline">Inserts a permission for a file or Team Drive.</p>
89<p class="toc_element">
90  <code><a href="#list">list(fileId, pageToken=None, supportsTeamDrives=None, maxResults=None)</a></code></p>
91<p class="firstline">Lists a file's or Team 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, 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, 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)</code>
104  <pre>Deletes a permission from a file or Team Drive.
105
106Args:
107  fileId: string, The ID for the file or Team Drive. (required)
108  permissionId: string, The ID for the permission. (required)
109  supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
110</pre>
111</div>
112
113<div class="method">
114    <code class="details" id="get">get(fileId, permissionId, supportsTeamDrives=None)</code>
115  <pre>Gets a permission by ID.
116
117Args:
118  fileId: string, The ID for the file or Team Drive. (required)
119  permissionId: string, The ID for the permission. (required)
120  supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
121
122Returns:
123  An object of the form:
124
125    { # A permission for a file.
126    "withLink": True or False, # Whether the link is required for this permission.
127    "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.
128    "name": "A String", # The name for this permission.
129    "teamDrivePermissionDetails": [ # Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
130      {
131        "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 Team Drive.
132        "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
133            # - organizer
134            # - reader
135            # - writer
136        "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
137          "A String",
138        ],
139        "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
140            # - file
141            # - member
142        "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
143      },
144    ],
145    "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
146    "kind": "drive#permission", # This is always drive#permission.
147    "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.
148    "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.
149    "authKey": "A String", # The authkey parameter required for this permission.
150    "etag": "A String", # The ETag of the permission.
151    "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.
152    "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
153        # - They can only be set on user and group permissions
154        # - The date must be in the future
155        # - The date cannot be more than a year in the future
156        # - The date can only be set on drive.permissions.update requests
157    "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
158        # - organizer
159        # - owner
160        # - reader
161        # - writer
162    "type": "A String", # The account type. Allowed values are:
163        # - user
164        # - group
165        # - domain
166        # - anyone
167    "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
168      "A String",
169    ],
170    "selfLink": "A String", # A link back to this permission.
171    "photoLink": "A String", # A link to the profile photo, if available.
172  }</pre>
173</div>
174
175<div class="method">
176    <code class="details" id="getIdForEmail">getIdForEmail(email)</code>
177  <pre>Returns the permission ID for an email address.
178
179Args:
180  email: string, The email address for which to return a permission ID (required)
181
182Returns:
183  An object of the form:
184
185    { # An ID for a user or group as seen in Permission items.
186    "kind": "drive#permissionId", # This is always drive#permissionId.
187    "id": "A String", # The permission ID.
188  }</pre>
189</div>
190
191<div class="method">
192    <code class="details" id="insert">insert(fileId, body, supportsTeamDrives=None, sendNotificationEmails=None, emailMessage=None)</code>
193  <pre>Inserts a permission for a file or Team Drive.
194
195Args:
196  fileId: string, The ID for the file or Team Drive. (required)
197  body: object, The request body. (required)
198    The object takes the form of:
199
200{ # A permission for a file.
201  "withLink": True or False, # Whether the link is required for this permission.
202  "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.
203  "name": "A String", # The name for this permission.
204  "teamDrivePermissionDetails": [ # Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
205    {
206      "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 Team Drive.
207      "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
208          # - organizer
209          # - reader
210          # - writer
211      "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
212        "A String",
213      ],
214      "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
215          # - file
216          # - member
217      "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
218    },
219  ],
220  "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
221  "kind": "drive#permission", # This is always drive#permission.
222  "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.
223  "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.
224  "authKey": "A String", # The authkey parameter required for this permission.
225  "etag": "A String", # The ETag of the permission.
226  "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.
227  "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
228      # - They can only be set on user and group permissions
229      # - The date must be in the future
230      # - The date cannot be more than a year in the future
231      # - The date can only be set on drive.permissions.update requests
232  "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
233      # - organizer
234      # - owner
235      # - reader
236      # - writer
237  "type": "A String", # The account type. Allowed values are:
238      # - user
239      # - group
240      # - domain
241      # - anyone
242  "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
243    "A String",
244  ],
245  "selfLink": "A String", # A link back to this permission.
246  "photoLink": "A String", # A link to the profile photo, if available.
247}
248
249  supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
250  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.
251  emailMessage: string, A custom message to include in notification emails.
252
253Returns:
254  An object of the form:
255
256    { # A permission for a file.
257    "withLink": True or False, # Whether the link is required for this permission.
258    "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.
259    "name": "A String", # The name for this permission.
260    "teamDrivePermissionDetails": [ # Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
261      {
262        "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 Team Drive.
263        "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
264            # - organizer
265            # - reader
266            # - writer
267        "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
268          "A String",
269        ],
270        "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
271            # - file
272            # - member
273        "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
274      },
275    ],
276    "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
277    "kind": "drive#permission", # This is always drive#permission.
278    "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.
279    "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.
280    "authKey": "A String", # The authkey parameter required for this permission.
281    "etag": "A String", # The ETag of the permission.
282    "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.
283    "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
284        # - They can only be set on user and group permissions
285        # - The date must be in the future
286        # - The date cannot be more than a year in the future
287        # - The date can only be set on drive.permissions.update requests
288    "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
289        # - organizer
290        # - owner
291        # - reader
292        # - writer
293    "type": "A String", # The account type. Allowed values are:
294        # - user
295        # - group
296        # - domain
297        # - anyone
298    "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
299      "A String",
300    ],
301    "selfLink": "A String", # A link back to this permission.
302    "photoLink": "A String", # A link to the profile photo, if available.
303  }</pre>
304</div>
305
306<div class="method">
307    <code class="details" id="list">list(fileId, pageToken=None, supportsTeamDrives=None, maxResults=None)</code>
308  <pre>Lists a file's or Team Drive's permissions.
309
310Args:
311  fileId: string, The ID for the file or Team Drive. (required)
312  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.
313  supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
314  maxResults: integer, The maximum number of permissions to return per page. When not set for files in a Team Drive, at most 100 results will be returned. When not set for files that are not in a Team Drive, the entire list will be returned.
315
316Returns:
317  An object of the form:
318
319    { # A list of permissions associated with a file.
320    "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.
321    "items": [ # The list of permissions.
322      { # A permission for a file.
323        "withLink": True or False, # Whether the link is required for this permission.
324        "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.
325        "name": "A String", # The name for this permission.
326        "teamDrivePermissionDetails": [ # Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
327          {
328            "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 Team Drive.
329            "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
330                # - organizer
331                # - reader
332                # - writer
333            "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
334              "A String",
335            ],
336            "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
337                # - file
338                # - member
339            "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
340          },
341        ],
342        "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
343        "kind": "drive#permission", # This is always drive#permission.
344        "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.
345        "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.
346        "authKey": "A String", # The authkey parameter required for this permission.
347        "etag": "A String", # The ETag of the permission.
348        "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.
349        "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
350            # - They can only be set on user and group permissions
351            # - The date must be in the future
352            # - The date cannot be more than a year in the future
353            # - The date can only be set on drive.permissions.update requests
354        "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
355            # - organizer
356            # - owner
357            # - reader
358            # - writer
359        "type": "A String", # The account type. Allowed values are:
360            # - user
361            # - group
362            # - domain
363            # - anyone
364        "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
365          "A String",
366        ],
367        "selfLink": "A String", # A link back to this permission.
368        "photoLink": "A String", # A link to the profile photo, if available.
369      },
370    ],
371    "kind": "drive#permissionList", # This is always drive#permissionList.
372    "etag": "A String", # The ETag of the list.
373    "selfLink": "A String", # A link back to this list.
374  }</pre>
375</div>
376
377<div class="method">
378    <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
379  <pre>Retrieves the next page of results.
380
381Args:
382  previous_request: The request for the previous page. (required)
383  previous_response: The response from the request for the previous page. (required)
384
385Returns:
386  A request object that you can call 'execute()' on to request the next
387  page. Returns None if there are no more items in the collection.
388    </pre>
389</div>
390
391<div class="method">
392    <code class="details" id="patch">patch(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, transferOwnership=None)</code>
393  <pre>Updates a permission using patch semantics.
394
395Args:
396  fileId: string, The ID for the file or Team Drive. (required)
397  permissionId: string, The ID for the permission. (required)
398  body: object, The request body. (required)
399    The object takes the form of:
400
401{ # A permission for a file.
402  "withLink": True or False, # Whether the link is required for this permission.
403  "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.
404  "name": "A String", # The name for this permission.
405  "teamDrivePermissionDetails": [ # Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
406    {
407      "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 Team Drive.
408      "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
409          # - organizer
410          # - reader
411          # - writer
412      "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
413        "A String",
414      ],
415      "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
416          # - file
417          # - member
418      "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
419    },
420  ],
421  "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
422  "kind": "drive#permission", # This is always drive#permission.
423  "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.
424  "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.
425  "authKey": "A String", # The authkey parameter required for this permission.
426  "etag": "A String", # The ETag of the permission.
427  "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.
428  "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
429      # - They can only be set on user and group permissions
430      # - The date must be in the future
431      # - The date cannot be more than a year in the future
432      # - The date can only be set on drive.permissions.update requests
433  "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
434      # - organizer
435      # - owner
436      # - reader
437      # - writer
438  "type": "A String", # The account type. Allowed values are:
439      # - user
440      # - group
441      # - domain
442      # - anyone
443  "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
444    "A String",
445  ],
446  "selfLink": "A String", # A link back to this permission.
447  "photoLink": "A String", # A link to the profile photo, if available.
448}
449
450  removeExpiration: boolean, Whether to remove the expiration date.
451  supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
452  transferOwnership: boolean, Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.
453
454Returns:
455  An object of the form:
456
457    { # A permission for a file.
458    "withLink": True or False, # Whether the link is required for this permission.
459    "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.
460    "name": "A String", # The name for this permission.
461    "teamDrivePermissionDetails": [ # Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
462      {
463        "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 Team Drive.
464        "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
465            # - organizer
466            # - reader
467            # - writer
468        "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
469          "A String",
470        ],
471        "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
472            # - file
473            # - member
474        "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
475      },
476    ],
477    "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
478    "kind": "drive#permission", # This is always drive#permission.
479    "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.
480    "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.
481    "authKey": "A String", # The authkey parameter required for this permission.
482    "etag": "A String", # The ETag of the permission.
483    "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.
484    "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
485        # - They can only be set on user and group permissions
486        # - The date must be in the future
487        # - The date cannot be more than a year in the future
488        # - The date can only be set on drive.permissions.update requests
489    "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
490        # - organizer
491        # - owner
492        # - reader
493        # - writer
494    "type": "A String", # The account type. Allowed values are:
495        # - user
496        # - group
497        # - domain
498        # - anyone
499    "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
500      "A String",
501    ],
502    "selfLink": "A String", # A link back to this permission.
503    "photoLink": "A String", # A link to the profile photo, if available.
504  }</pre>
505</div>
506
507<div class="method">
508    <code class="details" id="update">update(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, transferOwnership=None)</code>
509  <pre>Updates a permission.
510
511Args:
512  fileId: string, The ID for the file or Team Drive. (required)
513  permissionId: string, The ID for the permission. (required)
514  body: object, The request body. (required)
515    The object takes the form of:
516
517{ # A permission for a file.
518  "withLink": True or False, # Whether the link is required for this permission.
519  "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.
520  "name": "A String", # The name for this permission.
521  "teamDrivePermissionDetails": [ # Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
522    {
523      "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 Team Drive.
524      "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
525          # - organizer
526          # - reader
527          # - writer
528      "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
529        "A String",
530      ],
531      "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
532          # - file
533          # - member
534      "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
535    },
536  ],
537  "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
538  "kind": "drive#permission", # This is always drive#permission.
539  "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.
540  "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.
541  "authKey": "A String", # The authkey parameter required for this permission.
542  "etag": "A String", # The ETag of the permission.
543  "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.
544  "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
545      # - They can only be set on user and group permissions
546      # - The date must be in the future
547      # - The date cannot be more than a year in the future
548      # - The date can only be set on drive.permissions.update requests
549  "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
550      # - organizer
551      # - owner
552      # - reader
553      # - writer
554  "type": "A String", # The account type. Allowed values are:
555      # - user
556      # - group
557      # - domain
558      # - anyone
559  "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
560    "A String",
561  ],
562  "selfLink": "A String", # A link back to this permission.
563  "photoLink": "A String", # A link to the profile photo, if available.
564}
565
566  removeExpiration: boolean, Whether to remove the expiration date.
567  supportsTeamDrives: boolean, Whether the requesting application supports Team Drives.
568  transferOwnership: boolean, Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.
569
570Returns:
571  An object of the form:
572
573    { # A permission for a file.
574    "withLink": True or False, # Whether the link is required for this permission.
575    "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.
576    "name": "A String", # The name for this permission.
577    "teamDrivePermissionDetails": [ # Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items.
578      {
579        "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 Team Drive.
580        "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
581            # - organizer
582            # - reader
583            # - writer
584        "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
585          "A String",
586        ],
587        "teamDrivePermissionType": "A String", # The Team Drive permission type for this user. While new values may be added in future, the following are currently possible:
588            # - file
589            # - member
590        "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
591      },
592    ],
593    "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
594    "kind": "drive#permission", # This is always drive#permission.
595    "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.
596    "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.
597    "authKey": "A String", # The authkey parameter required for this permission.
598    "etag": "A String", # The ETag of the permission.
599    "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.
600    "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
601        # - They can only be set on user and group permissions
602        # - The date must be in the future
603        # - The date cannot be more than a year in the future
604        # - The date can only be set on drive.permissions.update requests
605    "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
606        # - organizer
607        # - owner
608        # - reader
609        # - writer
610    "type": "A String", # The account type. Allowed values are:
611        # - user
612        # - group
613        # - domain
614        # - anyone
615    "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
616      "A String",
617    ],
618    "selfLink": "A String", # A link back to this permission.
619    "photoLink": "A String", # A link to the profile photo, if available.
620  }</pre>
621</div>
622
623</body></html>