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="#close">close()</a></code></p> 79<p class="firstline">Close httplib2 connections.</p> 80<p class="toc_element"> 81 <code><a href="#delete">delete(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p> 82<p class="firstline">Deletes a permission from a file or shared drive.</p> 83<p class="toc_element"> 84 <code><a href="#get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p> 85<p class="firstline">Gets a permission by ID.</p> 86<p class="toc_element"> 87 <code><a href="#getIdForEmail">getIdForEmail(email)</a></code></p> 88<p class="firstline">Returns the permission ID for an email address.</p> 89<p class="toc_element"> 90 <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> 91<p class="firstline">Inserts a permission for a file or shared drive.</p> 92<p class="toc_element"> 93 <code><a href="#list">list(fileId, includePermissionsForView=None, maxResults=None, pageToken=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p> 94<p class="firstline">Lists a file's or shared drive's permissions.</p> 95<p class="toc_element"> 96 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 97<p class="firstline">Retrieves the next page of results.</p> 98<p class="toc_element"> 99 <code><a href="#patch">patch(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</a></code></p> 100<p class="firstline">Updates a permission using patch semantics.</p> 101<p class="toc_element"> 102 <code><a href="#update">update(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</a></code></p> 103<p class="firstline">Updates a permission.</p> 104<h3>Method Details</h3> 105<div class="method"> 106 <code class="details" id="close">close()</code> 107 <pre>Close httplib2 connections.</pre> 108</div> 109 110<div class="method"> 111 <code class="details" id="delete">delete(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code> 112 <pre>Deletes a permission from a file or shared drive. 113 114Args: 115 fileId: string, The ID for the file or shared drive. (required) 116 permissionId: string, The ID for the permission. (required) 117 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 118 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 119 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. 120</pre> 121</div> 122 123<div class="method"> 124 <code class="details" id="get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code> 125 <pre>Gets a permission by ID. 126 127Args: 128 fileId: string, The ID for the file or shared drive. (required) 129 permissionId: string, The ID for the permission. (required) 130 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 131 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 132 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. 133 134Returns: 135 An object of the form: 136 137 { # A permission for a file. 138 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 139 "A String", 140 ], 141 "authKey": "A String", # Deprecated. 142 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 143 "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. 144 "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. 145 "etag": "A String", # The ETag of the permission. 146 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 147 # - They cannot be set on shared drive items 148 # - They can only be set on user and group permissions 149 # - The date must be in the future 150 # - The date cannot be more than a year in the future 151 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 152 "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. 153 "kind": "drive#permission", # This is always drive#permission. 154 "name": "A String", # The name for this permission. 155 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 156 "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. 157 { 158 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 159 "A String", 160 ], 161 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 162 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 163 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 164 # - file 165 # - member 166 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 167 # - organizer 168 # - fileOrganizer 169 # - writer 170 # - reader 171 }, 172 ], 173 "photoLink": "A String", # A link to the profile photo, if available. 174 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 175 # - owner 176 # - organizer 177 # - fileOrganizer 178 # - writer 179 # - reader 180 "selfLink": "A String", # A link back to this permission. 181 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 182 { 183 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 184 "A String", 185 ], 186 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 187 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 188 "role": "A String", # Deprecated - use permissionDetails/role instead. 189 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 190 }, 191 ], 192 "type": "A String", # The account type. Allowed values are: 193 # - user 194 # - group 195 # - domain 196 # - anyone 197 "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. 198 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 199 "withLink": True or False, # Whether the link is required for this permission. 200}</pre> 201</div> 202 203<div class="method"> 204 <code class="details" id="getIdForEmail">getIdForEmail(email)</code> 205 <pre>Returns the permission ID for an email address. 206 207Args: 208 email: string, The email address for which to return a permission ID (required) 209 210Returns: 211 An object of the form: 212 213 { # An ID for a user or group as seen in Permission items. 214 "id": "A String", # The permission ID. 215 "kind": "drive#permissionId", # This is always drive#permissionId. 216}</pre> 217</div> 218 219<div class="method"> 220 <code class="details" id="insert">insert(fileId, body=None, emailMessage=None, enforceSingleParent=None, moveToNewOwnersRoot=None, sendNotificationEmails=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code> 221 <pre>Inserts a permission for a file or shared drive. 222 223Args: 224 fileId: string, The ID for the file or shared drive. (required) 225 body: object, The request body. 226 The object takes the form of: 227 228{ # A permission for a file. 229 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 230 "A String", 231 ], 232 "authKey": "A String", # Deprecated. 233 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 234 "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. 235 "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. 236 "etag": "A String", # The ETag of the permission. 237 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 238 # - They cannot be set on shared drive items 239 # - They can only be set on user and group permissions 240 # - The date must be in the future 241 # - The date cannot be more than a year in the future 242 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 243 "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. 244 "kind": "drive#permission", # This is always drive#permission. 245 "name": "A String", # The name for this permission. 246 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 247 "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. 248 { 249 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 250 "A String", 251 ], 252 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 253 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 254 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 255 # - file 256 # - member 257 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 258 # - organizer 259 # - fileOrganizer 260 # - writer 261 # - reader 262 }, 263 ], 264 "photoLink": "A String", # A link to the profile photo, if available. 265 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 266 # - owner 267 # - organizer 268 # - fileOrganizer 269 # - writer 270 # - reader 271 "selfLink": "A String", # A link back to this permission. 272 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 273 { 274 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 275 "A String", 276 ], 277 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 278 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 279 "role": "A String", # Deprecated - use permissionDetails/role instead. 280 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 281 }, 282 ], 283 "type": "A String", # The account type. Allowed values are: 284 # - user 285 # - group 286 # - domain 287 # - anyone 288 "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. 289 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 290 "withLink": True or False, # Whether the link is required for this permission. 291} 292 293 emailMessage: string, A plain text custom message to include in notification emails. 294 enforceSingleParent: boolean, Deprecated. See moveToNewOwnersRoot for details. 295 moveToNewOwnersRoot: boolean, This parameter will only take effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. If set to true, the item will be moved to the new owner's My Drive root folder and all prior parents removed. If set to false, parents are not changed. 296 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. 297 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 298 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 299 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. 300 301Returns: 302 An object of the form: 303 304 { # A permission for a file. 305 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 306 "A String", 307 ], 308 "authKey": "A String", # Deprecated. 309 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 310 "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. 311 "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. 312 "etag": "A String", # The ETag of the permission. 313 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 314 # - They cannot be set on shared drive items 315 # - They can only be set on user and group permissions 316 # - The date must be in the future 317 # - The date cannot be more than a year in the future 318 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 319 "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. 320 "kind": "drive#permission", # This is always drive#permission. 321 "name": "A String", # The name for this permission. 322 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 323 "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. 324 { 325 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 326 "A String", 327 ], 328 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 329 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 330 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 331 # - file 332 # - member 333 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 334 # - organizer 335 # - fileOrganizer 336 # - writer 337 # - reader 338 }, 339 ], 340 "photoLink": "A String", # A link to the profile photo, if available. 341 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 342 # - owner 343 # - organizer 344 # - fileOrganizer 345 # - writer 346 # - reader 347 "selfLink": "A String", # A link back to this permission. 348 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 349 { 350 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 351 "A String", 352 ], 353 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 354 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 355 "role": "A String", # Deprecated - use permissionDetails/role instead. 356 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 357 }, 358 ], 359 "type": "A String", # The account type. Allowed values are: 360 # - user 361 # - group 362 # - domain 363 # - anyone 364 "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. 365 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 366 "withLink": True or False, # Whether the link is required for this permission. 367}</pre> 368</div> 369 370<div class="method"> 371 <code class="details" id="list">list(fileId, includePermissionsForView=None, maxResults=None, pageToken=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code> 372 <pre>Lists a file's or shared drive's permissions. 373 374Args: 375 fileId: string, The ID for the file or shared drive. (required) 376 includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. 377 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. 378 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. 379 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 380 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 381 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. 382 383Returns: 384 An object of the form: 385 386 { # A list of permissions associated with a file. 387 "etag": "A String", # The ETag of the list. 388 "items": [ # The list of permissions. 389 { # A permission for a file. 390 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 391 "A String", 392 ], 393 "authKey": "A String", # Deprecated. 394 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 395 "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. 396 "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. 397 "etag": "A String", # The ETag of the permission. 398 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 399 # - They cannot be set on shared drive items 400 # - They can only be set on user and group permissions 401 # - The date must be in the future 402 # - The date cannot be more than a year in the future 403 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 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 "kind": "drive#permission", # This is always drive#permission. 406 "name": "A String", # The name for this permission. 407 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 408 "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. 409 { 410 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 411 "A String", 412 ], 413 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 414 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 415 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 416 # - file 417 # - member 418 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 419 # - organizer 420 # - fileOrganizer 421 # - writer 422 # - reader 423 }, 424 ], 425 "photoLink": "A String", # A link to the profile photo, if available. 426 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 427 # - owner 428 # - organizer 429 # - fileOrganizer 430 # - writer 431 # - reader 432 "selfLink": "A String", # A link back to this permission. 433 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 434 { 435 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 436 "A String", 437 ], 438 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 439 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 440 "role": "A String", # Deprecated - use permissionDetails/role instead. 441 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 442 }, 443 ], 444 "type": "A String", # The account type. Allowed values are: 445 # - user 446 # - group 447 # - domain 448 # - anyone 449 "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. 450 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 451 "withLink": True or False, # Whether the link is required for this permission. 452 }, 453 ], 454 "kind": "drive#permissionList", # This is always drive#permissionList. 455 "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. 456 "selfLink": "A String", # A link back to this list. 457}</pre> 458</div> 459 460<div class="method"> 461 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 462 <pre>Retrieves the next page of results. 463 464Args: 465 previous_request: The request for the previous page. (required) 466 previous_response: The response from the request for the previous page. (required) 467 468Returns: 469 A request object that you can call 'execute()' on to request the next 470 page. Returns None if there are no more items in the collection. 471 </pre> 472</div> 473 474<div class="method"> 475 <code class="details" id="patch">patch(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</code> 476 <pre>Updates a permission using patch semantics. 477 478Args: 479 fileId: string, The ID for the file or shared drive. (required) 480 permissionId: string, The ID for the permission. (required) 481 body: object, The request body. 482 The object takes the form of: 483 484{ # A permission for a file. 485 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 486 "A String", 487 ], 488 "authKey": "A String", # Deprecated. 489 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 490 "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. 491 "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. 492 "etag": "A String", # The ETag of the permission. 493 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 494 # - They cannot be set on shared drive items 495 # - They can only be set on user and group permissions 496 # - The date must be in the future 497 # - The date cannot be more than a year in the future 498 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 499 "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. 500 "kind": "drive#permission", # This is always drive#permission. 501 "name": "A String", # The name for this permission. 502 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 503 "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. 504 { 505 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 506 "A String", 507 ], 508 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 509 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 510 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 511 # - file 512 # - member 513 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 514 # - organizer 515 # - fileOrganizer 516 # - writer 517 # - reader 518 }, 519 ], 520 "photoLink": "A String", # A link to the profile photo, if available. 521 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 522 # - owner 523 # - organizer 524 # - fileOrganizer 525 # - writer 526 # - reader 527 "selfLink": "A String", # A link back to this permission. 528 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 529 { 530 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 531 "A String", 532 ], 533 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 534 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 535 "role": "A String", # Deprecated - use permissionDetails/role instead. 536 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 537 }, 538 ], 539 "type": "A String", # The account type. Allowed values are: 540 # - user 541 # - group 542 # - domain 543 # - anyone 544 "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. 545 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 546 "withLink": True or False, # Whether the link is required for this permission. 547} 548 549 removeExpiration: boolean, Whether to remove the expiration date. 550 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 551 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 552 transferOwnership: boolean, Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'. 553 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. 554 555Returns: 556 An object of the form: 557 558 { # A permission for a file. 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 "authKey": "A String", # Deprecated. 563 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 564 "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. 565 "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. 566 "etag": "A String", # The ETag of the permission. 567 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 568 # - They cannot be set on shared drive items 569 # - They can only be set on user and group permissions 570 # - The date must be in the future 571 # - The date cannot be more than a year in the future 572 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 573 "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. 574 "kind": "drive#permission", # This is always drive#permission. 575 "name": "A String", # The name for this permission. 576 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 577 "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. 578 { 579 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 580 "A String", 581 ], 582 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 583 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 584 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 585 # - file 586 # - member 587 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 588 # - organizer 589 # - fileOrganizer 590 # - writer 591 # - reader 592 }, 593 ], 594 "photoLink": "A String", # A link to the profile photo, if available. 595 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 596 # - owner 597 # - organizer 598 # - fileOrganizer 599 # - writer 600 # - reader 601 "selfLink": "A String", # A link back to this permission. 602 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 603 { 604 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 605 "A String", 606 ], 607 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 608 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 609 "role": "A String", # Deprecated - use permissionDetails/role instead. 610 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 611 }, 612 ], 613 "type": "A String", # The account type. Allowed values are: 614 # - user 615 # - group 616 # - domain 617 # - anyone 618 "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. 619 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 620 "withLink": True or False, # Whether the link is required for this permission. 621}</pre> 622</div> 623 624<div class="method"> 625 <code class="details" id="update">update(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</code> 626 <pre>Updates a permission. 627 628Args: 629 fileId: string, The ID for the file or shared drive. (required) 630 permissionId: string, The ID for the permission. (required) 631 body: object, The request body. 632 The object takes the form of: 633 634{ # A permission for a file. 635 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 636 "A String", 637 ], 638 "authKey": "A String", # Deprecated. 639 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 640 "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. 641 "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. 642 "etag": "A String", # The ETag of the permission. 643 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 644 # - They cannot be set on shared drive items 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 "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. 650 "kind": "drive#permission", # This is always drive#permission. 651 "name": "A String", # The name for this permission. 652 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 653 "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. 654 { 655 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 656 "A String", 657 ], 658 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 659 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 660 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 661 # - file 662 # - member 663 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 664 # - organizer 665 # - fileOrganizer 666 # - writer 667 # - reader 668 }, 669 ], 670 "photoLink": "A String", # A link to the profile photo, if available. 671 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 672 # - owner 673 # - organizer 674 # - fileOrganizer 675 # - writer 676 # - reader 677 "selfLink": "A String", # A link back to this permission. 678 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 679 { 680 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 681 "A String", 682 ], 683 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 684 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 685 "role": "A String", # Deprecated - use permissionDetails/role instead. 686 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 687 }, 688 ], 689 "type": "A String", # The account type. Allowed values are: 690 # - user 691 # - group 692 # - domain 693 # - anyone 694 "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. 695 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 696 "withLink": True or False, # Whether the link is required for this permission. 697} 698 699 removeExpiration: boolean, Whether to remove the expiration date. 700 supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. 701 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. 702 transferOwnership: boolean, Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. File owners can only transfer ownership of files existing on My Drive. Files existing in a shared drive are owned by the organization that owns that shared drive. Ownership transfers are not supported for files and folders in shared drives. Organizers of a shared drive can move items from that shared drive into their My Drive which transfers the ownership to them. 703 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. 704 705Returns: 706 An object of the form: 707 708 { # A permission for a file. 709 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. 710 "A String", 711 ], 712 "authKey": "A String", # Deprecated. 713 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. 714 "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. 715 "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. 716 "etag": "A String", # The ETag of the permission. 717 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: 718 # - They cannot be set on shared drive items 719 # - They can only be set on user and group permissions 720 # - The date must be in the future 721 # - The date cannot be more than a year in the future 722 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests 723 "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. 724 "kind": "drive#permission", # This is always drive#permission. 725 "name": "A String", # The name for this permission. 726 "pendingOwner": True or False, # Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. 727 "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. 728 { 729 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. 730 "A String", 731 ], 732 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. 733 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. 734 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: 735 # - file 736 # - member 737 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: 738 # - organizer 739 # - fileOrganizer 740 # - writer 741 # - reader 742 }, 743 ], 744 "photoLink": "A String", # A link to the profile photo, if available. 745 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed: 746 # - owner 747 # - organizer 748 # - fileOrganizer 749 # - writer 750 # - reader 751 "selfLink": "A String", # A link back to this permission. 752 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. 753 { 754 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead. 755 "A String", 756 ], 757 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. 758 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. 759 "role": "A String", # Deprecated - use permissionDetails/role instead. 760 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. 761 }, 762 ], 763 "type": "A String", # The account type. Allowed values are: 764 # - user 765 # - group 766 # - domain 767 # - anyone 768 "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. 769 "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. 770 "withLink": True or False, # Whether the link is required for this permission. 771}</pre> 772</div> 773 774</body></html>