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"> |
| 93 | <code><a href="#patch">patch(fileId, permissionId, body, transferOwnership=None)</a></code></p> |
| 94 | <p class="firstline">Updates a permission. This method supports patch semantics.</p> |
| 95 | <p class="toc_element"> |
| 96 | <code><a href="#update">update(fileId, permissionId, body, transferOwnership=None)</a></code></p> |
| 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. |
| 122 | "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain". |
| 123 | "name": "A String", # The name for this permission. |
| 124 | "kind": "drive#permission", # This is always drive#permission. |
| 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 'id' or 'value' fields must be specified. |
| 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 'id' or 'value' fields must be specified. |
| 127 | "authKey": "A String", # The authkey parameter required for this permission. |
| 128 | "etag": "A String", # The ETag of the permission. |
| 129 | "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address. |
| 130 | "photoLink": "A String", # A link to the profile photo, if available. |
| 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. |
| 144 | }</pre> |
| 145 | </div> |
| 146 | |
| 147 | <div class="method"> |
| 148 | <code class="details" id="getIdForEmail">getIdForEmail(email)</code> |
| 149 | <pre>Returns the permission ID for an email address. |
| 150 | |
| 151 | Args: |
| 152 | email: string, The email address for which to return a permission ID (required) |
| 153 | |
| 154 | Returns: |
| 155 | An object of the form: |
| 156 | |
| 157 | { # An ID for a user or group as seen in Permission items. |
| 158 | "kind": "drive#permissionId", # This is always drive#permissionId. |
| 159 | "id": "A String", # The permission ID. |
| 160 | }</pre> |
| 161 | </div> |
| 162 | |
| 163 | <div class="method"> |
| 164 | <code class="details" id="insert">insert(fileId, body, sendNotificationEmails=None, emailMessage=None)</code> |
| 165 | <pre>Inserts a permission for a file. |
| 166 | |
| 167 | Args: |
| 168 | fileId: string, The ID for the file. (required) |
| 169 | body: object, The request body. (required) |
| 170 | The object takes the form of: |
| 171 | |
| 172 | { # A permission for a file. |
| 173 | "withLink": True or False, # Whether the link is required for this permission. |
| 174 | "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain". |
| 175 | "name": "A String", # The name for this permission. |
| 176 | "kind": "drive#permission", # This is always drive#permission. |
| 177 | "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 'id' or 'value' fields must be specified. |
| 178 | "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 'id' or 'value' fields must be specified. |
| 179 | "authKey": "A String", # The authkey parameter required for this permission. |
| 180 | "etag": "A String", # The ETag of the permission. |
| 181 | "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address. |
| 182 | "photoLink": "A String", # A link to the profile photo, if available. |
| 183 | "role": "A String", # The primary role for this user. Allowed values are: |
| 184 | # - owner |
| 185 | # - reader |
| 186 | # - writer |
| 187 | "type": "A String", # The account type. Allowed values are: |
| 188 | # - user |
| 189 | # - group |
| 190 | # - domain |
| 191 | # - anyone |
| 192 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 193 | "A String", |
| 194 | ], |
| 195 | "selfLink": "A String", # A link back to this permission. |
| 196 | } |
| 197 | |
| 198 | sendNotificationEmails: boolean, Whether to send notification emails when sharing to users or groups. |
| 199 | emailMessage: string, A custom message to include in notification emails. |
| 200 | |
| 201 | Returns: |
| 202 | An object of the form: |
| 203 | |
| 204 | { # A permission for a file. |
| 205 | "withLink": True or False, # Whether the link is required for this permission. |
| 206 | "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain". |
| 207 | "name": "A String", # The name for this permission. |
| 208 | "kind": "drive#permission", # This is always drive#permission. |
| 209 | "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 'id' or 'value' fields must be specified. |
| 210 | "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 'id' or 'value' fields must be specified. |
| 211 | "authKey": "A String", # The authkey parameter required for this permission. |
| 212 | "etag": "A String", # The ETag of the permission. |
| 213 | "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address. |
| 214 | "photoLink": "A String", # A link to the profile photo, if available. |
| 215 | "role": "A String", # The primary role for this user. Allowed values are: |
| 216 | # - owner |
| 217 | # - reader |
| 218 | # - writer |
| 219 | "type": "A String", # The account type. Allowed values are: |
| 220 | # - user |
| 221 | # - group |
| 222 | # - domain |
| 223 | # - anyone |
| 224 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 225 | "A String", |
| 226 | ], |
| 227 | "selfLink": "A String", # A link back to this permission. |
| 228 | }</pre> |
| 229 | </div> |
| 230 | |
| 231 | <div class="method"> |
| 232 | <code class="details" id="list">list(fileId)</code> |
| 233 | <pre>Lists a file's permissions. |
| 234 | |
| 235 | Args: |
| 236 | fileId: string, The ID for the file. (required) |
| 237 | |
| 238 | Returns: |
| 239 | An object of the form: |
| 240 | |
| 241 | { # A list of permissions associated with a file. |
| 242 | "items": [ # The actual list of permissions. |
| 243 | { # A permission for a file. |
| 244 | "withLink": True or False, # Whether the link is required for this permission. |
| 245 | "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain". |
| 246 | "name": "A String", # The name for this permission. |
| 247 | "kind": "drive#permission", # This is always drive#permission. |
| 248 | "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 'id' or 'value' fields must be specified. |
| 249 | "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 'id' or 'value' fields must be specified. |
| 250 | "authKey": "A String", # The authkey parameter required for this permission. |
| 251 | "etag": "A String", # The ETag of the permission. |
| 252 | "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address. |
| 253 | "photoLink": "A String", # A link to the profile photo, if available. |
| 254 | "role": "A String", # The primary role for this user. Allowed values are: |
| 255 | # - owner |
| 256 | # - reader |
| 257 | # - writer |
| 258 | "type": "A String", # The account type. Allowed values are: |
| 259 | # - user |
| 260 | # - group |
| 261 | # - domain |
| 262 | # - anyone |
| 263 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 264 | "A String", |
| 265 | ], |
| 266 | "selfLink": "A String", # A link back to this permission. |
| 267 | }, |
| 268 | ], |
| 269 | "kind": "drive#permissionList", # This is always drive#permissionList. |
| 270 | "etag": "A String", # The ETag of the list. |
| 271 | "selfLink": "A String", # A link back to this list. |
| 272 | }</pre> |
| 273 | </div> |
| 274 | |
| 275 | <div class="method"> |
| 276 | <code class="details" id="patch">patch(fileId, permissionId, body, transferOwnership=None)</code> |
| 277 | <pre>Updates a permission. This method supports patch semantics. |
| 278 | |
| 279 | Args: |
| 280 | fileId: string, The ID for the file. (required) |
| 281 | permissionId: string, The ID for the permission. (required) |
| 282 | body: object, The request body. (required) |
| 283 | The object takes the form of: |
| 284 | |
| 285 | { # A permission for a file. |
| 286 | "withLink": True or False, # Whether the link is required for this permission. |
| 287 | "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain". |
| 288 | "name": "A String", # The name for this permission. |
| 289 | "kind": "drive#permission", # This is always drive#permission. |
| 290 | "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 'id' or 'value' fields must be specified. |
| 291 | "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 'id' or 'value' fields must be specified. |
| 292 | "authKey": "A String", # The authkey parameter required for this permission. |
| 293 | "etag": "A String", # The ETag of the permission. |
| 294 | "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address. |
| 295 | "photoLink": "A String", # A link to the profile photo, if available. |
| 296 | "role": "A String", # The primary role for this user. Allowed values are: |
| 297 | # - owner |
| 298 | # - reader |
| 299 | # - writer |
| 300 | "type": "A String", # The account type. Allowed values are: |
| 301 | # - user |
| 302 | # - group |
| 303 | # - domain |
| 304 | # - anyone |
| 305 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 306 | "A String", |
| 307 | ], |
| 308 | "selfLink": "A String", # A link back to this permission. |
| 309 | } |
| 310 | |
| 311 | transferOwnership: boolean, Whether changing a role to 'owner' should also downgrade the current owners to writers. |
| 312 | |
| 313 | Returns: |
| 314 | An object of the form: |
| 315 | |
| 316 | { # A permission for a file. |
| 317 | "withLink": True or False, # Whether the link is required for this permission. |
| 318 | "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain". |
| 319 | "name": "A String", # The name for this permission. |
| 320 | "kind": "drive#permission", # This is always drive#permission. |
| 321 | "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 'id' or 'value' fields must be specified. |
| 322 | "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 'id' or 'value' fields must be specified. |
| 323 | "authKey": "A String", # The authkey parameter required for this permission. |
| 324 | "etag": "A String", # The ETag of the permission. |
| 325 | "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address. |
| 326 | "photoLink": "A String", # A link to the profile photo, if available. |
| 327 | "role": "A String", # The primary role for this user. Allowed values are: |
| 328 | # - owner |
| 329 | # - reader |
| 330 | # - writer |
| 331 | "type": "A String", # The account type. Allowed values are: |
| 332 | # - user |
| 333 | # - group |
| 334 | # - domain |
| 335 | # - anyone |
| 336 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 337 | "A String", |
| 338 | ], |
| 339 | "selfLink": "A String", # A link back to this permission. |
| 340 | }</pre> |
| 341 | </div> |
| 342 | |
| 343 | <div class="method"> |
| 344 | <code class="details" id="update">update(fileId, permissionId, body, transferOwnership=None)</code> |
| 345 | <pre>Updates a permission. |
| 346 | |
| 347 | Args: |
| 348 | fileId: string, The ID for the file. (required) |
| 349 | permissionId: string, The ID for the permission. (required) |
| 350 | body: object, The request body. (required) |
| 351 | The object takes the form of: |
| 352 | |
| 353 | { # A permission for a file. |
| 354 | "withLink": True or False, # Whether the link is required for this permission. |
| 355 | "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain". |
| 356 | "name": "A String", # The name for this permission. |
| 357 | "kind": "drive#permission", # This is always drive#permission. |
| 358 | "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 'id' or 'value' fields must be specified. |
| 359 | "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 'id' or 'value' fields must be specified. |
| 360 | "authKey": "A String", # The authkey parameter required for this permission. |
| 361 | "etag": "A String", # The ETag of the permission. |
| 362 | "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address. |
| 363 | "photoLink": "A String", # A link to the profile photo, if available. |
| 364 | "role": "A String", # The primary role for this user. Allowed values are: |
| 365 | # - owner |
| 366 | # - reader |
| 367 | # - writer |
| 368 | "type": "A String", # The account type. Allowed values are: |
| 369 | # - user |
| 370 | # - group |
| 371 | # - domain |
| 372 | # - anyone |
| 373 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 374 | "A String", |
| 375 | ], |
| 376 | "selfLink": "A String", # A link back to this permission. |
| 377 | } |
| 378 | |
| 379 | transferOwnership: boolean, Whether changing a role to 'owner' should also downgrade the current owners to writers. |
| 380 | |
| 381 | Returns: |
| 382 | An object of the form: |
| 383 | |
| 384 | { # A permission for a file. |
| 385 | "withLink": True or False, # Whether the link is required for this permission. |
| 386 | "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain". |
| 387 | "name": "A String", # The name for this permission. |
| 388 | "kind": "drive#permission", # This is always drive#permission. |
| 389 | "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 'id' or 'value' fields must be specified. |
| 390 | "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 'id' or 'value' fields must be specified. |
| 391 | "authKey": "A String", # The authkey parameter required for this permission. |
| 392 | "etag": "A String", # The ETag of the permission. |
| 393 | "emailAddress": "A String", # The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address. |
| 394 | "photoLink": "A String", # A link to the profile photo, if available. |
| 395 | "role": "A String", # The primary role for this user. Allowed values are: |
| 396 | # - owner |
| 397 | # - reader |
| 398 | # - writer |
| 399 | "type": "A String", # The account type. Allowed values are: |
| 400 | # - user |
| 401 | # - group |
| 402 | # - domain |
| 403 | # - anyone |
| 404 | "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed. |
| 405 | "A String", |
| 406 | ], |
| 407 | "selfLink": "A String", # A link back to this permission. |
| 408 | }</pre> |
| 409 | </div> |
| 410 | |
| 411 | </body></html> |