John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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)</a></code></p> |
| 79 | <p class="firstline">Deletes a permission from a file.</p> |
| 80 | <p class="toc_element"> |
| 81 | <code><a href="#get">get(fileId, permissionId)</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, sendNotificationEmails=None, emailMessage=None)</a></code></p> |
| 88 | <p class="firstline">Inserts a permission for a file.</p> |
| 89 | <p class="toc_element"> |
| 90 | <code><a href="#list">list(fileId)</a></code></p> |
| 91 | <p class="firstline">Lists a file's permissions.</p> |
| 92 | <p class="toc_element"> |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 93 | <code><a href="#patch">patch(fileId, permissionId, body, removeExpiration=None, transferOwnership=None)</a></code></p> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 94 | <p class="firstline">Updates a permission using patch semantics.</p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 95 | <p class="toc_element"> |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 96 | <code><a href="#update">update(fileId, permissionId, body, removeExpiration=None, transferOwnership=None)</a></code></p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 97 | <p class="firstline">Updates a permission.</p> |
| 98 | <h3>Method Details</h3> |
| 99 | <div class="method"> |
| 100 | <code class="details" id="delete">delete(fileId, permissionId)</code> |
| 101 | <pre>Deletes a permission from a file. |
| 102 | |
| 103 | Args: |
| 104 | fileId: string, The ID for the file. (required) |
| 105 | permissionId: string, The ID for the permission. (required) |
| 106 | </pre> |
| 107 | </div> |
| 108 | |
| 109 | <div class="method"> |
| 110 | <code class="details" id="get">get(fileId, permissionId)</code> |
| 111 | <pre>Gets a permission by ID. |
| 112 | |
| 113 | Args: |
| 114 | fileId: string, The ID for the file. (required) |
| 115 | permissionId: string, The ID for the permission. (required) |
| 116 | |
| 117 | Returns: |
| 118 | An object of the form: |
| 119 | |
| 120 | { # A permission for a file. |
| 121 | "withLink": True or False, # Whether the link is required for this permission. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 122 | "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. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 123 | "name": "A String", # The name for this permission. |
| 124 | "kind": "drive#permission", # This is always drive#permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 125 | "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 anyone, in which case both id and value are ignored. |
| 126 | "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 anyone, in which case both id and value are ignored. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 127 | "authKey": "A String", # The authkey parameter required for this permission. |
| 128 | "etag": "A String", # The ETag of the permission. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 129 | "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. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 130 | "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 131 | "role": "A String", # The primary role for this user. Allowed values are: |
| 132 | # - owner |
| 133 | # - reader |
| 134 | # - writer |
| 135 | "type": "A String", # The account type. Allowed values are: |
| 136 | # - user |
| 137 | # - group |
| 138 | # - domain |
| 139 | # - anyone |
| 140 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 141 | "A String", |
| 142 | ], |
| 143 | "selfLink": "A String", # A link back to this permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 144 | "photoLink": "A String", # A link to the profile photo, if available. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 145 | }</pre> |
| 146 | </div> |
| 147 | |
| 148 | <div class="method"> |
| 149 | <code class="details" id="getIdForEmail">getIdForEmail(email)</code> |
| 150 | <pre>Returns the permission ID for an email address. |
| 151 | |
| 152 | Args: |
| 153 | email: string, The email address for which to return a permission ID (required) |
| 154 | |
| 155 | Returns: |
| 156 | An object of the form: |
| 157 | |
| 158 | { # An ID for a user or group as seen in Permission items. |
| 159 | "kind": "drive#permissionId", # This is always drive#permissionId. |
| 160 | "id": "A String", # The permission ID. |
| 161 | }</pre> |
| 162 | </div> |
| 163 | |
| 164 | <div class="method"> |
| 165 | <code class="details" id="insert">insert(fileId, body, sendNotificationEmails=None, emailMessage=None)</code> |
| 166 | <pre>Inserts a permission for a file. |
| 167 | |
| 168 | Args: |
| 169 | fileId: string, The ID for the file. (required) |
| 170 | body: object, The request body. (required) |
| 171 | The object takes the form of: |
| 172 | |
| 173 | { # A permission for a file. |
| 174 | "withLink": True or False, # Whether the link is required for this permission. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 175 | "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. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 176 | "name": "A String", # The name for this permission. |
| 177 | "kind": "drive#permission", # This is always drive#permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 178 | "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 anyone, in which case both id and value are ignored. |
| 179 | "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 anyone, in which case both id and value are ignored. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 180 | "authKey": "A String", # The authkey parameter required for this permission. |
| 181 | "etag": "A String", # The ETag of the permission. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 182 | "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. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 183 | "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 184 | "role": "A String", # The primary role for this user. Allowed values are: |
| 185 | # - owner |
| 186 | # - reader |
| 187 | # - writer |
| 188 | "type": "A String", # The account type. Allowed values are: |
| 189 | # - user |
| 190 | # - group |
| 191 | # - domain |
| 192 | # - anyone |
| 193 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 194 | "A String", |
| 195 | ], |
| 196 | "selfLink": "A String", # A link back to this permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 197 | "photoLink": "A String", # A link to the profile photo, if available. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 198 | } |
| 199 | |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 200 | 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. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 201 | emailMessage: string, A custom message to include in notification emails. |
| 202 | |
| 203 | Returns: |
| 204 | An object of the form: |
| 205 | |
| 206 | { # A permission for a file. |
| 207 | "withLink": True or False, # Whether the link is required for this permission. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 208 | "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. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 209 | "name": "A String", # The name for this permission. |
| 210 | "kind": "drive#permission", # This is always drive#permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 211 | "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 anyone, in which case both id and value are ignored. |
| 212 | "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 anyone, in which case both id and value are ignored. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 213 | "authKey": "A String", # The authkey parameter required for this permission. |
| 214 | "etag": "A String", # The ETag of the permission. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 215 | "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. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 216 | "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 217 | "role": "A String", # The primary role for this user. Allowed values are: |
| 218 | # - owner |
| 219 | # - reader |
| 220 | # - writer |
| 221 | "type": "A String", # The account type. Allowed values are: |
| 222 | # - user |
| 223 | # - group |
| 224 | # - domain |
| 225 | # - anyone |
| 226 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 227 | "A String", |
| 228 | ], |
| 229 | "selfLink": "A String", # A link back to this permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 230 | "photoLink": "A String", # A link to the profile photo, if available. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 231 | }</pre> |
| 232 | </div> |
| 233 | |
| 234 | <div class="method"> |
| 235 | <code class="details" id="list">list(fileId)</code> |
| 236 | <pre>Lists a file's permissions. |
| 237 | |
| 238 | Args: |
| 239 | fileId: string, The ID for the file. (required) |
| 240 | |
| 241 | Returns: |
| 242 | An object of the form: |
| 243 | |
| 244 | { # A list of permissions associated with a file. |
| 245 | "items": [ # The actual list of permissions. |
| 246 | { # A permission for a file. |
| 247 | "withLink": True or False, # Whether the link is required for this permission. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 248 | "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. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 249 | "name": "A String", # The name for this permission. |
| 250 | "kind": "drive#permission", # This is always drive#permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 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 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 anyone, in which case both id and value are ignored. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 253 | "authKey": "A String", # The authkey parameter required for this permission. |
| 254 | "etag": "A String", # The ETag of the permission. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 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. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 256 | "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 257 | "role": "A String", # The primary role for this user. Allowed values are: |
| 258 | # - owner |
| 259 | # - reader |
| 260 | # - writer |
| 261 | "type": "A String", # The account type. Allowed values are: |
| 262 | # - user |
| 263 | # - group |
| 264 | # - domain |
| 265 | # - anyone |
| 266 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 267 | "A String", |
| 268 | ], |
| 269 | "selfLink": "A String", # A link back to this permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 270 | "photoLink": "A String", # A link to the profile photo, if available. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 271 | }, |
| 272 | ], |
| 273 | "kind": "drive#permissionList", # This is always drive#permissionList. |
| 274 | "etag": "A String", # The ETag of the list. |
| 275 | "selfLink": "A String", # A link back to this list. |
| 276 | }</pre> |
| 277 | </div> |
| 278 | |
| 279 | <div class="method"> |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 280 | <code class="details" id="patch">patch(fileId, permissionId, body, removeExpiration=None, transferOwnership=None)</code> |
Takashi Matsuo | 0669410 | 2015-09-11 13:55:40 -0700 | [diff] [blame] | 281 | <pre>Updates a permission using patch semantics. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 282 | |
| 283 | Args: |
| 284 | fileId: string, The ID for the file. (required) |
| 285 | permissionId: string, The ID for the permission. (required) |
| 286 | body: object, The request body. (required) |
| 287 | The object takes the form of: |
| 288 | |
| 289 | { # A permission for a file. |
| 290 | "withLink": True or False, # Whether the link is required for this permission. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 291 | "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. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 292 | "name": "A String", # The name for this permission. |
| 293 | "kind": "drive#permission", # This is always drive#permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 294 | "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 anyone, in which case both id and value are ignored. |
| 295 | "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 anyone, in which case both id and value are ignored. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 296 | "authKey": "A String", # The authkey parameter required for this permission. |
| 297 | "etag": "A String", # The ETag of the permission. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 298 | "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. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 299 | "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 300 | "role": "A String", # The primary role for this user. Allowed values are: |
| 301 | # - owner |
| 302 | # - reader |
| 303 | # - writer |
| 304 | "type": "A String", # The account type. Allowed values are: |
| 305 | # - user |
| 306 | # - group |
| 307 | # - domain |
| 308 | # - anyone |
| 309 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 310 | "A String", |
| 311 | ], |
| 312 | "selfLink": "A String", # A link back to this permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 313 | "photoLink": "A String", # A link to the profile photo, if available. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 314 | } |
| 315 | |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 316 | removeExpiration: boolean, Whether to remove the expiration date. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 317 | transferOwnership: boolean, Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 318 | |
| 319 | Returns: |
| 320 | An object of the form: |
| 321 | |
| 322 | { # A permission for a file. |
| 323 | "withLink": True or False, # Whether the link is required for this permission. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 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. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 325 | "name": "A String", # The name for this permission. |
| 326 | "kind": "drive#permission", # This is always drive#permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 327 | "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 anyone, in which case both id and value are ignored. |
| 328 | "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 anyone, in which case both id and value are ignored. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 329 | "authKey": "A String", # The authkey parameter required for this permission. |
| 330 | "etag": "A String", # The ETag of the permission. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 331 | "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. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 332 | "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 333 | "role": "A String", # The primary role for this user. Allowed values are: |
| 334 | # - owner |
| 335 | # - reader |
| 336 | # - writer |
| 337 | "type": "A String", # The account type. Allowed values are: |
| 338 | # - user |
| 339 | # - group |
| 340 | # - domain |
| 341 | # - anyone |
| 342 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 343 | "A String", |
| 344 | ], |
| 345 | "selfLink": "A String", # A link back to this permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 346 | "photoLink": "A String", # A link to the profile photo, if available. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 347 | }</pre> |
| 348 | </div> |
| 349 | |
| 350 | <div class="method"> |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 351 | <code class="details" id="update">update(fileId, permissionId, body, removeExpiration=None, transferOwnership=None)</code> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 352 | <pre>Updates a permission. |
| 353 | |
| 354 | Args: |
| 355 | fileId: string, The ID for the file. (required) |
| 356 | permissionId: string, The ID for the permission. (required) |
| 357 | body: object, The request body. (required) |
| 358 | The object takes the form of: |
| 359 | |
| 360 | { # A permission for a file. |
| 361 | "withLink": True or False, # Whether the link is required for this permission. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 362 | "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. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 363 | "name": "A String", # The name for this permission. |
| 364 | "kind": "drive#permission", # This is always drive#permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 365 | "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 anyone, in which case both id and value are ignored. |
| 366 | "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 anyone, in which case both id and value are ignored. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 367 | "authKey": "A String", # The authkey parameter required for this permission. |
| 368 | "etag": "A String", # The ETag of the permission. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 369 | "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. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 370 | "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 371 | "role": "A String", # The primary role for this user. Allowed values are: |
| 372 | # - owner |
| 373 | # - reader |
| 374 | # - writer |
| 375 | "type": "A String", # The account type. Allowed values are: |
| 376 | # - user |
| 377 | # - group |
| 378 | # - domain |
| 379 | # - anyone |
| 380 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 381 | "A String", |
| 382 | ], |
| 383 | "selfLink": "A String", # A link back to this permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 384 | "photoLink": "A String", # A link to the profile photo, if available. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 385 | } |
| 386 | |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 387 | removeExpiration: boolean, Whether to remove the expiration date. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 388 | transferOwnership: boolean, Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 389 | |
| 390 | Returns: |
| 391 | An object of the form: |
| 392 | |
| 393 | { # A permission for a file. |
| 394 | "withLink": True or False, # Whether the link is required for this permission. |
Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 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. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 396 | "name": "A String", # The name for this permission. |
| 397 | "kind": "drive#permission", # This is always drive#permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 398 | "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 anyone, in which case both id and value are ignored. |
| 399 | "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 anyone, in which case both id and value are ignored. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 400 | "authKey": "A String", # The authkey parameter required for this permission. |
| 401 | "etag": "A String", # The ETag of the permission. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 402 | "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. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 403 | "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 404 | "role": "A String", # The primary role for this user. Allowed values are: |
| 405 | # - owner |
| 406 | # - reader |
| 407 | # - writer |
| 408 | "type": "A String", # The account type. Allowed values are: |
| 409 | # - user |
| 410 | # - group |
| 411 | # - domain |
| 412 | # - anyone |
| 413 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 414 | "A String", |
| 415 | ], |
| 416 | "selfLink": "A String", # A link back to this permission. |
Sai Cheemalapati | df61397 | 2016-10-21 13:59:49 -0700 | [diff] [blame] | 417 | "photoLink": "A String", # A link to the profile photo, if available. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 418 | }</pre> |
| 419 | </div> |
| 420 | |
| 421 | </body></html> |