OLD | NEW |
(Empty) | |
| 1 library googleapis.storage.v1; |
| 2 |
| 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; |
| 7 |
| 8 import "package:crypto/crypto.dart" as crypto; |
| 9 import 'package:http/http.dart' as http; |
| 10 import '../src/common_internal.dart' as common_internal; |
| 11 import '../common/common.dart' as common; |
| 12 |
| 13 export '../common/common.dart' show ApiRequestError; |
| 14 export '../common/common.dart' show DetailedApiRequestError; |
| 15 |
| 16 /** Lets you store and retrieve potentially-large, immutable data objects. */ |
| 17 class StorageApi { |
| 18 /** Manage your data and permissions in Google Cloud Storage */ |
| 19 static const DevstorageFullControlScope = "https://www.googleapis.com/auth/dev
storage.full_control"; |
| 20 |
| 21 /** View your data in Google Cloud Storage */ |
| 22 static const DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devsto
rage.read_only"; |
| 23 |
| 24 /** Manage your data in Google Cloud Storage */ |
| 25 static const DevstorageReadWriteScope = "https://www.googleapis.com/auth/devst
orage.read_write"; |
| 26 |
| 27 |
| 28 final common_internal.ApiRequester _requester; |
| 29 |
| 30 BucketAccessControlsResourceApi get bucketAccessControls => new BucketAccessCo
ntrolsResourceApi(_requester); |
| 31 BucketsResourceApi get buckets => new BucketsResourceApi(_requester); |
| 32 ChannelsResourceApi get channels => new ChannelsResourceApi(_requester); |
| 33 DefaultObjectAccessControlsResourceApi get defaultObjectAccessControls => new
DefaultObjectAccessControlsResourceApi(_requester); |
| 34 ObjectAccessControlsResourceApi get objectAccessControls => new ObjectAccessCo
ntrolsResourceApi(_requester); |
| 35 ObjectsResourceApi get objects => new ObjectsResourceApi(_requester); |
| 36 |
| 37 StorageApi(http.Client client) : |
| 38 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "/storage/v1/"); |
| 39 } |
| 40 |
| 41 |
| 42 /** Not documented yet. */ |
| 43 class BucketAccessControlsResourceApi { |
| 44 final common_internal.ApiRequester _requester; |
| 45 |
| 46 BucketAccessControlsResourceApi(common_internal.ApiRequester client) : |
| 47 _requester = client; |
| 48 |
| 49 /** |
| 50 * Permanently deletes the ACL entry for the specified entity on the specified |
| 51 * bucket. |
| 52 * |
| 53 * Request parameters: |
| 54 * |
| 55 * [bucket] - Name of a bucket. |
| 56 * |
| 57 * [entity] - The entity holding the permission. Can be user-userId, |
| 58 * user-emailAddress, group-groupId, group-emailAddress, allUsers, or |
| 59 * allAuthenticatedUsers. |
| 60 * |
| 61 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 62 * error. |
| 63 * |
| 64 * If the used [http.Client] completes with an error when making a REST call, |
| 65 * this method will complete with the same error. |
| 66 */ |
| 67 async.Future delete(core.String bucket, core.String entity) { |
| 68 var _url = null; |
| 69 var _queryParams = new core.Map(); |
| 70 var _uploadMedia = null; |
| 71 var _uploadOptions = null; |
| 72 var _downloadOptions = common.DownloadOptions.Metadata; |
| 73 var _body = null; |
| 74 |
| 75 if (bucket == null) { |
| 76 throw new core.ArgumentError("Parameter bucket is required."); |
| 77 } |
| 78 if (entity == null) { |
| 79 throw new core.ArgumentError("Parameter entity is required."); |
| 80 } |
| 81 |
| 82 _downloadOptions = null; |
| 83 |
| 84 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/acl/' + c
ommon_internal.Escaper.ecapeVariable('$entity'); |
| 85 |
| 86 var _response = _requester.request(_url, |
| 87 "DELETE", |
| 88 body: _body, |
| 89 queryParams: _queryParams, |
| 90 uploadOptions: _uploadOptions, |
| 91 uploadMedia: _uploadMedia, |
| 92 downloadOptions: _downloadOptions); |
| 93 return _response.then((data) => null); |
| 94 } |
| 95 |
| 96 /** |
| 97 * Returns the ACL entry for the specified entity on the specified bucket. |
| 98 * |
| 99 * Request parameters: |
| 100 * |
| 101 * [bucket] - Name of a bucket. |
| 102 * |
| 103 * [entity] - The entity holding the permission. Can be user-userId, |
| 104 * user-emailAddress, group-groupId, group-emailAddress, allUsers, or |
| 105 * allAuthenticatedUsers. |
| 106 * |
| 107 * Completes with a [BucketAccessControl]. |
| 108 * |
| 109 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 110 * error. |
| 111 * |
| 112 * If the used [http.Client] completes with an error when making a REST call, |
| 113 * this method will complete with the same error. |
| 114 */ |
| 115 async.Future<BucketAccessControl> get(core.String bucket, core.String entity)
{ |
| 116 var _url = null; |
| 117 var _queryParams = new core.Map(); |
| 118 var _uploadMedia = null; |
| 119 var _uploadOptions = null; |
| 120 var _downloadOptions = common.DownloadOptions.Metadata; |
| 121 var _body = null; |
| 122 |
| 123 if (bucket == null) { |
| 124 throw new core.ArgumentError("Parameter bucket is required."); |
| 125 } |
| 126 if (entity == null) { |
| 127 throw new core.ArgumentError("Parameter entity is required."); |
| 128 } |
| 129 |
| 130 |
| 131 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/acl/' + c
ommon_internal.Escaper.ecapeVariable('$entity'); |
| 132 |
| 133 var _response = _requester.request(_url, |
| 134 "GET", |
| 135 body: _body, |
| 136 queryParams: _queryParams, |
| 137 uploadOptions: _uploadOptions, |
| 138 uploadMedia: _uploadMedia, |
| 139 downloadOptions: _downloadOptions); |
| 140 return _response.then((data) => new BucketAccessControl.fromJson(data)); |
| 141 } |
| 142 |
| 143 /** |
| 144 * Creates a new ACL entry on the specified bucket. |
| 145 * |
| 146 * [request] - The metadata request object. |
| 147 * |
| 148 * Request parameters: |
| 149 * |
| 150 * [bucket] - Name of a bucket. |
| 151 * |
| 152 * Completes with a [BucketAccessControl]. |
| 153 * |
| 154 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 155 * error. |
| 156 * |
| 157 * If the used [http.Client] completes with an error when making a REST call, |
| 158 * this method will complete with the same error. |
| 159 */ |
| 160 async.Future<BucketAccessControl> insert(BucketAccessControl request, core.Str
ing bucket) { |
| 161 var _url = null; |
| 162 var _queryParams = new core.Map(); |
| 163 var _uploadMedia = null; |
| 164 var _uploadOptions = null; |
| 165 var _downloadOptions = common.DownloadOptions.Metadata; |
| 166 var _body = null; |
| 167 |
| 168 if (request != null) { |
| 169 _body = convert.JSON.encode((request).toJson()); |
| 170 } |
| 171 if (bucket == null) { |
| 172 throw new core.ArgumentError("Parameter bucket is required."); |
| 173 } |
| 174 |
| 175 |
| 176 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/acl'; |
| 177 |
| 178 var _response = _requester.request(_url, |
| 179 "POST", |
| 180 body: _body, |
| 181 queryParams: _queryParams, |
| 182 uploadOptions: _uploadOptions, |
| 183 uploadMedia: _uploadMedia, |
| 184 downloadOptions: _downloadOptions); |
| 185 return _response.then((data) => new BucketAccessControl.fromJson(data)); |
| 186 } |
| 187 |
| 188 /** |
| 189 * Retrieves ACL entries on the specified bucket. |
| 190 * |
| 191 * Request parameters: |
| 192 * |
| 193 * [bucket] - Name of a bucket. |
| 194 * |
| 195 * Completes with a [BucketAccessControls]. |
| 196 * |
| 197 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 198 * error. |
| 199 * |
| 200 * If the used [http.Client] completes with an error when making a REST call, |
| 201 * this method will complete with the same error. |
| 202 */ |
| 203 async.Future<BucketAccessControls> list(core.String bucket) { |
| 204 var _url = null; |
| 205 var _queryParams = new core.Map(); |
| 206 var _uploadMedia = null; |
| 207 var _uploadOptions = null; |
| 208 var _downloadOptions = common.DownloadOptions.Metadata; |
| 209 var _body = null; |
| 210 |
| 211 if (bucket == null) { |
| 212 throw new core.ArgumentError("Parameter bucket is required."); |
| 213 } |
| 214 |
| 215 |
| 216 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/acl'; |
| 217 |
| 218 var _response = _requester.request(_url, |
| 219 "GET", |
| 220 body: _body, |
| 221 queryParams: _queryParams, |
| 222 uploadOptions: _uploadOptions, |
| 223 uploadMedia: _uploadMedia, |
| 224 downloadOptions: _downloadOptions); |
| 225 return _response.then((data) => new BucketAccessControls.fromJson(data)); |
| 226 } |
| 227 |
| 228 /** |
| 229 * Updates an ACL entry on the specified bucket. This method supports patch |
| 230 * semantics. |
| 231 * |
| 232 * [request] - The metadata request object. |
| 233 * |
| 234 * Request parameters: |
| 235 * |
| 236 * [bucket] - Name of a bucket. |
| 237 * |
| 238 * [entity] - The entity holding the permission. Can be user-userId, |
| 239 * user-emailAddress, group-groupId, group-emailAddress, allUsers, or |
| 240 * allAuthenticatedUsers. |
| 241 * |
| 242 * Completes with a [BucketAccessControl]. |
| 243 * |
| 244 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 245 * error. |
| 246 * |
| 247 * If the used [http.Client] completes with an error when making a REST call, |
| 248 * this method will complete with the same error. |
| 249 */ |
| 250 async.Future<BucketAccessControl> patch(BucketAccessControl request, core.Stri
ng bucket, core.String entity) { |
| 251 var _url = null; |
| 252 var _queryParams = new core.Map(); |
| 253 var _uploadMedia = null; |
| 254 var _uploadOptions = null; |
| 255 var _downloadOptions = common.DownloadOptions.Metadata; |
| 256 var _body = null; |
| 257 |
| 258 if (request != null) { |
| 259 _body = convert.JSON.encode((request).toJson()); |
| 260 } |
| 261 if (bucket == null) { |
| 262 throw new core.ArgumentError("Parameter bucket is required."); |
| 263 } |
| 264 if (entity == null) { |
| 265 throw new core.ArgumentError("Parameter entity is required."); |
| 266 } |
| 267 |
| 268 |
| 269 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/acl/' + c
ommon_internal.Escaper.ecapeVariable('$entity'); |
| 270 |
| 271 var _response = _requester.request(_url, |
| 272 "PATCH", |
| 273 body: _body, |
| 274 queryParams: _queryParams, |
| 275 uploadOptions: _uploadOptions, |
| 276 uploadMedia: _uploadMedia, |
| 277 downloadOptions: _downloadOptions); |
| 278 return _response.then((data) => new BucketAccessControl.fromJson(data)); |
| 279 } |
| 280 |
| 281 /** |
| 282 * Updates an ACL entry on the specified bucket. |
| 283 * |
| 284 * [request] - The metadata request object. |
| 285 * |
| 286 * Request parameters: |
| 287 * |
| 288 * [bucket] - Name of a bucket. |
| 289 * |
| 290 * [entity] - The entity holding the permission. Can be user-userId, |
| 291 * user-emailAddress, group-groupId, group-emailAddress, allUsers, or |
| 292 * allAuthenticatedUsers. |
| 293 * |
| 294 * Completes with a [BucketAccessControl]. |
| 295 * |
| 296 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 297 * error. |
| 298 * |
| 299 * If the used [http.Client] completes with an error when making a REST call, |
| 300 * this method will complete with the same error. |
| 301 */ |
| 302 async.Future<BucketAccessControl> update(BucketAccessControl request, core.Str
ing bucket, core.String entity) { |
| 303 var _url = null; |
| 304 var _queryParams = new core.Map(); |
| 305 var _uploadMedia = null; |
| 306 var _uploadOptions = null; |
| 307 var _downloadOptions = common.DownloadOptions.Metadata; |
| 308 var _body = null; |
| 309 |
| 310 if (request != null) { |
| 311 _body = convert.JSON.encode((request).toJson()); |
| 312 } |
| 313 if (bucket == null) { |
| 314 throw new core.ArgumentError("Parameter bucket is required."); |
| 315 } |
| 316 if (entity == null) { |
| 317 throw new core.ArgumentError("Parameter entity is required."); |
| 318 } |
| 319 |
| 320 |
| 321 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/acl/' + c
ommon_internal.Escaper.ecapeVariable('$entity'); |
| 322 |
| 323 var _response = _requester.request(_url, |
| 324 "PUT", |
| 325 body: _body, |
| 326 queryParams: _queryParams, |
| 327 uploadOptions: _uploadOptions, |
| 328 uploadMedia: _uploadMedia, |
| 329 downloadOptions: _downloadOptions); |
| 330 return _response.then((data) => new BucketAccessControl.fromJson(data)); |
| 331 } |
| 332 |
| 333 } |
| 334 |
| 335 |
| 336 /** Not documented yet. */ |
| 337 class BucketsResourceApi { |
| 338 final common_internal.ApiRequester _requester; |
| 339 |
| 340 BucketsResourceApi(common_internal.ApiRequester client) : |
| 341 _requester = client; |
| 342 |
| 343 /** |
| 344 * Permanently deletes an empty bucket. |
| 345 * |
| 346 * Request parameters: |
| 347 * |
| 348 * [bucket] - Name of a bucket. |
| 349 * |
| 350 * [ifMetagenerationMatch] - If set, only deletes the bucket if its |
| 351 * metageneration matches this value. |
| 352 * |
| 353 * [ifMetagenerationNotMatch] - If set, only deletes the bucket if its |
| 354 * metageneration does not match this value. |
| 355 * |
| 356 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 357 * error. |
| 358 * |
| 359 * If the used [http.Client] completes with an error when making a REST call, |
| 360 * this method will complete with the same error. |
| 361 */ |
| 362 async.Future delete(core.String bucket, {core.String ifMetagenerationMatch, co
re.String ifMetagenerationNotMatch}) { |
| 363 var _url = null; |
| 364 var _queryParams = new core.Map(); |
| 365 var _uploadMedia = null; |
| 366 var _uploadOptions = null; |
| 367 var _downloadOptions = common.DownloadOptions.Metadata; |
| 368 var _body = null; |
| 369 |
| 370 if (bucket == null) { |
| 371 throw new core.ArgumentError("Parameter bucket is required."); |
| 372 } |
| 373 if (ifMetagenerationMatch != null) { |
| 374 _queryParams["ifMetagenerationMatch"] = [ifMetagenerationMatch]; |
| 375 } |
| 376 if (ifMetagenerationNotMatch != null) { |
| 377 _queryParams["ifMetagenerationNotMatch"] = [ifMetagenerationNotMatch]; |
| 378 } |
| 379 |
| 380 _downloadOptions = null; |
| 381 |
| 382 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket'); |
| 383 |
| 384 var _response = _requester.request(_url, |
| 385 "DELETE", |
| 386 body: _body, |
| 387 queryParams: _queryParams, |
| 388 uploadOptions: _uploadOptions, |
| 389 uploadMedia: _uploadMedia, |
| 390 downloadOptions: _downloadOptions); |
| 391 return _response.then((data) => null); |
| 392 } |
| 393 |
| 394 /** |
| 395 * Returns metadata for the specified bucket. |
| 396 * |
| 397 * Request parameters: |
| 398 * |
| 399 * [bucket] - Name of a bucket. |
| 400 * |
| 401 * [ifMetagenerationMatch] - Makes the return of the bucket metadata |
| 402 * conditional on whether the bucket's current metageneration matches the |
| 403 * given value. |
| 404 * |
| 405 * [ifMetagenerationNotMatch] - Makes the return of the bucket metadata |
| 406 * conditional on whether the bucket's current metageneration does not match |
| 407 * the given value. |
| 408 * |
| 409 * [projection] - Set of properties to return. Defaults to noAcl. |
| 410 * Possible string values are: |
| 411 * - "full" : Include all properties. |
| 412 * - "noAcl" : Omit acl and defaultObjectAcl properties. |
| 413 * |
| 414 * Completes with a [Bucket]. |
| 415 * |
| 416 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 417 * error. |
| 418 * |
| 419 * If the used [http.Client] completes with an error when making a REST call, |
| 420 * this method will complete with the same error. |
| 421 */ |
| 422 async.Future<Bucket> get(core.String bucket, {core.String ifMetagenerationMatc
h, core.String ifMetagenerationNotMatch, core.String projection}) { |
| 423 var _url = null; |
| 424 var _queryParams = new core.Map(); |
| 425 var _uploadMedia = null; |
| 426 var _uploadOptions = null; |
| 427 var _downloadOptions = common.DownloadOptions.Metadata; |
| 428 var _body = null; |
| 429 |
| 430 if (bucket == null) { |
| 431 throw new core.ArgumentError("Parameter bucket is required."); |
| 432 } |
| 433 if (ifMetagenerationMatch != null) { |
| 434 _queryParams["ifMetagenerationMatch"] = [ifMetagenerationMatch]; |
| 435 } |
| 436 if (ifMetagenerationNotMatch != null) { |
| 437 _queryParams["ifMetagenerationNotMatch"] = [ifMetagenerationNotMatch]; |
| 438 } |
| 439 if (projection != null) { |
| 440 _queryParams["projection"] = [projection]; |
| 441 } |
| 442 |
| 443 |
| 444 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket'); |
| 445 |
| 446 var _response = _requester.request(_url, |
| 447 "GET", |
| 448 body: _body, |
| 449 queryParams: _queryParams, |
| 450 uploadOptions: _uploadOptions, |
| 451 uploadMedia: _uploadMedia, |
| 452 downloadOptions: _downloadOptions); |
| 453 return _response.then((data) => new Bucket.fromJson(data)); |
| 454 } |
| 455 |
| 456 /** |
| 457 * Creates a new bucket. |
| 458 * |
| 459 * [request] - The metadata request object. |
| 460 * |
| 461 * Request parameters: |
| 462 * |
| 463 * [project] - A valid API project identifier. |
| 464 * |
| 465 * [predefinedAcl] - Apply a predefined set of access controls to this bucket. |
| 466 * Possible string values are: |
| 467 * - "authenticatedRead" : Project team owners get OWNER access, and |
| 468 * allAuthenticatedUsers get READER access. |
| 469 * - "private" : Project team owners get OWNER access. |
| 470 * - "projectPrivate" : Project team members get access according to their |
| 471 * roles. |
| 472 * - "publicRead" : Project team owners get OWNER access, and allUsers get |
| 473 * READER access. |
| 474 * - "publicReadWrite" : Project team owners get OWNER access, and allUsers |
| 475 * get WRITER access. |
| 476 * |
| 477 * [projection] - Set of properties to return. Defaults to noAcl, unless the |
| 478 * bucket resource specifies acl or defaultObjectAcl properties, when it |
| 479 * defaults to full. |
| 480 * Possible string values are: |
| 481 * - "full" : Include all properties. |
| 482 * - "noAcl" : Omit acl and defaultObjectAcl properties. |
| 483 * |
| 484 * Completes with a [Bucket]. |
| 485 * |
| 486 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 487 * error. |
| 488 * |
| 489 * If the used [http.Client] completes with an error when making a REST call, |
| 490 * this method will complete with the same error. |
| 491 */ |
| 492 async.Future<Bucket> insert(Bucket request, core.String project, {core.String
predefinedAcl, core.String projection}) { |
| 493 var _url = null; |
| 494 var _queryParams = new core.Map(); |
| 495 var _uploadMedia = null; |
| 496 var _uploadOptions = null; |
| 497 var _downloadOptions = common.DownloadOptions.Metadata; |
| 498 var _body = null; |
| 499 |
| 500 if (request != null) { |
| 501 _body = convert.JSON.encode((request).toJson()); |
| 502 } |
| 503 if (project == null) { |
| 504 throw new core.ArgumentError("Parameter project is required."); |
| 505 } |
| 506 _queryParams["project"] = [project]; |
| 507 if (predefinedAcl != null) { |
| 508 _queryParams["predefinedAcl"] = [predefinedAcl]; |
| 509 } |
| 510 if (projection != null) { |
| 511 _queryParams["projection"] = [projection]; |
| 512 } |
| 513 |
| 514 |
| 515 _url = 'b'; |
| 516 |
| 517 var _response = _requester.request(_url, |
| 518 "POST", |
| 519 body: _body, |
| 520 queryParams: _queryParams, |
| 521 uploadOptions: _uploadOptions, |
| 522 uploadMedia: _uploadMedia, |
| 523 downloadOptions: _downloadOptions); |
| 524 return _response.then((data) => new Bucket.fromJson(data)); |
| 525 } |
| 526 |
| 527 /** |
| 528 * Retrieves a list of buckets for a given project. |
| 529 * |
| 530 * Request parameters: |
| 531 * |
| 532 * [project] - A valid API project identifier. |
| 533 * |
| 534 * [maxResults] - Maximum number of buckets to return. |
| 535 * |
| 536 * [pageToken] - A previously-returned page token representing part of the |
| 537 * larger set of results to view. |
| 538 * |
| 539 * [projection] - Set of properties to return. Defaults to noAcl. |
| 540 * Possible string values are: |
| 541 * - "full" : Include all properties. |
| 542 * - "noAcl" : Omit acl and defaultObjectAcl properties. |
| 543 * |
| 544 * Completes with a [Buckets]. |
| 545 * |
| 546 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 547 * error. |
| 548 * |
| 549 * If the used [http.Client] completes with an error when making a REST call, |
| 550 * this method will complete with the same error. |
| 551 */ |
| 552 async.Future<Buckets> list(core.String project, {core.int maxResults, core.Str
ing pageToken, core.String projection}) { |
| 553 var _url = null; |
| 554 var _queryParams = new core.Map(); |
| 555 var _uploadMedia = null; |
| 556 var _uploadOptions = null; |
| 557 var _downloadOptions = common.DownloadOptions.Metadata; |
| 558 var _body = null; |
| 559 |
| 560 if (project == null) { |
| 561 throw new core.ArgumentError("Parameter project is required."); |
| 562 } |
| 563 _queryParams["project"] = [project]; |
| 564 if (maxResults != null) { |
| 565 _queryParams["maxResults"] = ["${maxResults}"]; |
| 566 } |
| 567 if (pageToken != null) { |
| 568 _queryParams["pageToken"] = [pageToken]; |
| 569 } |
| 570 if (projection != null) { |
| 571 _queryParams["projection"] = [projection]; |
| 572 } |
| 573 |
| 574 |
| 575 _url = 'b'; |
| 576 |
| 577 var _response = _requester.request(_url, |
| 578 "GET", |
| 579 body: _body, |
| 580 queryParams: _queryParams, |
| 581 uploadOptions: _uploadOptions, |
| 582 uploadMedia: _uploadMedia, |
| 583 downloadOptions: _downloadOptions); |
| 584 return _response.then((data) => new Buckets.fromJson(data)); |
| 585 } |
| 586 |
| 587 /** |
| 588 * Updates a bucket. This method supports patch semantics. |
| 589 * |
| 590 * [request] - The metadata request object. |
| 591 * |
| 592 * Request parameters: |
| 593 * |
| 594 * [bucket] - Name of a bucket. |
| 595 * |
| 596 * [ifMetagenerationMatch] - Makes the return of the bucket metadata |
| 597 * conditional on whether the bucket's current metageneration matches the |
| 598 * given value. |
| 599 * |
| 600 * [ifMetagenerationNotMatch] - Makes the return of the bucket metadata |
| 601 * conditional on whether the bucket's current metageneration does not match |
| 602 * the given value. |
| 603 * |
| 604 * [predefinedAcl] - Apply a predefined set of access controls to this bucket. |
| 605 * Possible string values are: |
| 606 * - "authenticatedRead" : Project team owners get OWNER access, and |
| 607 * allAuthenticatedUsers get READER access. |
| 608 * - "private" : Project team owners get OWNER access. |
| 609 * - "projectPrivate" : Project team members get access according to their |
| 610 * roles. |
| 611 * - "publicRead" : Project team owners get OWNER access, and allUsers get |
| 612 * READER access. |
| 613 * - "publicReadWrite" : Project team owners get OWNER access, and allUsers |
| 614 * get WRITER access. |
| 615 * |
| 616 * [projection] - Set of properties to return. Defaults to full. |
| 617 * Possible string values are: |
| 618 * - "full" : Include all properties. |
| 619 * - "noAcl" : Omit acl and defaultObjectAcl properties. |
| 620 * |
| 621 * Completes with a [Bucket]. |
| 622 * |
| 623 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 624 * error. |
| 625 * |
| 626 * If the used [http.Client] completes with an error when making a REST call, |
| 627 * this method will complete with the same error. |
| 628 */ |
| 629 async.Future<Bucket> patch(Bucket request, core.String bucket, {core.String if
MetagenerationMatch, core.String ifMetagenerationNotMatch, core.String predefine
dAcl, core.String projection}) { |
| 630 var _url = null; |
| 631 var _queryParams = new core.Map(); |
| 632 var _uploadMedia = null; |
| 633 var _uploadOptions = null; |
| 634 var _downloadOptions = common.DownloadOptions.Metadata; |
| 635 var _body = null; |
| 636 |
| 637 if (request != null) { |
| 638 _body = convert.JSON.encode((request).toJson()); |
| 639 } |
| 640 if (bucket == null) { |
| 641 throw new core.ArgumentError("Parameter bucket is required."); |
| 642 } |
| 643 if (ifMetagenerationMatch != null) { |
| 644 _queryParams["ifMetagenerationMatch"] = [ifMetagenerationMatch]; |
| 645 } |
| 646 if (ifMetagenerationNotMatch != null) { |
| 647 _queryParams["ifMetagenerationNotMatch"] = [ifMetagenerationNotMatch]; |
| 648 } |
| 649 if (predefinedAcl != null) { |
| 650 _queryParams["predefinedAcl"] = [predefinedAcl]; |
| 651 } |
| 652 if (projection != null) { |
| 653 _queryParams["projection"] = [projection]; |
| 654 } |
| 655 |
| 656 |
| 657 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket'); |
| 658 |
| 659 var _response = _requester.request(_url, |
| 660 "PATCH", |
| 661 body: _body, |
| 662 queryParams: _queryParams, |
| 663 uploadOptions: _uploadOptions, |
| 664 uploadMedia: _uploadMedia, |
| 665 downloadOptions: _downloadOptions); |
| 666 return _response.then((data) => new Bucket.fromJson(data)); |
| 667 } |
| 668 |
| 669 /** |
| 670 * Updates a bucket. |
| 671 * |
| 672 * [request] - The metadata request object. |
| 673 * |
| 674 * Request parameters: |
| 675 * |
| 676 * [bucket] - Name of a bucket. |
| 677 * |
| 678 * [ifMetagenerationMatch] - Makes the return of the bucket metadata |
| 679 * conditional on whether the bucket's current metageneration matches the |
| 680 * given value. |
| 681 * |
| 682 * [ifMetagenerationNotMatch] - Makes the return of the bucket metadata |
| 683 * conditional on whether the bucket's current metageneration does not match |
| 684 * the given value. |
| 685 * |
| 686 * [predefinedAcl] - Apply a predefined set of access controls to this bucket. |
| 687 * Possible string values are: |
| 688 * - "authenticatedRead" : Project team owners get OWNER access, and |
| 689 * allAuthenticatedUsers get READER access. |
| 690 * - "private" : Project team owners get OWNER access. |
| 691 * - "projectPrivate" : Project team members get access according to their |
| 692 * roles. |
| 693 * - "publicRead" : Project team owners get OWNER access, and allUsers get |
| 694 * READER access. |
| 695 * - "publicReadWrite" : Project team owners get OWNER access, and allUsers |
| 696 * get WRITER access. |
| 697 * |
| 698 * [projection] - Set of properties to return. Defaults to full. |
| 699 * Possible string values are: |
| 700 * - "full" : Include all properties. |
| 701 * - "noAcl" : Omit acl and defaultObjectAcl properties. |
| 702 * |
| 703 * Completes with a [Bucket]. |
| 704 * |
| 705 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 706 * error. |
| 707 * |
| 708 * If the used [http.Client] completes with an error when making a REST call, |
| 709 * this method will complete with the same error. |
| 710 */ |
| 711 async.Future<Bucket> update(Bucket request, core.String bucket, {core.String i
fMetagenerationMatch, core.String ifMetagenerationNotMatch, core.String predefin
edAcl, core.String projection}) { |
| 712 var _url = null; |
| 713 var _queryParams = new core.Map(); |
| 714 var _uploadMedia = null; |
| 715 var _uploadOptions = null; |
| 716 var _downloadOptions = common.DownloadOptions.Metadata; |
| 717 var _body = null; |
| 718 |
| 719 if (request != null) { |
| 720 _body = convert.JSON.encode((request).toJson()); |
| 721 } |
| 722 if (bucket == null) { |
| 723 throw new core.ArgumentError("Parameter bucket is required."); |
| 724 } |
| 725 if (ifMetagenerationMatch != null) { |
| 726 _queryParams["ifMetagenerationMatch"] = [ifMetagenerationMatch]; |
| 727 } |
| 728 if (ifMetagenerationNotMatch != null) { |
| 729 _queryParams["ifMetagenerationNotMatch"] = [ifMetagenerationNotMatch]; |
| 730 } |
| 731 if (predefinedAcl != null) { |
| 732 _queryParams["predefinedAcl"] = [predefinedAcl]; |
| 733 } |
| 734 if (projection != null) { |
| 735 _queryParams["projection"] = [projection]; |
| 736 } |
| 737 |
| 738 |
| 739 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket'); |
| 740 |
| 741 var _response = _requester.request(_url, |
| 742 "PUT", |
| 743 body: _body, |
| 744 queryParams: _queryParams, |
| 745 uploadOptions: _uploadOptions, |
| 746 uploadMedia: _uploadMedia, |
| 747 downloadOptions: _downloadOptions); |
| 748 return _response.then((data) => new Bucket.fromJson(data)); |
| 749 } |
| 750 |
| 751 } |
| 752 |
| 753 |
| 754 /** Not documented yet. */ |
| 755 class ChannelsResourceApi { |
| 756 final common_internal.ApiRequester _requester; |
| 757 |
| 758 ChannelsResourceApi(common_internal.ApiRequester client) : |
| 759 _requester = client; |
| 760 |
| 761 /** |
| 762 * Stop watching resources through this channel |
| 763 * |
| 764 * [request] - The metadata request object. |
| 765 * |
| 766 * Request parameters: |
| 767 * |
| 768 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 769 * error. |
| 770 * |
| 771 * If the used [http.Client] completes with an error when making a REST call, |
| 772 * this method will complete with the same error. |
| 773 */ |
| 774 async.Future stop(Channel request) { |
| 775 var _url = null; |
| 776 var _queryParams = new core.Map(); |
| 777 var _uploadMedia = null; |
| 778 var _uploadOptions = null; |
| 779 var _downloadOptions = common.DownloadOptions.Metadata; |
| 780 var _body = null; |
| 781 |
| 782 if (request != null) { |
| 783 _body = convert.JSON.encode((request).toJson()); |
| 784 } |
| 785 |
| 786 _downloadOptions = null; |
| 787 |
| 788 _url = 'channels/stop'; |
| 789 |
| 790 var _response = _requester.request(_url, |
| 791 "POST", |
| 792 body: _body, |
| 793 queryParams: _queryParams, |
| 794 uploadOptions: _uploadOptions, |
| 795 uploadMedia: _uploadMedia, |
| 796 downloadOptions: _downloadOptions); |
| 797 return _response.then((data) => null); |
| 798 } |
| 799 |
| 800 } |
| 801 |
| 802 |
| 803 /** Not documented yet. */ |
| 804 class DefaultObjectAccessControlsResourceApi { |
| 805 final common_internal.ApiRequester _requester; |
| 806 |
| 807 DefaultObjectAccessControlsResourceApi(common_internal.ApiRequester client) : |
| 808 _requester = client; |
| 809 |
| 810 /** |
| 811 * Permanently deletes the default object ACL entry for the specified entity |
| 812 * on the specified bucket. |
| 813 * |
| 814 * Request parameters: |
| 815 * |
| 816 * [bucket] - Name of a bucket. |
| 817 * |
| 818 * [entity] - The entity holding the permission. Can be user-userId, |
| 819 * user-emailAddress, group-groupId, group-emailAddress, allUsers, or |
| 820 * allAuthenticatedUsers. |
| 821 * |
| 822 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 823 * error. |
| 824 * |
| 825 * If the used [http.Client] completes with an error when making a REST call, |
| 826 * this method will complete with the same error. |
| 827 */ |
| 828 async.Future delete(core.String bucket, core.String entity) { |
| 829 var _url = null; |
| 830 var _queryParams = new core.Map(); |
| 831 var _uploadMedia = null; |
| 832 var _uploadOptions = null; |
| 833 var _downloadOptions = common.DownloadOptions.Metadata; |
| 834 var _body = null; |
| 835 |
| 836 if (bucket == null) { |
| 837 throw new core.ArgumentError("Parameter bucket is required."); |
| 838 } |
| 839 if (entity == null) { |
| 840 throw new core.ArgumentError("Parameter entity is required."); |
| 841 } |
| 842 |
| 843 _downloadOptions = null; |
| 844 |
| 845 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/defaultOb
jectAcl/' + common_internal.Escaper.ecapeVariable('$entity'); |
| 846 |
| 847 var _response = _requester.request(_url, |
| 848 "DELETE", |
| 849 body: _body, |
| 850 queryParams: _queryParams, |
| 851 uploadOptions: _uploadOptions, |
| 852 uploadMedia: _uploadMedia, |
| 853 downloadOptions: _downloadOptions); |
| 854 return _response.then((data) => null); |
| 855 } |
| 856 |
| 857 /** |
| 858 * Returns the default object ACL entry for the specified entity on the |
| 859 * specified bucket. |
| 860 * |
| 861 * Request parameters: |
| 862 * |
| 863 * [bucket] - Name of a bucket. |
| 864 * |
| 865 * [entity] - The entity holding the permission. Can be user-userId, |
| 866 * user-emailAddress, group-groupId, group-emailAddress, allUsers, or |
| 867 * allAuthenticatedUsers. |
| 868 * |
| 869 * Completes with a [ObjectAccessControl]. |
| 870 * |
| 871 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 872 * error. |
| 873 * |
| 874 * If the used [http.Client] completes with an error when making a REST call, |
| 875 * this method will complete with the same error. |
| 876 */ |
| 877 async.Future<ObjectAccessControl> get(core.String bucket, core.String entity)
{ |
| 878 var _url = null; |
| 879 var _queryParams = new core.Map(); |
| 880 var _uploadMedia = null; |
| 881 var _uploadOptions = null; |
| 882 var _downloadOptions = common.DownloadOptions.Metadata; |
| 883 var _body = null; |
| 884 |
| 885 if (bucket == null) { |
| 886 throw new core.ArgumentError("Parameter bucket is required."); |
| 887 } |
| 888 if (entity == null) { |
| 889 throw new core.ArgumentError("Parameter entity is required."); |
| 890 } |
| 891 |
| 892 |
| 893 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/defaultOb
jectAcl/' + common_internal.Escaper.ecapeVariable('$entity'); |
| 894 |
| 895 var _response = _requester.request(_url, |
| 896 "GET", |
| 897 body: _body, |
| 898 queryParams: _queryParams, |
| 899 uploadOptions: _uploadOptions, |
| 900 uploadMedia: _uploadMedia, |
| 901 downloadOptions: _downloadOptions); |
| 902 return _response.then((data) => new ObjectAccessControl.fromJson(data)); |
| 903 } |
| 904 |
| 905 /** |
| 906 * Creates a new default object ACL entry on the specified bucket. |
| 907 * |
| 908 * [request] - The metadata request object. |
| 909 * |
| 910 * Request parameters: |
| 911 * |
| 912 * [bucket] - Name of a bucket. |
| 913 * |
| 914 * Completes with a [ObjectAccessControl]. |
| 915 * |
| 916 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 917 * error. |
| 918 * |
| 919 * If the used [http.Client] completes with an error when making a REST call, |
| 920 * this method will complete with the same error. |
| 921 */ |
| 922 async.Future<ObjectAccessControl> insert(ObjectAccessControl request, core.Str
ing bucket) { |
| 923 var _url = null; |
| 924 var _queryParams = new core.Map(); |
| 925 var _uploadMedia = null; |
| 926 var _uploadOptions = null; |
| 927 var _downloadOptions = common.DownloadOptions.Metadata; |
| 928 var _body = null; |
| 929 |
| 930 if (request != null) { |
| 931 _body = convert.JSON.encode((request).toJson()); |
| 932 } |
| 933 if (bucket == null) { |
| 934 throw new core.ArgumentError("Parameter bucket is required."); |
| 935 } |
| 936 |
| 937 |
| 938 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/defaultOb
jectAcl'; |
| 939 |
| 940 var _response = _requester.request(_url, |
| 941 "POST", |
| 942 body: _body, |
| 943 queryParams: _queryParams, |
| 944 uploadOptions: _uploadOptions, |
| 945 uploadMedia: _uploadMedia, |
| 946 downloadOptions: _downloadOptions); |
| 947 return _response.then((data) => new ObjectAccessControl.fromJson(data)); |
| 948 } |
| 949 |
| 950 /** |
| 951 * Retrieves default object ACL entries on the specified bucket. |
| 952 * |
| 953 * Request parameters: |
| 954 * |
| 955 * [bucket] - Name of a bucket. |
| 956 * |
| 957 * [ifMetagenerationMatch] - If present, only return default ACL listing if |
| 958 * the bucket's current metageneration matches this value. |
| 959 * |
| 960 * [ifMetagenerationNotMatch] - If present, only return default ACL listing if |
| 961 * the bucket's current metageneration does not match the given value. |
| 962 * |
| 963 * Completes with a [ObjectAccessControls]. |
| 964 * |
| 965 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 966 * error. |
| 967 * |
| 968 * If the used [http.Client] completes with an error when making a REST call, |
| 969 * this method will complete with the same error. |
| 970 */ |
| 971 async.Future<ObjectAccessControls> list(core.String bucket, {core.String ifMet
agenerationMatch, core.String ifMetagenerationNotMatch}) { |
| 972 var _url = null; |
| 973 var _queryParams = new core.Map(); |
| 974 var _uploadMedia = null; |
| 975 var _uploadOptions = null; |
| 976 var _downloadOptions = common.DownloadOptions.Metadata; |
| 977 var _body = null; |
| 978 |
| 979 if (bucket == null) { |
| 980 throw new core.ArgumentError("Parameter bucket is required."); |
| 981 } |
| 982 if (ifMetagenerationMatch != null) { |
| 983 _queryParams["ifMetagenerationMatch"] = [ifMetagenerationMatch]; |
| 984 } |
| 985 if (ifMetagenerationNotMatch != null) { |
| 986 _queryParams["ifMetagenerationNotMatch"] = [ifMetagenerationNotMatch]; |
| 987 } |
| 988 |
| 989 |
| 990 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/defaultOb
jectAcl'; |
| 991 |
| 992 var _response = _requester.request(_url, |
| 993 "GET", |
| 994 body: _body, |
| 995 queryParams: _queryParams, |
| 996 uploadOptions: _uploadOptions, |
| 997 uploadMedia: _uploadMedia, |
| 998 downloadOptions: _downloadOptions); |
| 999 return _response.then((data) => new ObjectAccessControls.fromJson(data)); |
| 1000 } |
| 1001 |
| 1002 /** |
| 1003 * Updates a default object ACL entry on the specified bucket. This method |
| 1004 * supports patch semantics. |
| 1005 * |
| 1006 * [request] - The metadata request object. |
| 1007 * |
| 1008 * Request parameters: |
| 1009 * |
| 1010 * [bucket] - Name of a bucket. |
| 1011 * |
| 1012 * [entity] - The entity holding the permission. Can be user-userId, |
| 1013 * user-emailAddress, group-groupId, group-emailAddress, allUsers, or |
| 1014 * allAuthenticatedUsers. |
| 1015 * |
| 1016 * Completes with a [ObjectAccessControl]. |
| 1017 * |
| 1018 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1019 * error. |
| 1020 * |
| 1021 * If the used [http.Client] completes with an error when making a REST call, |
| 1022 * this method will complete with the same error. |
| 1023 */ |
| 1024 async.Future<ObjectAccessControl> patch(ObjectAccessControl request, core.Stri
ng bucket, core.String entity) { |
| 1025 var _url = null; |
| 1026 var _queryParams = new core.Map(); |
| 1027 var _uploadMedia = null; |
| 1028 var _uploadOptions = null; |
| 1029 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1030 var _body = null; |
| 1031 |
| 1032 if (request != null) { |
| 1033 _body = convert.JSON.encode((request).toJson()); |
| 1034 } |
| 1035 if (bucket == null) { |
| 1036 throw new core.ArgumentError("Parameter bucket is required."); |
| 1037 } |
| 1038 if (entity == null) { |
| 1039 throw new core.ArgumentError("Parameter entity is required."); |
| 1040 } |
| 1041 |
| 1042 |
| 1043 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/defaultOb
jectAcl/' + common_internal.Escaper.ecapeVariable('$entity'); |
| 1044 |
| 1045 var _response = _requester.request(_url, |
| 1046 "PATCH", |
| 1047 body: _body, |
| 1048 queryParams: _queryParams, |
| 1049 uploadOptions: _uploadOptions, |
| 1050 uploadMedia: _uploadMedia, |
| 1051 downloadOptions: _downloadOptions); |
| 1052 return _response.then((data) => new ObjectAccessControl.fromJson(data)); |
| 1053 } |
| 1054 |
| 1055 /** |
| 1056 * Updates a default object ACL entry on the specified bucket. |
| 1057 * |
| 1058 * [request] - The metadata request object. |
| 1059 * |
| 1060 * Request parameters: |
| 1061 * |
| 1062 * [bucket] - Name of a bucket. |
| 1063 * |
| 1064 * [entity] - The entity holding the permission. Can be user-userId, |
| 1065 * user-emailAddress, group-groupId, group-emailAddress, allUsers, or |
| 1066 * allAuthenticatedUsers. |
| 1067 * |
| 1068 * Completes with a [ObjectAccessControl]. |
| 1069 * |
| 1070 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1071 * error. |
| 1072 * |
| 1073 * If the used [http.Client] completes with an error when making a REST call, |
| 1074 * this method will complete with the same error. |
| 1075 */ |
| 1076 async.Future<ObjectAccessControl> update(ObjectAccessControl request, core.Str
ing bucket, core.String entity) { |
| 1077 var _url = null; |
| 1078 var _queryParams = new core.Map(); |
| 1079 var _uploadMedia = null; |
| 1080 var _uploadOptions = null; |
| 1081 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1082 var _body = null; |
| 1083 |
| 1084 if (request != null) { |
| 1085 _body = convert.JSON.encode((request).toJson()); |
| 1086 } |
| 1087 if (bucket == null) { |
| 1088 throw new core.ArgumentError("Parameter bucket is required."); |
| 1089 } |
| 1090 if (entity == null) { |
| 1091 throw new core.ArgumentError("Parameter entity is required."); |
| 1092 } |
| 1093 |
| 1094 |
| 1095 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/defaultOb
jectAcl/' + common_internal.Escaper.ecapeVariable('$entity'); |
| 1096 |
| 1097 var _response = _requester.request(_url, |
| 1098 "PUT", |
| 1099 body: _body, |
| 1100 queryParams: _queryParams, |
| 1101 uploadOptions: _uploadOptions, |
| 1102 uploadMedia: _uploadMedia, |
| 1103 downloadOptions: _downloadOptions); |
| 1104 return _response.then((data) => new ObjectAccessControl.fromJson(data)); |
| 1105 } |
| 1106 |
| 1107 } |
| 1108 |
| 1109 |
| 1110 /** Not documented yet. */ |
| 1111 class ObjectAccessControlsResourceApi { |
| 1112 final common_internal.ApiRequester _requester; |
| 1113 |
| 1114 ObjectAccessControlsResourceApi(common_internal.ApiRequester client) : |
| 1115 _requester = client; |
| 1116 |
| 1117 /** |
| 1118 * Permanently deletes the ACL entry for the specified entity on the specified |
| 1119 * object. |
| 1120 * |
| 1121 * Request parameters: |
| 1122 * |
| 1123 * [bucket] - Name of a bucket. |
| 1124 * |
| 1125 * [object] - Name of the object. |
| 1126 * |
| 1127 * [entity] - The entity holding the permission. Can be user-userId, |
| 1128 * user-emailAddress, group-groupId, group-emailAddress, allUsers, or |
| 1129 * allAuthenticatedUsers. |
| 1130 * |
| 1131 * [generation] - If present, selects a specific revision of this object (as |
| 1132 * opposed to the latest version, the default). |
| 1133 * |
| 1134 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1135 * error. |
| 1136 * |
| 1137 * If the used [http.Client] completes with an error when making a REST call, |
| 1138 * this method will complete with the same error. |
| 1139 */ |
| 1140 async.Future delete(core.String bucket, core.String object, core.String entity
, {core.String generation}) { |
| 1141 var _url = null; |
| 1142 var _queryParams = new core.Map(); |
| 1143 var _uploadMedia = null; |
| 1144 var _uploadOptions = null; |
| 1145 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1146 var _body = null; |
| 1147 |
| 1148 if (bucket == null) { |
| 1149 throw new core.ArgumentError("Parameter bucket is required."); |
| 1150 } |
| 1151 if (object == null) { |
| 1152 throw new core.ArgumentError("Parameter object is required."); |
| 1153 } |
| 1154 if (entity == null) { |
| 1155 throw new core.ArgumentError("Parameter entity is required."); |
| 1156 } |
| 1157 if (generation != null) { |
| 1158 _queryParams["generation"] = [generation]; |
| 1159 } |
| 1160 |
| 1161 _downloadOptions = null; |
| 1162 |
| 1163 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/o/' + com
mon_internal.Escaper.ecapeVariable('$object') + '/acl/' + common_internal.Escape
r.ecapeVariable('$entity'); |
| 1164 |
| 1165 var _response = _requester.request(_url, |
| 1166 "DELETE", |
| 1167 body: _body, |
| 1168 queryParams: _queryParams, |
| 1169 uploadOptions: _uploadOptions, |
| 1170 uploadMedia: _uploadMedia, |
| 1171 downloadOptions: _downloadOptions); |
| 1172 return _response.then((data) => null); |
| 1173 } |
| 1174 |
| 1175 /** |
| 1176 * Returns the ACL entry for the specified entity on the specified object. |
| 1177 * |
| 1178 * Request parameters: |
| 1179 * |
| 1180 * [bucket] - Name of a bucket. |
| 1181 * |
| 1182 * [object] - Name of the object. |
| 1183 * |
| 1184 * [entity] - The entity holding the permission. Can be user-userId, |
| 1185 * user-emailAddress, group-groupId, group-emailAddress, allUsers, or |
| 1186 * allAuthenticatedUsers. |
| 1187 * |
| 1188 * [generation] - If present, selects a specific revision of this object (as |
| 1189 * opposed to the latest version, the default). |
| 1190 * |
| 1191 * Completes with a [ObjectAccessControl]. |
| 1192 * |
| 1193 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1194 * error. |
| 1195 * |
| 1196 * If the used [http.Client] completes with an error when making a REST call, |
| 1197 * this method will complete with the same error. |
| 1198 */ |
| 1199 async.Future<ObjectAccessControl> get(core.String bucket, core.String object,
core.String entity, {core.String generation}) { |
| 1200 var _url = null; |
| 1201 var _queryParams = new core.Map(); |
| 1202 var _uploadMedia = null; |
| 1203 var _uploadOptions = null; |
| 1204 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1205 var _body = null; |
| 1206 |
| 1207 if (bucket == null) { |
| 1208 throw new core.ArgumentError("Parameter bucket is required."); |
| 1209 } |
| 1210 if (object == null) { |
| 1211 throw new core.ArgumentError("Parameter object is required."); |
| 1212 } |
| 1213 if (entity == null) { |
| 1214 throw new core.ArgumentError("Parameter entity is required."); |
| 1215 } |
| 1216 if (generation != null) { |
| 1217 _queryParams["generation"] = [generation]; |
| 1218 } |
| 1219 |
| 1220 |
| 1221 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/o/' + com
mon_internal.Escaper.ecapeVariable('$object') + '/acl/' + common_internal.Escape
r.ecapeVariable('$entity'); |
| 1222 |
| 1223 var _response = _requester.request(_url, |
| 1224 "GET", |
| 1225 body: _body, |
| 1226 queryParams: _queryParams, |
| 1227 uploadOptions: _uploadOptions, |
| 1228 uploadMedia: _uploadMedia, |
| 1229 downloadOptions: _downloadOptions); |
| 1230 return _response.then((data) => new ObjectAccessControl.fromJson(data)); |
| 1231 } |
| 1232 |
| 1233 /** |
| 1234 * Creates a new ACL entry on the specified object. |
| 1235 * |
| 1236 * [request] - The metadata request object. |
| 1237 * |
| 1238 * Request parameters: |
| 1239 * |
| 1240 * [bucket] - Name of a bucket. |
| 1241 * |
| 1242 * [object] - Name of the object. |
| 1243 * |
| 1244 * [generation] - If present, selects a specific revision of this object (as |
| 1245 * opposed to the latest version, the default). |
| 1246 * |
| 1247 * Completes with a [ObjectAccessControl]. |
| 1248 * |
| 1249 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1250 * error. |
| 1251 * |
| 1252 * If the used [http.Client] completes with an error when making a REST call, |
| 1253 * this method will complete with the same error. |
| 1254 */ |
| 1255 async.Future<ObjectAccessControl> insert(ObjectAccessControl request, core.Str
ing bucket, core.String object, {core.String generation}) { |
| 1256 var _url = null; |
| 1257 var _queryParams = new core.Map(); |
| 1258 var _uploadMedia = null; |
| 1259 var _uploadOptions = null; |
| 1260 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1261 var _body = null; |
| 1262 |
| 1263 if (request != null) { |
| 1264 _body = convert.JSON.encode((request).toJson()); |
| 1265 } |
| 1266 if (bucket == null) { |
| 1267 throw new core.ArgumentError("Parameter bucket is required."); |
| 1268 } |
| 1269 if (object == null) { |
| 1270 throw new core.ArgumentError("Parameter object is required."); |
| 1271 } |
| 1272 if (generation != null) { |
| 1273 _queryParams["generation"] = [generation]; |
| 1274 } |
| 1275 |
| 1276 |
| 1277 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/o/' + com
mon_internal.Escaper.ecapeVariable('$object') + '/acl'; |
| 1278 |
| 1279 var _response = _requester.request(_url, |
| 1280 "POST", |
| 1281 body: _body, |
| 1282 queryParams: _queryParams, |
| 1283 uploadOptions: _uploadOptions, |
| 1284 uploadMedia: _uploadMedia, |
| 1285 downloadOptions: _downloadOptions); |
| 1286 return _response.then((data) => new ObjectAccessControl.fromJson(data)); |
| 1287 } |
| 1288 |
| 1289 /** |
| 1290 * Retrieves ACL entries on the specified object. |
| 1291 * |
| 1292 * Request parameters: |
| 1293 * |
| 1294 * [bucket] - Name of a bucket. |
| 1295 * |
| 1296 * [object] - Name of the object. |
| 1297 * |
| 1298 * [generation] - If present, selects a specific revision of this object (as |
| 1299 * opposed to the latest version, the default). |
| 1300 * |
| 1301 * Completes with a [ObjectAccessControls]. |
| 1302 * |
| 1303 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1304 * error. |
| 1305 * |
| 1306 * If the used [http.Client] completes with an error when making a REST call, |
| 1307 * this method will complete with the same error. |
| 1308 */ |
| 1309 async.Future<ObjectAccessControls> list(core.String bucket, core.String object
, {core.String generation}) { |
| 1310 var _url = null; |
| 1311 var _queryParams = new core.Map(); |
| 1312 var _uploadMedia = null; |
| 1313 var _uploadOptions = null; |
| 1314 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1315 var _body = null; |
| 1316 |
| 1317 if (bucket == null) { |
| 1318 throw new core.ArgumentError("Parameter bucket is required."); |
| 1319 } |
| 1320 if (object == null) { |
| 1321 throw new core.ArgumentError("Parameter object is required."); |
| 1322 } |
| 1323 if (generation != null) { |
| 1324 _queryParams["generation"] = [generation]; |
| 1325 } |
| 1326 |
| 1327 |
| 1328 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/o/' + com
mon_internal.Escaper.ecapeVariable('$object') + '/acl'; |
| 1329 |
| 1330 var _response = _requester.request(_url, |
| 1331 "GET", |
| 1332 body: _body, |
| 1333 queryParams: _queryParams, |
| 1334 uploadOptions: _uploadOptions, |
| 1335 uploadMedia: _uploadMedia, |
| 1336 downloadOptions: _downloadOptions); |
| 1337 return _response.then((data) => new ObjectAccessControls.fromJson(data)); |
| 1338 } |
| 1339 |
| 1340 /** |
| 1341 * Updates an ACL entry on the specified object. This method supports patch |
| 1342 * semantics. |
| 1343 * |
| 1344 * [request] - The metadata request object. |
| 1345 * |
| 1346 * Request parameters: |
| 1347 * |
| 1348 * [bucket] - Name of a bucket. |
| 1349 * |
| 1350 * [object] - Name of the object. |
| 1351 * |
| 1352 * [entity] - The entity holding the permission. Can be user-userId, |
| 1353 * user-emailAddress, group-groupId, group-emailAddress, allUsers, or |
| 1354 * allAuthenticatedUsers. |
| 1355 * |
| 1356 * [generation] - If present, selects a specific revision of this object (as |
| 1357 * opposed to the latest version, the default). |
| 1358 * |
| 1359 * Completes with a [ObjectAccessControl]. |
| 1360 * |
| 1361 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1362 * error. |
| 1363 * |
| 1364 * If the used [http.Client] completes with an error when making a REST call, |
| 1365 * this method will complete with the same error. |
| 1366 */ |
| 1367 async.Future<ObjectAccessControl> patch(ObjectAccessControl request, core.Stri
ng bucket, core.String object, core.String entity, {core.String generation}) { |
| 1368 var _url = null; |
| 1369 var _queryParams = new core.Map(); |
| 1370 var _uploadMedia = null; |
| 1371 var _uploadOptions = null; |
| 1372 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1373 var _body = null; |
| 1374 |
| 1375 if (request != null) { |
| 1376 _body = convert.JSON.encode((request).toJson()); |
| 1377 } |
| 1378 if (bucket == null) { |
| 1379 throw new core.ArgumentError("Parameter bucket is required."); |
| 1380 } |
| 1381 if (object == null) { |
| 1382 throw new core.ArgumentError("Parameter object is required."); |
| 1383 } |
| 1384 if (entity == null) { |
| 1385 throw new core.ArgumentError("Parameter entity is required."); |
| 1386 } |
| 1387 if (generation != null) { |
| 1388 _queryParams["generation"] = [generation]; |
| 1389 } |
| 1390 |
| 1391 |
| 1392 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/o/' + com
mon_internal.Escaper.ecapeVariable('$object') + '/acl/' + common_internal.Escape
r.ecapeVariable('$entity'); |
| 1393 |
| 1394 var _response = _requester.request(_url, |
| 1395 "PATCH", |
| 1396 body: _body, |
| 1397 queryParams: _queryParams, |
| 1398 uploadOptions: _uploadOptions, |
| 1399 uploadMedia: _uploadMedia, |
| 1400 downloadOptions: _downloadOptions); |
| 1401 return _response.then((data) => new ObjectAccessControl.fromJson(data)); |
| 1402 } |
| 1403 |
| 1404 /** |
| 1405 * Updates an ACL entry on the specified object. |
| 1406 * |
| 1407 * [request] - The metadata request object. |
| 1408 * |
| 1409 * Request parameters: |
| 1410 * |
| 1411 * [bucket] - Name of a bucket. |
| 1412 * |
| 1413 * [object] - Name of the object. |
| 1414 * |
| 1415 * [entity] - The entity holding the permission. Can be user-userId, |
| 1416 * user-emailAddress, group-groupId, group-emailAddress, allUsers, or |
| 1417 * allAuthenticatedUsers. |
| 1418 * |
| 1419 * [generation] - If present, selects a specific revision of this object (as |
| 1420 * opposed to the latest version, the default). |
| 1421 * |
| 1422 * Completes with a [ObjectAccessControl]. |
| 1423 * |
| 1424 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1425 * error. |
| 1426 * |
| 1427 * If the used [http.Client] completes with an error when making a REST call, |
| 1428 * this method will complete with the same error. |
| 1429 */ |
| 1430 async.Future<ObjectAccessControl> update(ObjectAccessControl request, core.Str
ing bucket, core.String object, core.String entity, {core.String generation}) { |
| 1431 var _url = null; |
| 1432 var _queryParams = new core.Map(); |
| 1433 var _uploadMedia = null; |
| 1434 var _uploadOptions = null; |
| 1435 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1436 var _body = null; |
| 1437 |
| 1438 if (request != null) { |
| 1439 _body = convert.JSON.encode((request).toJson()); |
| 1440 } |
| 1441 if (bucket == null) { |
| 1442 throw new core.ArgumentError("Parameter bucket is required."); |
| 1443 } |
| 1444 if (object == null) { |
| 1445 throw new core.ArgumentError("Parameter object is required."); |
| 1446 } |
| 1447 if (entity == null) { |
| 1448 throw new core.ArgumentError("Parameter entity is required."); |
| 1449 } |
| 1450 if (generation != null) { |
| 1451 _queryParams["generation"] = [generation]; |
| 1452 } |
| 1453 |
| 1454 |
| 1455 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/o/' + com
mon_internal.Escaper.ecapeVariable('$object') + '/acl/' + common_internal.Escape
r.ecapeVariable('$entity'); |
| 1456 |
| 1457 var _response = _requester.request(_url, |
| 1458 "PUT", |
| 1459 body: _body, |
| 1460 queryParams: _queryParams, |
| 1461 uploadOptions: _uploadOptions, |
| 1462 uploadMedia: _uploadMedia, |
| 1463 downloadOptions: _downloadOptions); |
| 1464 return _response.then((data) => new ObjectAccessControl.fromJson(data)); |
| 1465 } |
| 1466 |
| 1467 } |
| 1468 |
| 1469 |
| 1470 /** Not documented yet. */ |
| 1471 class ObjectsResourceApi { |
| 1472 final common_internal.ApiRequester _requester; |
| 1473 |
| 1474 ObjectsResourceApi(common_internal.ApiRequester client) : |
| 1475 _requester = client; |
| 1476 |
| 1477 /** |
| 1478 * Concatenates a list of existing objects into a new object in the same |
| 1479 * bucket. |
| 1480 * |
| 1481 * [request] - The metadata request object. |
| 1482 * |
| 1483 * Request parameters: |
| 1484 * |
| 1485 * [destinationBucket] - Name of the bucket in which to store the new object. |
| 1486 * |
| 1487 * [destinationObject] - Name of the new object. |
| 1488 * |
| 1489 * [destinationPredefinedAcl] - Apply a predefined set of access controls to |
| 1490 * the destination object. |
| 1491 * Possible string values are: |
| 1492 * - "authenticatedRead" : Object owner gets OWNER access, and |
| 1493 * allAuthenticatedUsers get READER access. |
| 1494 * - "bucketOwnerFullControl" : Object owner gets OWNER access, and project |
| 1495 * team owners get OWNER access. |
| 1496 * - "bucketOwnerRead" : Object owner gets OWNER access, and project team |
| 1497 * owners get READER access. |
| 1498 * - "private" : Object owner gets OWNER access. |
| 1499 * - "projectPrivate" : Object owner gets OWNER access, and project team |
| 1500 * members get access according to their roles. |
| 1501 * - "publicRead" : Object owner gets OWNER access, and allUsers get READER |
| 1502 * access. |
| 1503 * |
| 1504 * [ifGenerationMatch] - Makes the operation conditional on whether the |
| 1505 * object's current generation matches the given value. |
| 1506 * |
| 1507 * [ifMetagenerationMatch] - Makes the operation conditional on whether the |
| 1508 * object's current metageneration matches the given value. |
| 1509 * |
| 1510 * [downloadOptions] - Options for downloading. A download can be either a |
| 1511 * Metadata (default) or Media download. Partial Media downloads are possible |
| 1512 * as well. |
| 1513 * |
| 1514 * Completes with a |
| 1515 * |
| 1516 * - [Object] for Metadata downloads (see [downloadOptions]). |
| 1517 * |
| 1518 * - [common.Media] for Media downloads (see [downloadOptions]). |
| 1519 * |
| 1520 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1521 * error. |
| 1522 * |
| 1523 * If the used [http.Client] completes with an error when making a REST call, |
| 1524 * this method will complete with the same error. |
| 1525 */ |
| 1526 async.Future compose(ComposeRequest request, core.String destinationBucket, co
re.String destinationObject, {core.String destinationPredefinedAcl, core.String
ifGenerationMatch, core.String ifMetagenerationMatch, common.DownloadOptions dow
nloadOptions: common.DownloadOptions.Metadata}) { |
| 1527 var _url = null; |
| 1528 var _queryParams = new core.Map(); |
| 1529 var _uploadMedia = null; |
| 1530 var _uploadOptions = null; |
| 1531 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1532 var _body = null; |
| 1533 |
| 1534 if (request != null) { |
| 1535 _body = convert.JSON.encode((request).toJson()); |
| 1536 } |
| 1537 if (destinationBucket == null) { |
| 1538 throw new core.ArgumentError("Parameter destinationBucket is required."); |
| 1539 } |
| 1540 if (destinationObject == null) { |
| 1541 throw new core.ArgumentError("Parameter destinationObject is required."); |
| 1542 } |
| 1543 if (destinationPredefinedAcl != null) { |
| 1544 _queryParams["destinationPredefinedAcl"] = [destinationPredefinedAcl]; |
| 1545 } |
| 1546 if (ifGenerationMatch != null) { |
| 1547 _queryParams["ifGenerationMatch"] = [ifGenerationMatch]; |
| 1548 } |
| 1549 if (ifMetagenerationMatch != null) { |
| 1550 _queryParams["ifMetagenerationMatch"] = [ifMetagenerationMatch]; |
| 1551 } |
| 1552 |
| 1553 _downloadOptions = downloadOptions; |
| 1554 |
| 1555 _url = 'b/' + common_internal.Escaper.ecapeVariable('$destinationBucket') +
'/o/' + common_internal.Escaper.ecapeVariable('$destinationObject') + '/compose'
; |
| 1556 |
| 1557 var _response = _requester.request(_url, |
| 1558 "POST", |
| 1559 body: _body, |
| 1560 queryParams: _queryParams, |
| 1561 uploadOptions: _uploadOptions, |
| 1562 uploadMedia: _uploadMedia, |
| 1563 downloadOptions: _downloadOptions); |
| 1564 if (_downloadOptions == null || |
| 1565 _downloadOptions == common.DownloadOptions.Metadata) { |
| 1566 return _response.then((data) => new Object.fromJson(data)); |
| 1567 } else { |
| 1568 return _response; |
| 1569 } |
| 1570 } |
| 1571 |
| 1572 /** |
| 1573 * Copies an object to a specified location. Optionally overrides metadata. |
| 1574 * |
| 1575 * [request] - The metadata request object. |
| 1576 * |
| 1577 * Request parameters: |
| 1578 * |
| 1579 * [sourceBucket] - Name of the bucket in which to find the source object. |
| 1580 * |
| 1581 * [sourceObject] - Name of the source object. |
| 1582 * |
| 1583 * [destinationBucket] - Name of the bucket in which to store the new object. |
| 1584 * Overrides the provided object metadata's bucket value, if any. |
| 1585 * |
| 1586 * [destinationObject] - Name of the new object. Required when the object |
| 1587 * metadata is not otherwise provided. Overrides the object metadata's name |
| 1588 * value, if any. |
| 1589 * |
| 1590 * [destinationPredefinedAcl] - Apply a predefined set of access controls to |
| 1591 * the destination object. |
| 1592 * Possible string values are: |
| 1593 * - "authenticatedRead" : Object owner gets OWNER access, and |
| 1594 * allAuthenticatedUsers get READER access. |
| 1595 * - "bucketOwnerFullControl" : Object owner gets OWNER access, and project |
| 1596 * team owners get OWNER access. |
| 1597 * - "bucketOwnerRead" : Object owner gets OWNER access, and project team |
| 1598 * owners get READER access. |
| 1599 * - "private" : Object owner gets OWNER access. |
| 1600 * - "projectPrivate" : Object owner gets OWNER access, and project team |
| 1601 * members get access according to their roles. |
| 1602 * - "publicRead" : Object owner gets OWNER access, and allUsers get READER |
| 1603 * access. |
| 1604 * |
| 1605 * [ifGenerationMatch] - Makes the operation conditional on whether the |
| 1606 * destination object's current generation matches the given value. |
| 1607 * |
| 1608 * [ifGenerationNotMatch] - Makes the operation conditional on whether the |
| 1609 * destination object's current generation does not match the given value. |
| 1610 * |
| 1611 * [ifMetagenerationMatch] - Makes the operation conditional on whether the |
| 1612 * destination object's current metageneration matches the given value. |
| 1613 * |
| 1614 * [ifMetagenerationNotMatch] - Makes the operation conditional on whether the |
| 1615 * destination object's current metageneration does not match the given value. |
| 1616 * |
| 1617 * [ifSourceGenerationMatch] - Makes the operation conditional on whether the |
| 1618 * source object's generation matches the given value. |
| 1619 * |
| 1620 * [ifSourceGenerationNotMatch] - Makes the operation conditional on whether |
| 1621 * the source object's generation does not match the given value. |
| 1622 * |
| 1623 * [ifSourceMetagenerationMatch] - Makes the operation conditional on whether |
| 1624 * the source object's current metageneration matches the given value. |
| 1625 * |
| 1626 * [ifSourceMetagenerationNotMatch] - Makes the operation conditional on |
| 1627 * whether the source object's current metageneration does not match the given |
| 1628 * value. |
| 1629 * |
| 1630 * [projection] - Set of properties to return. Defaults to noAcl, unless the |
| 1631 * object resource specifies the acl property, when it defaults to full. |
| 1632 * Possible string values are: |
| 1633 * - "full" : Include all properties. |
| 1634 * - "noAcl" : Omit the acl property. |
| 1635 * |
| 1636 * [sourceGeneration] - If present, selects a specific revision of the source |
| 1637 * object (as opposed to the latest version, the default). |
| 1638 * |
| 1639 * [downloadOptions] - Options for downloading. A download can be either a |
| 1640 * Metadata (default) or Media download. Partial Media downloads are possible |
| 1641 * as well. |
| 1642 * |
| 1643 * Completes with a |
| 1644 * |
| 1645 * - [Object] for Metadata downloads (see [downloadOptions]). |
| 1646 * |
| 1647 * - [common.Media] for Media downloads (see [downloadOptions]). |
| 1648 * |
| 1649 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1650 * error. |
| 1651 * |
| 1652 * If the used [http.Client] completes with an error when making a REST call, |
| 1653 * this method will complete with the same error. |
| 1654 */ |
| 1655 async.Future copy(Object request, core.String sourceBucket, core.String source
Object, core.String destinationBucket, core.String destinationObject, {core.Stri
ng destinationPredefinedAcl, core.String ifGenerationMatch, core.String ifGenera
tionNotMatch, core.String ifMetagenerationMatch, core.String ifMetagenerationNot
Match, core.String ifSourceGenerationMatch, core.String ifSourceGenerationNotMat
ch, core.String ifSourceMetagenerationMatch, core.String ifSourceMetagenerationN
otMatch, core.String projection, core.String sourceGeneration, common.DownloadOp
tions downloadOptions: common.DownloadOptions.Metadata}) { |
| 1656 var _url = null; |
| 1657 var _queryParams = new core.Map(); |
| 1658 var _uploadMedia = null; |
| 1659 var _uploadOptions = null; |
| 1660 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1661 var _body = null; |
| 1662 |
| 1663 if (request != null) { |
| 1664 _body = convert.JSON.encode((request).toJson()); |
| 1665 } |
| 1666 if (sourceBucket == null) { |
| 1667 throw new core.ArgumentError("Parameter sourceBucket is required."); |
| 1668 } |
| 1669 if (sourceObject == null) { |
| 1670 throw new core.ArgumentError("Parameter sourceObject is required."); |
| 1671 } |
| 1672 if (destinationBucket == null) { |
| 1673 throw new core.ArgumentError("Parameter destinationBucket is required."); |
| 1674 } |
| 1675 if (destinationObject == null) { |
| 1676 throw new core.ArgumentError("Parameter destinationObject is required."); |
| 1677 } |
| 1678 if (destinationPredefinedAcl != null) { |
| 1679 _queryParams["destinationPredefinedAcl"] = [destinationPredefinedAcl]; |
| 1680 } |
| 1681 if (ifGenerationMatch != null) { |
| 1682 _queryParams["ifGenerationMatch"] = [ifGenerationMatch]; |
| 1683 } |
| 1684 if (ifGenerationNotMatch != null) { |
| 1685 _queryParams["ifGenerationNotMatch"] = [ifGenerationNotMatch]; |
| 1686 } |
| 1687 if (ifMetagenerationMatch != null) { |
| 1688 _queryParams["ifMetagenerationMatch"] = [ifMetagenerationMatch]; |
| 1689 } |
| 1690 if (ifMetagenerationNotMatch != null) { |
| 1691 _queryParams["ifMetagenerationNotMatch"] = [ifMetagenerationNotMatch]; |
| 1692 } |
| 1693 if (ifSourceGenerationMatch != null) { |
| 1694 _queryParams["ifSourceGenerationMatch"] = [ifSourceGenerationMatch]; |
| 1695 } |
| 1696 if (ifSourceGenerationNotMatch != null) { |
| 1697 _queryParams["ifSourceGenerationNotMatch"] = [ifSourceGenerationNotMatch]; |
| 1698 } |
| 1699 if (ifSourceMetagenerationMatch != null) { |
| 1700 _queryParams["ifSourceMetagenerationMatch"] = [ifSourceMetagenerationMatch
]; |
| 1701 } |
| 1702 if (ifSourceMetagenerationNotMatch != null) { |
| 1703 _queryParams["ifSourceMetagenerationNotMatch"] = [ifSourceMetagenerationNo
tMatch]; |
| 1704 } |
| 1705 if (projection != null) { |
| 1706 _queryParams["projection"] = [projection]; |
| 1707 } |
| 1708 if (sourceGeneration != null) { |
| 1709 _queryParams["sourceGeneration"] = [sourceGeneration]; |
| 1710 } |
| 1711 |
| 1712 _downloadOptions = downloadOptions; |
| 1713 |
| 1714 _url = 'b/' + common_internal.Escaper.ecapeVariable('$sourceBucket') + '/o/'
+ common_internal.Escaper.ecapeVariable('$sourceObject') + '/copyTo/b/' + commo
n_internal.Escaper.ecapeVariable('$destinationBucket') + '/o/' + common_internal
.Escaper.ecapeVariable('$destinationObject'); |
| 1715 |
| 1716 var _response = _requester.request(_url, |
| 1717 "POST", |
| 1718 body: _body, |
| 1719 queryParams: _queryParams, |
| 1720 uploadOptions: _uploadOptions, |
| 1721 uploadMedia: _uploadMedia, |
| 1722 downloadOptions: _downloadOptions); |
| 1723 if (_downloadOptions == null || |
| 1724 _downloadOptions == common.DownloadOptions.Metadata) { |
| 1725 return _response.then((data) => new Object.fromJson(data)); |
| 1726 } else { |
| 1727 return _response; |
| 1728 } |
| 1729 } |
| 1730 |
| 1731 /** |
| 1732 * Deletes an object and its metadata. Deletions are permanent if versioning |
| 1733 * is not enabled for the bucket, or if the generation parameter is used. |
| 1734 * |
| 1735 * Request parameters: |
| 1736 * |
| 1737 * [bucket] - Name of the bucket in which the object resides. |
| 1738 * |
| 1739 * [object] - Name of the object. |
| 1740 * |
| 1741 * [generation] - If present, permanently deletes a specific revision of this |
| 1742 * object (as opposed to the latest version, the default). |
| 1743 * |
| 1744 * [ifGenerationMatch] - Makes the operation conditional on whether the |
| 1745 * object's current generation matches the given value. |
| 1746 * |
| 1747 * [ifGenerationNotMatch] - Makes the operation conditional on whether the |
| 1748 * object's current generation does not match the given value. |
| 1749 * |
| 1750 * [ifMetagenerationMatch] - Makes the operation conditional on whether the |
| 1751 * object's current metageneration matches the given value. |
| 1752 * |
| 1753 * [ifMetagenerationNotMatch] - Makes the operation conditional on whether the |
| 1754 * object's current metageneration does not match the given value. |
| 1755 * |
| 1756 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1757 * error. |
| 1758 * |
| 1759 * If the used [http.Client] completes with an error when making a REST call, |
| 1760 * this method will complete with the same error. |
| 1761 */ |
| 1762 async.Future delete(core.String bucket, core.String object, {core.String gener
ation, core.String ifGenerationMatch, core.String ifGenerationNotMatch, core.Str
ing ifMetagenerationMatch, core.String ifMetagenerationNotMatch}) { |
| 1763 var _url = null; |
| 1764 var _queryParams = new core.Map(); |
| 1765 var _uploadMedia = null; |
| 1766 var _uploadOptions = null; |
| 1767 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1768 var _body = null; |
| 1769 |
| 1770 if (bucket == null) { |
| 1771 throw new core.ArgumentError("Parameter bucket is required."); |
| 1772 } |
| 1773 if (object == null) { |
| 1774 throw new core.ArgumentError("Parameter object is required."); |
| 1775 } |
| 1776 if (generation != null) { |
| 1777 _queryParams["generation"] = [generation]; |
| 1778 } |
| 1779 if (ifGenerationMatch != null) { |
| 1780 _queryParams["ifGenerationMatch"] = [ifGenerationMatch]; |
| 1781 } |
| 1782 if (ifGenerationNotMatch != null) { |
| 1783 _queryParams["ifGenerationNotMatch"] = [ifGenerationNotMatch]; |
| 1784 } |
| 1785 if (ifMetagenerationMatch != null) { |
| 1786 _queryParams["ifMetagenerationMatch"] = [ifMetagenerationMatch]; |
| 1787 } |
| 1788 if (ifMetagenerationNotMatch != null) { |
| 1789 _queryParams["ifMetagenerationNotMatch"] = [ifMetagenerationNotMatch]; |
| 1790 } |
| 1791 |
| 1792 _downloadOptions = null; |
| 1793 |
| 1794 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/o/' + com
mon_internal.Escaper.ecapeVariable('$object'); |
| 1795 |
| 1796 var _response = _requester.request(_url, |
| 1797 "DELETE", |
| 1798 body: _body, |
| 1799 queryParams: _queryParams, |
| 1800 uploadOptions: _uploadOptions, |
| 1801 uploadMedia: _uploadMedia, |
| 1802 downloadOptions: _downloadOptions); |
| 1803 return _response.then((data) => null); |
| 1804 } |
| 1805 |
| 1806 /** |
| 1807 * Retrieves objects or their metadata. |
| 1808 * |
| 1809 * Request parameters: |
| 1810 * |
| 1811 * [bucket] - Name of the bucket in which the object resides. |
| 1812 * |
| 1813 * [object] - Name of the object. |
| 1814 * |
| 1815 * [generation] - If present, selects a specific revision of this object (as |
| 1816 * opposed to the latest version, the default). |
| 1817 * |
| 1818 * [ifGenerationMatch] - Makes the operation conditional on whether the |
| 1819 * object's generation matches the given value. |
| 1820 * |
| 1821 * [ifGenerationNotMatch] - Makes the operation conditional on whether the |
| 1822 * object's generation does not match the given value. |
| 1823 * |
| 1824 * [ifMetagenerationMatch] - Makes the operation conditional on whether the |
| 1825 * object's current metageneration matches the given value. |
| 1826 * |
| 1827 * [ifMetagenerationNotMatch] - Makes the operation conditional on whether the |
| 1828 * object's current metageneration does not match the given value. |
| 1829 * |
| 1830 * [projection] - Set of properties to return. Defaults to noAcl. |
| 1831 * Possible string values are: |
| 1832 * - "full" : Include all properties. |
| 1833 * - "noAcl" : Omit the acl property. |
| 1834 * |
| 1835 * [downloadOptions] - Options for downloading. A download can be either a |
| 1836 * Metadata (default) or Media download. Partial Media downloads are possible |
| 1837 * as well. |
| 1838 * |
| 1839 * Completes with a |
| 1840 * |
| 1841 * - [Object] for Metadata downloads (see [downloadOptions]). |
| 1842 * |
| 1843 * - [common.Media] for Media downloads (see [downloadOptions]). |
| 1844 * |
| 1845 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1846 * error. |
| 1847 * |
| 1848 * If the used [http.Client] completes with an error when making a REST call, |
| 1849 * this method will complete with the same error. |
| 1850 */ |
| 1851 async.Future get(core.String bucket, core.String object, {core.String generati
on, core.String ifGenerationMatch, core.String ifGenerationNotMatch, core.String
ifMetagenerationMatch, core.String ifMetagenerationNotMatch, core.String projec
tion, common.DownloadOptions downloadOptions: common.DownloadOptions.Metadata})
{ |
| 1852 var _url = null; |
| 1853 var _queryParams = new core.Map(); |
| 1854 var _uploadMedia = null; |
| 1855 var _uploadOptions = null; |
| 1856 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1857 var _body = null; |
| 1858 |
| 1859 if (bucket == null) { |
| 1860 throw new core.ArgumentError("Parameter bucket is required."); |
| 1861 } |
| 1862 if (object == null) { |
| 1863 throw new core.ArgumentError("Parameter object is required."); |
| 1864 } |
| 1865 if (generation != null) { |
| 1866 _queryParams["generation"] = [generation]; |
| 1867 } |
| 1868 if (ifGenerationMatch != null) { |
| 1869 _queryParams["ifGenerationMatch"] = [ifGenerationMatch]; |
| 1870 } |
| 1871 if (ifGenerationNotMatch != null) { |
| 1872 _queryParams["ifGenerationNotMatch"] = [ifGenerationNotMatch]; |
| 1873 } |
| 1874 if (ifMetagenerationMatch != null) { |
| 1875 _queryParams["ifMetagenerationMatch"] = [ifMetagenerationMatch]; |
| 1876 } |
| 1877 if (ifMetagenerationNotMatch != null) { |
| 1878 _queryParams["ifMetagenerationNotMatch"] = [ifMetagenerationNotMatch]; |
| 1879 } |
| 1880 if (projection != null) { |
| 1881 _queryParams["projection"] = [projection]; |
| 1882 } |
| 1883 |
| 1884 _downloadOptions = downloadOptions; |
| 1885 |
| 1886 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/o/' + com
mon_internal.Escaper.ecapeVariable('$object'); |
| 1887 |
| 1888 var _response = _requester.request(_url, |
| 1889 "GET", |
| 1890 body: _body, |
| 1891 queryParams: _queryParams, |
| 1892 uploadOptions: _uploadOptions, |
| 1893 uploadMedia: _uploadMedia, |
| 1894 downloadOptions: _downloadOptions); |
| 1895 if (_downloadOptions == null || |
| 1896 _downloadOptions == common.DownloadOptions.Metadata) { |
| 1897 return _response.then((data) => new Object.fromJson(data)); |
| 1898 } else { |
| 1899 return _response; |
| 1900 } |
| 1901 } |
| 1902 |
| 1903 /** |
| 1904 * Stores a new object and metadata. |
| 1905 * |
| 1906 * [request] - The metadata request object. |
| 1907 * |
| 1908 * Request parameters: |
| 1909 * |
| 1910 * [bucket] - Name of the bucket in which to store the new object. Overrides |
| 1911 * the provided object metadata's bucket value, if any. |
| 1912 * |
| 1913 * [contentEncoding] - If set, sets the contentEncoding property of the final |
| 1914 * object to this value. Setting this parameter is equivalent to setting the |
| 1915 * contentEncoding metadata property. This can be useful when uploading an |
| 1916 * object with uploadType=media to indicate the encoding of the content being |
| 1917 * uploaded. |
| 1918 * |
| 1919 * [ifGenerationMatch] - Makes the operation conditional on whether the |
| 1920 * object's current generation matches the given value. |
| 1921 * |
| 1922 * [ifGenerationNotMatch] - Makes the operation conditional on whether the |
| 1923 * object's current generation does not match the given value. |
| 1924 * |
| 1925 * [ifMetagenerationMatch] - Makes the operation conditional on whether the |
| 1926 * object's current metageneration matches the given value. |
| 1927 * |
| 1928 * [ifMetagenerationNotMatch] - Makes the operation conditional on whether the |
| 1929 * object's current metageneration does not match the given value. |
| 1930 * |
| 1931 * [name] - Name of the object. Required when the object metadata is not |
| 1932 * otherwise provided. Overrides the object metadata's name value, if any. |
| 1933 * |
| 1934 * [predefinedAcl] - Apply a predefined set of access controls to this object. |
| 1935 * Possible string values are: |
| 1936 * - "authenticatedRead" : Object owner gets OWNER access, and |
| 1937 * allAuthenticatedUsers get READER access. |
| 1938 * - "bucketOwnerFullControl" : Object owner gets OWNER access, and project |
| 1939 * team owners get OWNER access. |
| 1940 * - "bucketOwnerRead" : Object owner gets OWNER access, and project team |
| 1941 * owners get READER access. |
| 1942 * - "private" : Object owner gets OWNER access. |
| 1943 * - "projectPrivate" : Object owner gets OWNER access, and project team |
| 1944 * members get access according to their roles. |
| 1945 * - "publicRead" : Object owner gets OWNER access, and allUsers get READER |
| 1946 * access. |
| 1947 * |
| 1948 * [projection] - Set of properties to return. Defaults to noAcl, unless the |
| 1949 * object resource specifies the acl property, when it defaults to full. |
| 1950 * Possible string values are: |
| 1951 * - "full" : Include all properties. |
| 1952 * - "noAcl" : Omit the acl property. |
| 1953 * |
| 1954 * [uploadMedia] - The media to upload. |
| 1955 * |
| 1956 * [uploadOptions] - Options for the media upload. Streaming Media without the |
| 1957 * length being known ahead of time is only supported via resumable uploads. |
| 1958 * |
| 1959 * [downloadOptions] - Options for downloading. A download can be either a |
| 1960 * Metadata (default) or Media download. Partial Media downloads are possible |
| 1961 * as well. |
| 1962 * |
| 1963 * Completes with a |
| 1964 * |
| 1965 * - [Object] for Metadata downloads (see [downloadOptions]). |
| 1966 * |
| 1967 * - [common.Media] for Media downloads (see [downloadOptions]). |
| 1968 * |
| 1969 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1970 * error. |
| 1971 * |
| 1972 * If the used [http.Client] completes with an error when making a REST call, |
| 1973 * this method will complete with the same error. |
| 1974 */ |
| 1975 async.Future insert(Object request, core.String bucket, {core.String contentEn
coding, core.String ifGenerationMatch, core.String ifGenerationNotMatch, core.St
ring ifMetagenerationMatch, core.String ifMetagenerationNotMatch, core.String na
me, core.String predefinedAcl, core.String projection, common.UploadOptions uplo
adOptions : common.UploadOptions.Default, common.Media uploadMedia, common.Downl
oadOptions downloadOptions: common.DownloadOptions.Metadata}) { |
| 1976 var _url = null; |
| 1977 var _queryParams = new core.Map(); |
| 1978 var _uploadMedia = null; |
| 1979 var _uploadOptions = null; |
| 1980 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1981 var _body = null; |
| 1982 |
| 1983 if (request != null) { |
| 1984 _body = convert.JSON.encode((request).toJson()); |
| 1985 } |
| 1986 if (bucket == null) { |
| 1987 throw new core.ArgumentError("Parameter bucket is required."); |
| 1988 } |
| 1989 if (contentEncoding != null) { |
| 1990 _queryParams["contentEncoding"] = [contentEncoding]; |
| 1991 } |
| 1992 if (ifGenerationMatch != null) { |
| 1993 _queryParams["ifGenerationMatch"] = [ifGenerationMatch]; |
| 1994 } |
| 1995 if (ifGenerationNotMatch != null) { |
| 1996 _queryParams["ifGenerationNotMatch"] = [ifGenerationNotMatch]; |
| 1997 } |
| 1998 if (ifMetagenerationMatch != null) { |
| 1999 _queryParams["ifMetagenerationMatch"] = [ifMetagenerationMatch]; |
| 2000 } |
| 2001 if (ifMetagenerationNotMatch != null) { |
| 2002 _queryParams["ifMetagenerationNotMatch"] = [ifMetagenerationNotMatch]; |
| 2003 } |
| 2004 if (name != null) { |
| 2005 _queryParams["name"] = [name]; |
| 2006 } |
| 2007 if (predefinedAcl != null) { |
| 2008 _queryParams["predefinedAcl"] = [predefinedAcl]; |
| 2009 } |
| 2010 if (projection != null) { |
| 2011 _queryParams["projection"] = [projection]; |
| 2012 } |
| 2013 |
| 2014 _uploadMedia = uploadMedia; |
| 2015 _uploadOptions = uploadOptions; |
| 2016 _downloadOptions = downloadOptions; |
| 2017 |
| 2018 if (_uploadMedia == null) { |
| 2019 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/o'; |
| 2020 } else if (_uploadOptions is common.ResumableUploadOptions) { |
| 2021 _url = '/resumable/upload/storage/v1/b/' + common_internal.Escaper.ecapeVa
riable('$bucket') + '/o'; |
| 2022 } else { |
| 2023 _url = '/upload/storage/v1/b/' + common_internal.Escaper.ecapeVariable('$b
ucket') + '/o'; |
| 2024 } |
| 2025 |
| 2026 |
| 2027 var _response = _requester.request(_url, |
| 2028 "POST", |
| 2029 body: _body, |
| 2030 queryParams: _queryParams, |
| 2031 uploadOptions: _uploadOptions, |
| 2032 uploadMedia: _uploadMedia, |
| 2033 downloadOptions: _downloadOptions); |
| 2034 if (_downloadOptions == null || |
| 2035 _downloadOptions == common.DownloadOptions.Metadata) { |
| 2036 return _response.then((data) => new Object.fromJson(data)); |
| 2037 } else { |
| 2038 return _response; |
| 2039 } |
| 2040 } |
| 2041 |
| 2042 /** |
| 2043 * Retrieves a list of objects matching the criteria. |
| 2044 * |
| 2045 * Request parameters: |
| 2046 * |
| 2047 * [bucket] - Name of the bucket in which to look for objects. |
| 2048 * |
| 2049 * [delimiter] - Returns results in a directory-like mode. items will contain |
| 2050 * only objects whose names, aside from the prefix, do not contain delimiter. |
| 2051 * Objects whose names, aside from the prefix, contain delimiter will have |
| 2052 * their name, truncated after the delimiter, returned in prefixes. Duplicate |
| 2053 * prefixes are omitted. |
| 2054 * |
| 2055 * [maxResults] - Maximum number of items plus prefixes to return. As |
| 2056 * duplicate prefixes are omitted, fewer total results may be returned than |
| 2057 * requested. |
| 2058 * |
| 2059 * [pageToken] - A previously-returned page token representing part of the |
| 2060 * larger set of results to view. |
| 2061 * |
| 2062 * [prefix] - Filter results to objects whose names begin with this prefix. |
| 2063 * |
| 2064 * [projection] - Set of properties to return. Defaults to noAcl. |
| 2065 * Possible string values are: |
| 2066 * - "full" : Include all properties. |
| 2067 * - "noAcl" : Omit the acl property. |
| 2068 * |
| 2069 * [versions] - If true, lists all versions of a file as distinct results. |
| 2070 * |
| 2071 * Completes with a [Objects]. |
| 2072 * |
| 2073 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2074 * error. |
| 2075 * |
| 2076 * If the used [http.Client] completes with an error when making a REST call, |
| 2077 * this method will complete with the same error. |
| 2078 */ |
| 2079 async.Future<Objects> list(core.String bucket, {core.String delimiter, core.in
t maxResults, core.String pageToken, core.String prefix, core.String projection,
core.bool versions}) { |
| 2080 var _url = null; |
| 2081 var _queryParams = new core.Map(); |
| 2082 var _uploadMedia = null; |
| 2083 var _uploadOptions = null; |
| 2084 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2085 var _body = null; |
| 2086 |
| 2087 if (bucket == null) { |
| 2088 throw new core.ArgumentError("Parameter bucket is required."); |
| 2089 } |
| 2090 if (delimiter != null) { |
| 2091 _queryParams["delimiter"] = [delimiter]; |
| 2092 } |
| 2093 if (maxResults != null) { |
| 2094 _queryParams["maxResults"] = ["${maxResults}"]; |
| 2095 } |
| 2096 if (pageToken != null) { |
| 2097 _queryParams["pageToken"] = [pageToken]; |
| 2098 } |
| 2099 if (prefix != null) { |
| 2100 _queryParams["prefix"] = [prefix]; |
| 2101 } |
| 2102 if (projection != null) { |
| 2103 _queryParams["projection"] = [projection]; |
| 2104 } |
| 2105 if (versions != null) { |
| 2106 _queryParams["versions"] = ["${versions}"]; |
| 2107 } |
| 2108 |
| 2109 |
| 2110 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/o'; |
| 2111 |
| 2112 var _response = _requester.request(_url, |
| 2113 "GET", |
| 2114 body: _body, |
| 2115 queryParams: _queryParams, |
| 2116 uploadOptions: _uploadOptions, |
| 2117 uploadMedia: _uploadMedia, |
| 2118 downloadOptions: _downloadOptions); |
| 2119 return _response.then((data) => new Objects.fromJson(data)); |
| 2120 } |
| 2121 |
| 2122 /** |
| 2123 * Updates an object's metadata. This method supports patch semantics. |
| 2124 * |
| 2125 * [request] - The metadata request object. |
| 2126 * |
| 2127 * Request parameters: |
| 2128 * |
| 2129 * [bucket] - Name of the bucket in which the object resides. |
| 2130 * |
| 2131 * [object] - Name of the object. |
| 2132 * |
| 2133 * [generation] - If present, selects a specific revision of this object (as |
| 2134 * opposed to the latest version, the default). |
| 2135 * |
| 2136 * [ifGenerationMatch] - Makes the operation conditional on whether the |
| 2137 * object's current generation matches the given value. |
| 2138 * |
| 2139 * [ifGenerationNotMatch] - Makes the operation conditional on whether the |
| 2140 * object's current generation does not match the given value. |
| 2141 * |
| 2142 * [ifMetagenerationMatch] - Makes the operation conditional on whether the |
| 2143 * object's current metageneration matches the given value. |
| 2144 * |
| 2145 * [ifMetagenerationNotMatch] - Makes the operation conditional on whether the |
| 2146 * object's current metageneration does not match the given value. |
| 2147 * |
| 2148 * [predefinedAcl] - Apply a predefined set of access controls to this object. |
| 2149 * Possible string values are: |
| 2150 * - "authenticatedRead" : Object owner gets OWNER access, and |
| 2151 * allAuthenticatedUsers get READER access. |
| 2152 * - "bucketOwnerFullControl" : Object owner gets OWNER access, and project |
| 2153 * team owners get OWNER access. |
| 2154 * - "bucketOwnerRead" : Object owner gets OWNER access, and project team |
| 2155 * owners get READER access. |
| 2156 * - "private" : Object owner gets OWNER access. |
| 2157 * - "projectPrivate" : Object owner gets OWNER access, and project team |
| 2158 * members get access according to their roles. |
| 2159 * - "publicRead" : Object owner gets OWNER access, and allUsers get READER |
| 2160 * access. |
| 2161 * |
| 2162 * [projection] - Set of properties to return. Defaults to full. |
| 2163 * Possible string values are: |
| 2164 * - "full" : Include all properties. |
| 2165 * - "noAcl" : Omit the acl property. |
| 2166 * |
| 2167 * Completes with a [Object]. |
| 2168 * |
| 2169 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2170 * error. |
| 2171 * |
| 2172 * If the used [http.Client] completes with an error when making a REST call, |
| 2173 * this method will complete with the same error. |
| 2174 */ |
| 2175 async.Future<Object> patch(Object request, core.String bucket, core.String obj
ect, {core.String generation, core.String ifGenerationMatch, core.String ifGener
ationNotMatch, core.String ifMetagenerationMatch, core.String ifMetagenerationNo
tMatch, core.String predefinedAcl, core.String projection}) { |
| 2176 var _url = null; |
| 2177 var _queryParams = new core.Map(); |
| 2178 var _uploadMedia = null; |
| 2179 var _uploadOptions = null; |
| 2180 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2181 var _body = null; |
| 2182 |
| 2183 if (request != null) { |
| 2184 _body = convert.JSON.encode((request).toJson()); |
| 2185 } |
| 2186 if (bucket == null) { |
| 2187 throw new core.ArgumentError("Parameter bucket is required."); |
| 2188 } |
| 2189 if (object == null) { |
| 2190 throw new core.ArgumentError("Parameter object is required."); |
| 2191 } |
| 2192 if (generation != null) { |
| 2193 _queryParams["generation"] = [generation]; |
| 2194 } |
| 2195 if (ifGenerationMatch != null) { |
| 2196 _queryParams["ifGenerationMatch"] = [ifGenerationMatch]; |
| 2197 } |
| 2198 if (ifGenerationNotMatch != null) { |
| 2199 _queryParams["ifGenerationNotMatch"] = [ifGenerationNotMatch]; |
| 2200 } |
| 2201 if (ifMetagenerationMatch != null) { |
| 2202 _queryParams["ifMetagenerationMatch"] = [ifMetagenerationMatch]; |
| 2203 } |
| 2204 if (ifMetagenerationNotMatch != null) { |
| 2205 _queryParams["ifMetagenerationNotMatch"] = [ifMetagenerationNotMatch]; |
| 2206 } |
| 2207 if (predefinedAcl != null) { |
| 2208 _queryParams["predefinedAcl"] = [predefinedAcl]; |
| 2209 } |
| 2210 if (projection != null) { |
| 2211 _queryParams["projection"] = [projection]; |
| 2212 } |
| 2213 |
| 2214 |
| 2215 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/o/' + com
mon_internal.Escaper.ecapeVariable('$object'); |
| 2216 |
| 2217 var _response = _requester.request(_url, |
| 2218 "PATCH", |
| 2219 body: _body, |
| 2220 queryParams: _queryParams, |
| 2221 uploadOptions: _uploadOptions, |
| 2222 uploadMedia: _uploadMedia, |
| 2223 downloadOptions: _downloadOptions); |
| 2224 return _response.then((data) => new Object.fromJson(data)); |
| 2225 } |
| 2226 |
| 2227 /** |
| 2228 * Updates an object's metadata. |
| 2229 * |
| 2230 * [request] - The metadata request object. |
| 2231 * |
| 2232 * Request parameters: |
| 2233 * |
| 2234 * [bucket] - Name of the bucket in which the object resides. |
| 2235 * |
| 2236 * [object] - Name of the object. |
| 2237 * |
| 2238 * [generation] - If present, selects a specific revision of this object (as |
| 2239 * opposed to the latest version, the default). |
| 2240 * |
| 2241 * [ifGenerationMatch] - Makes the operation conditional on whether the |
| 2242 * object's current generation matches the given value. |
| 2243 * |
| 2244 * [ifGenerationNotMatch] - Makes the operation conditional on whether the |
| 2245 * object's current generation does not match the given value. |
| 2246 * |
| 2247 * [ifMetagenerationMatch] - Makes the operation conditional on whether the |
| 2248 * object's current metageneration matches the given value. |
| 2249 * |
| 2250 * [ifMetagenerationNotMatch] - Makes the operation conditional on whether the |
| 2251 * object's current metageneration does not match the given value. |
| 2252 * |
| 2253 * [predefinedAcl] - Apply a predefined set of access controls to this object. |
| 2254 * Possible string values are: |
| 2255 * - "authenticatedRead" : Object owner gets OWNER access, and |
| 2256 * allAuthenticatedUsers get READER access. |
| 2257 * - "bucketOwnerFullControl" : Object owner gets OWNER access, and project |
| 2258 * team owners get OWNER access. |
| 2259 * - "bucketOwnerRead" : Object owner gets OWNER access, and project team |
| 2260 * owners get READER access. |
| 2261 * - "private" : Object owner gets OWNER access. |
| 2262 * - "projectPrivate" : Object owner gets OWNER access, and project team |
| 2263 * members get access according to their roles. |
| 2264 * - "publicRead" : Object owner gets OWNER access, and allUsers get READER |
| 2265 * access. |
| 2266 * |
| 2267 * [projection] - Set of properties to return. Defaults to full. |
| 2268 * Possible string values are: |
| 2269 * - "full" : Include all properties. |
| 2270 * - "noAcl" : Omit the acl property. |
| 2271 * |
| 2272 * [downloadOptions] - Options for downloading. A download can be either a |
| 2273 * Metadata (default) or Media download. Partial Media downloads are possible |
| 2274 * as well. |
| 2275 * |
| 2276 * Completes with a |
| 2277 * |
| 2278 * - [Object] for Metadata downloads (see [downloadOptions]). |
| 2279 * |
| 2280 * - [common.Media] for Media downloads (see [downloadOptions]). |
| 2281 * |
| 2282 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2283 * error. |
| 2284 * |
| 2285 * If the used [http.Client] completes with an error when making a REST call, |
| 2286 * this method will complete with the same error. |
| 2287 */ |
| 2288 async.Future update(Object request, core.String bucket, core.String object, {c
ore.String generation, core.String ifGenerationMatch, core.String ifGenerationNo
tMatch, core.String ifMetagenerationMatch, core.String ifMetagenerationNotMatch,
core.String predefinedAcl, core.String projection, common.DownloadOptions downl
oadOptions: common.DownloadOptions.Metadata}) { |
| 2289 var _url = null; |
| 2290 var _queryParams = new core.Map(); |
| 2291 var _uploadMedia = null; |
| 2292 var _uploadOptions = null; |
| 2293 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2294 var _body = null; |
| 2295 |
| 2296 if (request != null) { |
| 2297 _body = convert.JSON.encode((request).toJson()); |
| 2298 } |
| 2299 if (bucket == null) { |
| 2300 throw new core.ArgumentError("Parameter bucket is required."); |
| 2301 } |
| 2302 if (object == null) { |
| 2303 throw new core.ArgumentError("Parameter object is required."); |
| 2304 } |
| 2305 if (generation != null) { |
| 2306 _queryParams["generation"] = [generation]; |
| 2307 } |
| 2308 if (ifGenerationMatch != null) { |
| 2309 _queryParams["ifGenerationMatch"] = [ifGenerationMatch]; |
| 2310 } |
| 2311 if (ifGenerationNotMatch != null) { |
| 2312 _queryParams["ifGenerationNotMatch"] = [ifGenerationNotMatch]; |
| 2313 } |
| 2314 if (ifMetagenerationMatch != null) { |
| 2315 _queryParams["ifMetagenerationMatch"] = [ifMetagenerationMatch]; |
| 2316 } |
| 2317 if (ifMetagenerationNotMatch != null) { |
| 2318 _queryParams["ifMetagenerationNotMatch"] = [ifMetagenerationNotMatch]; |
| 2319 } |
| 2320 if (predefinedAcl != null) { |
| 2321 _queryParams["predefinedAcl"] = [predefinedAcl]; |
| 2322 } |
| 2323 if (projection != null) { |
| 2324 _queryParams["projection"] = [projection]; |
| 2325 } |
| 2326 |
| 2327 _downloadOptions = downloadOptions; |
| 2328 |
| 2329 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/o/' + com
mon_internal.Escaper.ecapeVariable('$object'); |
| 2330 |
| 2331 var _response = _requester.request(_url, |
| 2332 "PUT", |
| 2333 body: _body, |
| 2334 queryParams: _queryParams, |
| 2335 uploadOptions: _uploadOptions, |
| 2336 uploadMedia: _uploadMedia, |
| 2337 downloadOptions: _downloadOptions); |
| 2338 if (_downloadOptions == null || |
| 2339 _downloadOptions == common.DownloadOptions.Metadata) { |
| 2340 return _response.then((data) => new Object.fromJson(data)); |
| 2341 } else { |
| 2342 return _response; |
| 2343 } |
| 2344 } |
| 2345 |
| 2346 /** |
| 2347 * Watch for changes on all objects in a bucket. |
| 2348 * |
| 2349 * [request] - The metadata request object. |
| 2350 * |
| 2351 * Request parameters: |
| 2352 * |
| 2353 * [bucket] - Name of the bucket in which to look for objects. |
| 2354 * |
| 2355 * [delimiter] - Returns results in a directory-like mode. items will contain |
| 2356 * only objects whose names, aside from the prefix, do not contain delimiter. |
| 2357 * Objects whose names, aside from the prefix, contain delimiter will have |
| 2358 * their name, truncated after the delimiter, returned in prefixes. Duplicate |
| 2359 * prefixes are omitted. |
| 2360 * |
| 2361 * [maxResults] - Maximum number of items plus prefixes to return. As |
| 2362 * duplicate prefixes are omitted, fewer total results may be returned than |
| 2363 * requested. |
| 2364 * |
| 2365 * [pageToken] - A previously-returned page token representing part of the |
| 2366 * larger set of results to view. |
| 2367 * |
| 2368 * [prefix] - Filter results to objects whose names begin with this prefix. |
| 2369 * |
| 2370 * [projection] - Set of properties to return. Defaults to noAcl. |
| 2371 * Possible string values are: |
| 2372 * - "full" : Include all properties. |
| 2373 * - "noAcl" : Omit the acl property. |
| 2374 * |
| 2375 * [versions] - If true, lists all versions of a file as distinct results. |
| 2376 * |
| 2377 * Completes with a [Channel]. |
| 2378 * |
| 2379 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2380 * error. |
| 2381 * |
| 2382 * If the used [http.Client] completes with an error when making a REST call, |
| 2383 * this method will complete with the same error. |
| 2384 */ |
| 2385 async.Future<Channel> watchAll(Channel request, core.String bucket, {core.Stri
ng delimiter, core.int maxResults, core.String pageToken, core.String prefix, co
re.String projection, core.bool versions}) { |
| 2386 var _url = null; |
| 2387 var _queryParams = new core.Map(); |
| 2388 var _uploadMedia = null; |
| 2389 var _uploadOptions = null; |
| 2390 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2391 var _body = null; |
| 2392 |
| 2393 if (request != null) { |
| 2394 _body = convert.JSON.encode((request).toJson()); |
| 2395 } |
| 2396 if (bucket == null) { |
| 2397 throw new core.ArgumentError("Parameter bucket is required."); |
| 2398 } |
| 2399 if (delimiter != null) { |
| 2400 _queryParams["delimiter"] = [delimiter]; |
| 2401 } |
| 2402 if (maxResults != null) { |
| 2403 _queryParams["maxResults"] = ["${maxResults}"]; |
| 2404 } |
| 2405 if (pageToken != null) { |
| 2406 _queryParams["pageToken"] = [pageToken]; |
| 2407 } |
| 2408 if (prefix != null) { |
| 2409 _queryParams["prefix"] = [prefix]; |
| 2410 } |
| 2411 if (projection != null) { |
| 2412 _queryParams["projection"] = [projection]; |
| 2413 } |
| 2414 if (versions != null) { |
| 2415 _queryParams["versions"] = ["${versions}"]; |
| 2416 } |
| 2417 |
| 2418 |
| 2419 _url = 'b/' + common_internal.Escaper.ecapeVariable('$bucket') + '/o/watch'; |
| 2420 |
| 2421 var _response = _requester.request(_url, |
| 2422 "POST", |
| 2423 body: _body, |
| 2424 queryParams: _queryParams, |
| 2425 uploadOptions: _uploadOptions, |
| 2426 uploadMedia: _uploadMedia, |
| 2427 downloadOptions: _downloadOptions); |
| 2428 return _response.then((data) => new Channel.fromJson(data)); |
| 2429 } |
| 2430 |
| 2431 } |
| 2432 |
| 2433 |
| 2434 |
| 2435 /** Not documented yet. */ |
| 2436 class BucketCors { |
| 2437 /** |
| 2438 * The value, in seconds, to return in the Access-Control-Max-Age header used |
| 2439 * in preflight responses. |
| 2440 */ |
| 2441 core.int maxAgeSeconds; |
| 2442 |
| 2443 /** |
| 2444 * The list of HTTP methods on which to include CORS response headers, (GET, |
| 2445 * OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and |
| 2446 * means "any method". |
| 2447 */ |
| 2448 core.List<core.String> method; |
| 2449 |
| 2450 /** |
| 2451 * The list of Origins eligible to receive CORS response headers. Note: "*" is |
| 2452 * permitted in the list of origins, and means "any Origin". |
| 2453 */ |
| 2454 core.List<core.String> origin; |
| 2455 |
| 2456 /** |
| 2457 * The list of HTTP headers other than the simple response headers to give |
| 2458 * permission for the user-agent to share across domains. |
| 2459 */ |
| 2460 core.List<core.String> responseHeader; |
| 2461 |
| 2462 |
| 2463 BucketCors(); |
| 2464 |
| 2465 BucketCors.fromJson(core.Map _json) { |
| 2466 if (_json.containsKey("maxAgeSeconds")) { |
| 2467 maxAgeSeconds = _json["maxAgeSeconds"]; |
| 2468 } |
| 2469 if (_json.containsKey("method")) { |
| 2470 method = _json["method"]; |
| 2471 } |
| 2472 if (_json.containsKey("origin")) { |
| 2473 origin = _json["origin"]; |
| 2474 } |
| 2475 if (_json.containsKey("responseHeader")) { |
| 2476 responseHeader = _json["responseHeader"]; |
| 2477 } |
| 2478 } |
| 2479 |
| 2480 core.Map toJson() { |
| 2481 var _json = new core.Map(); |
| 2482 if (maxAgeSeconds != null) { |
| 2483 _json["maxAgeSeconds"] = maxAgeSeconds; |
| 2484 } |
| 2485 if (method != null) { |
| 2486 _json["method"] = method; |
| 2487 } |
| 2488 if (origin != null) { |
| 2489 _json["origin"] = origin; |
| 2490 } |
| 2491 if (responseHeader != null) { |
| 2492 _json["responseHeader"] = responseHeader; |
| 2493 } |
| 2494 return _json; |
| 2495 } |
| 2496 } |
| 2497 |
| 2498 |
| 2499 /** The action to take. */ |
| 2500 class BucketLifecycleRuleAction { |
| 2501 /** Type of the action. Currently, only Delete is supported. */ |
| 2502 core.String type; |
| 2503 |
| 2504 |
| 2505 BucketLifecycleRuleAction(); |
| 2506 |
| 2507 BucketLifecycleRuleAction.fromJson(core.Map _json) { |
| 2508 if (_json.containsKey("type")) { |
| 2509 type = _json["type"]; |
| 2510 } |
| 2511 } |
| 2512 |
| 2513 core.Map toJson() { |
| 2514 var _json = new core.Map(); |
| 2515 if (type != null) { |
| 2516 _json["type"] = type; |
| 2517 } |
| 2518 return _json; |
| 2519 } |
| 2520 } |
| 2521 |
| 2522 |
| 2523 /** The condition(s) under which the action will be taken. */ |
| 2524 class BucketLifecycleRuleCondition { |
| 2525 /** |
| 2526 * Age of an object (in days). This condition is satisfied when an object |
| 2527 * reaches the specified age. |
| 2528 */ |
| 2529 core.int age; |
| 2530 |
| 2531 /** |
| 2532 * A date in RFC 3339 format with only the date part (for instance, |
| 2533 * "2013-01-15"). This condition is satisfied when an object is created before |
| 2534 * midnight of the specified date in UTC. |
| 2535 */ |
| 2536 core.DateTime createdBefore; |
| 2537 |
| 2538 /** |
| 2539 * Relevant only for versioned objects. If the value is true, this condition |
| 2540 * matches live objects; if the value is false, it matches archived objects. |
| 2541 */ |
| 2542 core.bool isLive; |
| 2543 |
| 2544 /** |
| 2545 * Relevant only for versioned objects. If the value is N, this condition is |
| 2546 * satisfied when there are at least N versions (including the live version) |
| 2547 * newer than this version of the object. |
| 2548 */ |
| 2549 core.int numNewerVersions; |
| 2550 |
| 2551 |
| 2552 BucketLifecycleRuleCondition(); |
| 2553 |
| 2554 BucketLifecycleRuleCondition.fromJson(core.Map _json) { |
| 2555 if (_json.containsKey("age")) { |
| 2556 age = _json["age"]; |
| 2557 } |
| 2558 if (_json.containsKey("createdBefore")) { |
| 2559 createdBefore = core.DateTime.parse(_json["createdBefore"]); |
| 2560 } |
| 2561 if (_json.containsKey("isLive")) { |
| 2562 isLive = _json["isLive"]; |
| 2563 } |
| 2564 if (_json.containsKey("numNewerVersions")) { |
| 2565 numNewerVersions = _json["numNewerVersions"]; |
| 2566 } |
| 2567 } |
| 2568 |
| 2569 core.Map toJson() { |
| 2570 var _json = new core.Map(); |
| 2571 if (age != null) { |
| 2572 _json["age"] = age; |
| 2573 } |
| 2574 if (createdBefore != null) { |
| 2575 _json["createdBefore"] = "${(createdBefore).year.toString().padLeft(4, '0'
)}-${(createdBefore).month.toString().padLeft(2, '0')}-${(createdBefore).day.toS
tring().padLeft(2, '0')}"; |
| 2576 } |
| 2577 if (isLive != null) { |
| 2578 _json["isLive"] = isLive; |
| 2579 } |
| 2580 if (numNewerVersions != null) { |
| 2581 _json["numNewerVersions"] = numNewerVersions; |
| 2582 } |
| 2583 return _json; |
| 2584 } |
| 2585 } |
| 2586 |
| 2587 |
| 2588 /** Not documented yet. */ |
| 2589 class BucketLifecycleRule { |
| 2590 /** The action to take. */ |
| 2591 BucketLifecycleRuleAction action; |
| 2592 |
| 2593 /** The condition(s) under which the action will be taken. */ |
| 2594 BucketLifecycleRuleCondition condition; |
| 2595 |
| 2596 |
| 2597 BucketLifecycleRule(); |
| 2598 |
| 2599 BucketLifecycleRule.fromJson(core.Map _json) { |
| 2600 if (_json.containsKey("action")) { |
| 2601 action = new BucketLifecycleRuleAction.fromJson(_json["action"]); |
| 2602 } |
| 2603 if (_json.containsKey("condition")) { |
| 2604 condition = new BucketLifecycleRuleCondition.fromJson(_json["condition"]); |
| 2605 } |
| 2606 } |
| 2607 |
| 2608 core.Map toJson() { |
| 2609 var _json = new core.Map(); |
| 2610 if (action != null) { |
| 2611 _json["action"] = (action).toJson(); |
| 2612 } |
| 2613 if (condition != null) { |
| 2614 _json["condition"] = (condition).toJson(); |
| 2615 } |
| 2616 return _json; |
| 2617 } |
| 2618 } |
| 2619 |
| 2620 |
| 2621 /** |
| 2622 * The bucket's lifecycle configuration. See lifecycle management for more |
| 2623 * information. |
| 2624 */ |
| 2625 class BucketLifecycle { |
| 2626 /** |
| 2627 * A lifecycle management rule, which is made of an action to take and the |
| 2628 * condition(s) under which the action will be taken. |
| 2629 */ |
| 2630 core.List<BucketLifecycleRule> rule; |
| 2631 |
| 2632 |
| 2633 BucketLifecycle(); |
| 2634 |
| 2635 BucketLifecycle.fromJson(core.Map _json) { |
| 2636 if (_json.containsKey("rule")) { |
| 2637 rule = _json["rule"].map((value) => new BucketLifecycleRule.fromJson(value
)).toList(); |
| 2638 } |
| 2639 } |
| 2640 |
| 2641 core.Map toJson() { |
| 2642 var _json = new core.Map(); |
| 2643 if (rule != null) { |
| 2644 _json["rule"] = rule.map((value) => (value).toJson()).toList(); |
| 2645 } |
| 2646 return _json; |
| 2647 } |
| 2648 } |
| 2649 |
| 2650 |
| 2651 /** |
| 2652 * The bucket's logging configuration, which defines the destination bucket and |
| 2653 * optional name prefix for the current bucket's logs. |
| 2654 */ |
| 2655 class BucketLogging { |
| 2656 /** |
| 2657 * The destination bucket where the current bucket's logs should be placed. |
| 2658 */ |
| 2659 core.String logBucket; |
| 2660 |
| 2661 /** A prefix for log object names. */ |
| 2662 core.String logObjectPrefix; |
| 2663 |
| 2664 |
| 2665 BucketLogging(); |
| 2666 |
| 2667 BucketLogging.fromJson(core.Map _json) { |
| 2668 if (_json.containsKey("logBucket")) { |
| 2669 logBucket = _json["logBucket"]; |
| 2670 } |
| 2671 if (_json.containsKey("logObjectPrefix")) { |
| 2672 logObjectPrefix = _json["logObjectPrefix"]; |
| 2673 } |
| 2674 } |
| 2675 |
| 2676 core.Map toJson() { |
| 2677 var _json = new core.Map(); |
| 2678 if (logBucket != null) { |
| 2679 _json["logBucket"] = logBucket; |
| 2680 } |
| 2681 if (logObjectPrefix != null) { |
| 2682 _json["logObjectPrefix"] = logObjectPrefix; |
| 2683 } |
| 2684 return _json; |
| 2685 } |
| 2686 } |
| 2687 |
| 2688 |
| 2689 /** The owner of the bucket. This is always the project team's owner group. */ |
| 2690 class BucketOwner { |
| 2691 /** The entity, in the form project-owner-projectId. */ |
| 2692 core.String entity; |
| 2693 |
| 2694 /** The ID for the entity. */ |
| 2695 core.String entityId; |
| 2696 |
| 2697 |
| 2698 BucketOwner(); |
| 2699 |
| 2700 BucketOwner.fromJson(core.Map _json) { |
| 2701 if (_json.containsKey("entity")) { |
| 2702 entity = _json["entity"]; |
| 2703 } |
| 2704 if (_json.containsKey("entityId")) { |
| 2705 entityId = _json["entityId"]; |
| 2706 } |
| 2707 } |
| 2708 |
| 2709 core.Map toJson() { |
| 2710 var _json = new core.Map(); |
| 2711 if (entity != null) { |
| 2712 _json["entity"] = entity; |
| 2713 } |
| 2714 if (entityId != null) { |
| 2715 _json["entityId"] = entityId; |
| 2716 } |
| 2717 return _json; |
| 2718 } |
| 2719 } |
| 2720 |
| 2721 |
| 2722 /** The bucket's versioning configuration. */ |
| 2723 class BucketVersioning { |
| 2724 /** While set to true, versioning is fully enabled for this bucket. */ |
| 2725 core.bool enabled; |
| 2726 |
| 2727 |
| 2728 BucketVersioning(); |
| 2729 |
| 2730 BucketVersioning.fromJson(core.Map _json) { |
| 2731 if (_json.containsKey("enabled")) { |
| 2732 enabled = _json["enabled"]; |
| 2733 } |
| 2734 } |
| 2735 |
| 2736 core.Map toJson() { |
| 2737 var _json = new core.Map(); |
| 2738 if (enabled != null) { |
| 2739 _json["enabled"] = enabled; |
| 2740 } |
| 2741 return _json; |
| 2742 } |
| 2743 } |
| 2744 |
| 2745 |
| 2746 /** The bucket's website configuration. */ |
| 2747 class BucketWebsite { |
| 2748 /** |
| 2749 * Behaves as the bucket's directory index where missing objects are treated |
| 2750 * as potential directories. |
| 2751 */ |
| 2752 core.String mainPageSuffix; |
| 2753 |
| 2754 /** The custom object to return when a requested resource is not found. */ |
| 2755 core.String notFoundPage; |
| 2756 |
| 2757 |
| 2758 BucketWebsite(); |
| 2759 |
| 2760 BucketWebsite.fromJson(core.Map _json) { |
| 2761 if (_json.containsKey("mainPageSuffix")) { |
| 2762 mainPageSuffix = _json["mainPageSuffix"]; |
| 2763 } |
| 2764 if (_json.containsKey("notFoundPage")) { |
| 2765 notFoundPage = _json["notFoundPage"]; |
| 2766 } |
| 2767 } |
| 2768 |
| 2769 core.Map toJson() { |
| 2770 var _json = new core.Map(); |
| 2771 if (mainPageSuffix != null) { |
| 2772 _json["mainPageSuffix"] = mainPageSuffix; |
| 2773 } |
| 2774 if (notFoundPage != null) { |
| 2775 _json["notFoundPage"] = notFoundPage; |
| 2776 } |
| 2777 return _json; |
| 2778 } |
| 2779 } |
| 2780 |
| 2781 |
| 2782 /** A bucket. */ |
| 2783 class Bucket { |
| 2784 /** Access controls on the bucket. */ |
| 2785 core.List<BucketAccessControl> acl; |
| 2786 |
| 2787 /** The bucket's Cross-Origin Resource Sharing (CORS) configuration. */ |
| 2788 core.List<BucketCors> cors; |
| 2789 |
| 2790 /** |
| 2791 * Default access controls to apply to new objects when no ACL is provided. |
| 2792 */ |
| 2793 core.List<ObjectAccessControl> defaultObjectAcl; |
| 2794 |
| 2795 /** HTTP 1.1 Entity tag for the bucket. */ |
| 2796 core.String etag; |
| 2797 |
| 2798 /** The ID of the bucket. */ |
| 2799 core.String id; |
| 2800 |
| 2801 /** The kind of item this is. For buckets, this is always storage#bucket. */ |
| 2802 core.String kind; |
| 2803 |
| 2804 /** |
| 2805 * The bucket's lifecycle configuration. See lifecycle management for more |
| 2806 * information. |
| 2807 */ |
| 2808 BucketLifecycle lifecycle; |
| 2809 |
| 2810 /** |
| 2811 * The location of the bucket. Object data for objects in the bucket resides |
| 2812 * in physical storage within this region. Defaults to US. See the developer's |
| 2813 * guide for the authoritative list. |
| 2814 */ |
| 2815 core.String location; |
| 2816 |
| 2817 /** |
| 2818 * The bucket's logging configuration, which defines the destination bucket |
| 2819 * and optional name prefix for the current bucket's logs. |
| 2820 */ |
| 2821 BucketLogging logging; |
| 2822 |
| 2823 /** The metadata generation of this bucket. */ |
| 2824 core.String metageneration; |
| 2825 |
| 2826 /** The name of the bucket. */ |
| 2827 core.String name; |
| 2828 |
| 2829 /** |
| 2830 * The owner of the bucket. This is always the project team's owner group. |
| 2831 */ |
| 2832 BucketOwner owner; |
| 2833 |
| 2834 /** The project number of the project the bucket belongs to. */ |
| 2835 core.String projectNumber; |
| 2836 |
| 2837 /** The URI of this bucket. */ |
| 2838 core.String selfLink; |
| 2839 |
| 2840 /** |
| 2841 * The bucket's storage class. This defines how objects in the bucket are |
| 2842 * stored and determines the SLA and the cost of storage. Typical values are |
| 2843 * STANDARD and DURABLE_REDUCED_AVAILABILITY. Defaults to STANDARD. See the |
| 2844 * developer's guide for the authoritative list. |
| 2845 */ |
| 2846 core.String storageClass; |
| 2847 |
| 2848 /** Creation time of the bucket in RFC 3339 format. */ |
| 2849 core.DateTime timeCreated; |
| 2850 |
| 2851 /** The bucket's versioning configuration. */ |
| 2852 BucketVersioning versioning; |
| 2853 |
| 2854 /** The bucket's website configuration. */ |
| 2855 BucketWebsite website; |
| 2856 |
| 2857 |
| 2858 Bucket(); |
| 2859 |
| 2860 Bucket.fromJson(core.Map _json) { |
| 2861 if (_json.containsKey("acl")) { |
| 2862 acl = _json["acl"].map((value) => new BucketAccessControl.fromJson(value))
.toList(); |
| 2863 } |
| 2864 if (_json.containsKey("cors")) { |
| 2865 cors = _json["cors"].map((value) => new BucketCors.fromJson(value)).toList
(); |
| 2866 } |
| 2867 if (_json.containsKey("defaultObjectAcl")) { |
| 2868 defaultObjectAcl = _json["defaultObjectAcl"].map((value) => new ObjectAcce
ssControl.fromJson(value)).toList(); |
| 2869 } |
| 2870 if (_json.containsKey("etag")) { |
| 2871 etag = _json["etag"]; |
| 2872 } |
| 2873 if (_json.containsKey("id")) { |
| 2874 id = _json["id"]; |
| 2875 } |
| 2876 if (_json.containsKey("kind")) { |
| 2877 kind = _json["kind"]; |
| 2878 } |
| 2879 if (_json.containsKey("lifecycle")) { |
| 2880 lifecycle = new BucketLifecycle.fromJson(_json["lifecycle"]); |
| 2881 } |
| 2882 if (_json.containsKey("location")) { |
| 2883 location = _json["location"]; |
| 2884 } |
| 2885 if (_json.containsKey("logging")) { |
| 2886 logging = new BucketLogging.fromJson(_json["logging"]); |
| 2887 } |
| 2888 if (_json.containsKey("metageneration")) { |
| 2889 metageneration = _json["metageneration"]; |
| 2890 } |
| 2891 if (_json.containsKey("name")) { |
| 2892 name = _json["name"]; |
| 2893 } |
| 2894 if (_json.containsKey("owner")) { |
| 2895 owner = new BucketOwner.fromJson(_json["owner"]); |
| 2896 } |
| 2897 if (_json.containsKey("projectNumber")) { |
| 2898 projectNumber = _json["projectNumber"]; |
| 2899 } |
| 2900 if (_json.containsKey("selfLink")) { |
| 2901 selfLink = _json["selfLink"]; |
| 2902 } |
| 2903 if (_json.containsKey("storageClass")) { |
| 2904 storageClass = _json["storageClass"]; |
| 2905 } |
| 2906 if (_json.containsKey("timeCreated")) { |
| 2907 timeCreated = core.DateTime.parse(_json["timeCreated"]); |
| 2908 } |
| 2909 if (_json.containsKey("versioning")) { |
| 2910 versioning = new BucketVersioning.fromJson(_json["versioning"]); |
| 2911 } |
| 2912 if (_json.containsKey("website")) { |
| 2913 website = new BucketWebsite.fromJson(_json["website"]); |
| 2914 } |
| 2915 } |
| 2916 |
| 2917 core.Map toJson() { |
| 2918 var _json = new core.Map(); |
| 2919 if (acl != null) { |
| 2920 _json["acl"] = acl.map((value) => (value).toJson()).toList(); |
| 2921 } |
| 2922 if (cors != null) { |
| 2923 _json["cors"] = cors.map((value) => (value).toJson()).toList(); |
| 2924 } |
| 2925 if (defaultObjectAcl != null) { |
| 2926 _json["defaultObjectAcl"] = defaultObjectAcl.map((value) => (value).toJson
()).toList(); |
| 2927 } |
| 2928 if (etag != null) { |
| 2929 _json["etag"] = etag; |
| 2930 } |
| 2931 if (id != null) { |
| 2932 _json["id"] = id; |
| 2933 } |
| 2934 if (kind != null) { |
| 2935 _json["kind"] = kind; |
| 2936 } |
| 2937 if (lifecycle != null) { |
| 2938 _json["lifecycle"] = (lifecycle).toJson(); |
| 2939 } |
| 2940 if (location != null) { |
| 2941 _json["location"] = location; |
| 2942 } |
| 2943 if (logging != null) { |
| 2944 _json["logging"] = (logging).toJson(); |
| 2945 } |
| 2946 if (metageneration != null) { |
| 2947 _json["metageneration"] = metageneration; |
| 2948 } |
| 2949 if (name != null) { |
| 2950 _json["name"] = name; |
| 2951 } |
| 2952 if (owner != null) { |
| 2953 _json["owner"] = (owner).toJson(); |
| 2954 } |
| 2955 if (projectNumber != null) { |
| 2956 _json["projectNumber"] = projectNumber; |
| 2957 } |
| 2958 if (selfLink != null) { |
| 2959 _json["selfLink"] = selfLink; |
| 2960 } |
| 2961 if (storageClass != null) { |
| 2962 _json["storageClass"] = storageClass; |
| 2963 } |
| 2964 if (timeCreated != null) { |
| 2965 _json["timeCreated"] = (timeCreated).toIso8601String(); |
| 2966 } |
| 2967 if (versioning != null) { |
| 2968 _json["versioning"] = (versioning).toJson(); |
| 2969 } |
| 2970 if (website != null) { |
| 2971 _json["website"] = (website).toJson(); |
| 2972 } |
| 2973 return _json; |
| 2974 } |
| 2975 } |
| 2976 |
| 2977 |
| 2978 /** The project team associated with the entity, if any. */ |
| 2979 class BucketAccessControlProjectTeam { |
| 2980 /** The project number. */ |
| 2981 core.String projectNumber; |
| 2982 |
| 2983 /** The team. Can be owners, editors, or viewers. */ |
| 2984 core.String team; |
| 2985 |
| 2986 |
| 2987 BucketAccessControlProjectTeam(); |
| 2988 |
| 2989 BucketAccessControlProjectTeam.fromJson(core.Map _json) { |
| 2990 if (_json.containsKey("projectNumber")) { |
| 2991 projectNumber = _json["projectNumber"]; |
| 2992 } |
| 2993 if (_json.containsKey("team")) { |
| 2994 team = _json["team"]; |
| 2995 } |
| 2996 } |
| 2997 |
| 2998 core.Map toJson() { |
| 2999 var _json = new core.Map(); |
| 3000 if (projectNumber != null) { |
| 3001 _json["projectNumber"] = projectNumber; |
| 3002 } |
| 3003 if (team != null) { |
| 3004 _json["team"] = team; |
| 3005 } |
| 3006 return _json; |
| 3007 } |
| 3008 } |
| 3009 |
| 3010 |
| 3011 /** An access-control entry. */ |
| 3012 class BucketAccessControl { |
| 3013 /** The name of the bucket. */ |
| 3014 core.String bucket; |
| 3015 |
| 3016 /** The domain associated with the entity, if any. */ |
| 3017 core.String domain; |
| 3018 |
| 3019 /** The email address associated with the entity, if any. */ |
| 3020 core.String email; |
| 3021 |
| 3022 /** |
| 3023 * The entity holding the permission, in one of the following forms: |
| 3024 * - user-userId |
| 3025 * - user-email |
| 3026 * - group-groupId |
| 3027 * - group-email |
| 3028 * - domain-domain |
| 3029 * - project-team-projectId |
| 3030 * - allUsers |
| 3031 * - allAuthenticatedUsers Examples: |
| 3032 * - The user liz@example.com would be user-liz@example.com. |
| 3033 * - The group example@googlegroups.com would be |
| 3034 * group-example@googlegroups.com. |
| 3035 * - To refer to all members of the Google Apps for Business domain |
| 3036 * example.com, the entity would be domain-example.com. |
| 3037 */ |
| 3038 core.String entity; |
| 3039 |
| 3040 /** The ID for the entity, if any. */ |
| 3041 core.String entityId; |
| 3042 |
| 3043 /** HTTP 1.1 Entity tag for the access-control entry. */ |
| 3044 core.String etag; |
| 3045 |
| 3046 /** The ID of the access-control entry. */ |
| 3047 core.String id; |
| 3048 |
| 3049 /** |
| 3050 * The kind of item this is. For bucket access control entries, this is always |
| 3051 * storage#bucketAccessControl. |
| 3052 */ |
| 3053 core.String kind; |
| 3054 |
| 3055 /** The project team associated with the entity, if any. */ |
| 3056 BucketAccessControlProjectTeam projectTeam; |
| 3057 |
| 3058 /** The access permission for the entity. Can be READER, WRITER, or OWNER. */ |
| 3059 core.String role; |
| 3060 |
| 3061 /** The link to this access-control entry. */ |
| 3062 core.String selfLink; |
| 3063 |
| 3064 |
| 3065 BucketAccessControl(); |
| 3066 |
| 3067 BucketAccessControl.fromJson(core.Map _json) { |
| 3068 if (_json.containsKey("bucket")) { |
| 3069 bucket = _json["bucket"]; |
| 3070 } |
| 3071 if (_json.containsKey("domain")) { |
| 3072 domain = _json["domain"]; |
| 3073 } |
| 3074 if (_json.containsKey("email")) { |
| 3075 email = _json["email"]; |
| 3076 } |
| 3077 if (_json.containsKey("entity")) { |
| 3078 entity = _json["entity"]; |
| 3079 } |
| 3080 if (_json.containsKey("entityId")) { |
| 3081 entityId = _json["entityId"]; |
| 3082 } |
| 3083 if (_json.containsKey("etag")) { |
| 3084 etag = _json["etag"]; |
| 3085 } |
| 3086 if (_json.containsKey("id")) { |
| 3087 id = _json["id"]; |
| 3088 } |
| 3089 if (_json.containsKey("kind")) { |
| 3090 kind = _json["kind"]; |
| 3091 } |
| 3092 if (_json.containsKey("projectTeam")) { |
| 3093 projectTeam = new BucketAccessControlProjectTeam.fromJson(_json["projectTe
am"]); |
| 3094 } |
| 3095 if (_json.containsKey("role")) { |
| 3096 role = _json["role"]; |
| 3097 } |
| 3098 if (_json.containsKey("selfLink")) { |
| 3099 selfLink = _json["selfLink"]; |
| 3100 } |
| 3101 } |
| 3102 |
| 3103 core.Map toJson() { |
| 3104 var _json = new core.Map(); |
| 3105 if (bucket != null) { |
| 3106 _json["bucket"] = bucket; |
| 3107 } |
| 3108 if (domain != null) { |
| 3109 _json["domain"] = domain; |
| 3110 } |
| 3111 if (email != null) { |
| 3112 _json["email"] = email; |
| 3113 } |
| 3114 if (entity != null) { |
| 3115 _json["entity"] = entity; |
| 3116 } |
| 3117 if (entityId != null) { |
| 3118 _json["entityId"] = entityId; |
| 3119 } |
| 3120 if (etag != null) { |
| 3121 _json["etag"] = etag; |
| 3122 } |
| 3123 if (id != null) { |
| 3124 _json["id"] = id; |
| 3125 } |
| 3126 if (kind != null) { |
| 3127 _json["kind"] = kind; |
| 3128 } |
| 3129 if (projectTeam != null) { |
| 3130 _json["projectTeam"] = (projectTeam).toJson(); |
| 3131 } |
| 3132 if (role != null) { |
| 3133 _json["role"] = role; |
| 3134 } |
| 3135 if (selfLink != null) { |
| 3136 _json["selfLink"] = selfLink; |
| 3137 } |
| 3138 return _json; |
| 3139 } |
| 3140 } |
| 3141 |
| 3142 |
| 3143 /** An access-control list. */ |
| 3144 class BucketAccessControls { |
| 3145 /** The list of items. */ |
| 3146 core.List<BucketAccessControl> items; |
| 3147 |
| 3148 /** |
| 3149 * The kind of item this is. For lists of bucket access control entries, this |
| 3150 * is always storage#bucketAccessControls. |
| 3151 */ |
| 3152 core.String kind; |
| 3153 |
| 3154 |
| 3155 BucketAccessControls(); |
| 3156 |
| 3157 BucketAccessControls.fromJson(core.Map _json) { |
| 3158 if (_json.containsKey("items")) { |
| 3159 items = _json["items"].map((value) => new BucketAccessControl.fromJson(val
ue)).toList(); |
| 3160 } |
| 3161 if (_json.containsKey("kind")) { |
| 3162 kind = _json["kind"]; |
| 3163 } |
| 3164 } |
| 3165 |
| 3166 core.Map toJson() { |
| 3167 var _json = new core.Map(); |
| 3168 if (items != null) { |
| 3169 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 3170 } |
| 3171 if (kind != null) { |
| 3172 _json["kind"] = kind; |
| 3173 } |
| 3174 return _json; |
| 3175 } |
| 3176 } |
| 3177 |
| 3178 |
| 3179 /** A list of buckets. */ |
| 3180 class Buckets { |
| 3181 /** The list of items. */ |
| 3182 core.List<Bucket> items; |
| 3183 |
| 3184 /** |
| 3185 * The kind of item this is. For lists of buckets, this is always |
| 3186 * storage#buckets. |
| 3187 */ |
| 3188 core.String kind; |
| 3189 |
| 3190 /** |
| 3191 * The continuation token, used to page through large result sets. Provide |
| 3192 * this value in a subsequent request to return the next page of results. |
| 3193 */ |
| 3194 core.String nextPageToken; |
| 3195 |
| 3196 |
| 3197 Buckets(); |
| 3198 |
| 3199 Buckets.fromJson(core.Map _json) { |
| 3200 if (_json.containsKey("items")) { |
| 3201 items = _json["items"].map((value) => new Bucket.fromJson(value)).toList()
; |
| 3202 } |
| 3203 if (_json.containsKey("kind")) { |
| 3204 kind = _json["kind"]; |
| 3205 } |
| 3206 if (_json.containsKey("nextPageToken")) { |
| 3207 nextPageToken = _json["nextPageToken"]; |
| 3208 } |
| 3209 } |
| 3210 |
| 3211 core.Map toJson() { |
| 3212 var _json = new core.Map(); |
| 3213 if (items != null) { |
| 3214 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 3215 } |
| 3216 if (kind != null) { |
| 3217 _json["kind"] = kind; |
| 3218 } |
| 3219 if (nextPageToken != null) { |
| 3220 _json["nextPageToken"] = nextPageToken; |
| 3221 } |
| 3222 return _json; |
| 3223 } |
| 3224 } |
| 3225 |
| 3226 |
| 3227 /** An notification channel used to watch for resource changes. */ |
| 3228 class Channel { |
| 3229 /** The address where notifications are delivered for this channel. */ |
| 3230 core.String address; |
| 3231 |
| 3232 /** |
| 3233 * Date and time of notification channel expiration, expressed as a Unix |
| 3234 * timestamp, in milliseconds. Optional. |
| 3235 */ |
| 3236 core.String expiration; |
| 3237 |
| 3238 /** A UUID or similar unique string that identifies this channel. */ |
| 3239 core.String id; |
| 3240 |
| 3241 /** |
| 3242 * Identifies this as a notification channel used to watch for changes to a |
| 3243 * resource. Value: the fixed string "api#channel". |
| 3244 */ |
| 3245 core.String kind; |
| 3246 |
| 3247 /** Additional parameters controlling delivery channel behavior. Optional. */ |
| 3248 core.Map<core.String, core.String> params; |
| 3249 |
| 3250 /** A Boolean value to indicate whether payload is wanted. Optional. */ |
| 3251 core.bool payload; |
| 3252 |
| 3253 /** |
| 3254 * An opaque ID that identifies the resource being watched on this channel. |
| 3255 * Stable across different API versions. |
| 3256 */ |
| 3257 core.String resourceId; |
| 3258 |
| 3259 /** A version-specific identifier for the watched resource. */ |
| 3260 core.String resourceUri; |
| 3261 |
| 3262 /** |
| 3263 * An arbitrary string delivered to the target address with each notification |
| 3264 * delivered over this channel. Optional. |
| 3265 */ |
| 3266 core.String token; |
| 3267 |
| 3268 /** The type of delivery mechanism used for this channel. */ |
| 3269 core.String type; |
| 3270 |
| 3271 |
| 3272 Channel(); |
| 3273 |
| 3274 Channel.fromJson(core.Map _json) { |
| 3275 if (_json.containsKey("address")) { |
| 3276 address = _json["address"]; |
| 3277 } |
| 3278 if (_json.containsKey("expiration")) { |
| 3279 expiration = _json["expiration"]; |
| 3280 } |
| 3281 if (_json.containsKey("id")) { |
| 3282 id = _json["id"]; |
| 3283 } |
| 3284 if (_json.containsKey("kind")) { |
| 3285 kind = _json["kind"]; |
| 3286 } |
| 3287 if (_json.containsKey("params")) { |
| 3288 params = _json["params"]; |
| 3289 } |
| 3290 if (_json.containsKey("payload")) { |
| 3291 payload = _json["payload"]; |
| 3292 } |
| 3293 if (_json.containsKey("resourceId")) { |
| 3294 resourceId = _json["resourceId"]; |
| 3295 } |
| 3296 if (_json.containsKey("resourceUri")) { |
| 3297 resourceUri = _json["resourceUri"]; |
| 3298 } |
| 3299 if (_json.containsKey("token")) { |
| 3300 token = _json["token"]; |
| 3301 } |
| 3302 if (_json.containsKey("type")) { |
| 3303 type = _json["type"]; |
| 3304 } |
| 3305 } |
| 3306 |
| 3307 core.Map toJson() { |
| 3308 var _json = new core.Map(); |
| 3309 if (address != null) { |
| 3310 _json["address"] = address; |
| 3311 } |
| 3312 if (expiration != null) { |
| 3313 _json["expiration"] = expiration; |
| 3314 } |
| 3315 if (id != null) { |
| 3316 _json["id"] = id; |
| 3317 } |
| 3318 if (kind != null) { |
| 3319 _json["kind"] = kind; |
| 3320 } |
| 3321 if (params != null) { |
| 3322 _json["params"] = params; |
| 3323 } |
| 3324 if (payload != null) { |
| 3325 _json["payload"] = payload; |
| 3326 } |
| 3327 if (resourceId != null) { |
| 3328 _json["resourceId"] = resourceId; |
| 3329 } |
| 3330 if (resourceUri != null) { |
| 3331 _json["resourceUri"] = resourceUri; |
| 3332 } |
| 3333 if (token != null) { |
| 3334 _json["token"] = token; |
| 3335 } |
| 3336 if (type != null) { |
| 3337 _json["type"] = type; |
| 3338 } |
| 3339 return _json; |
| 3340 } |
| 3341 } |
| 3342 |
| 3343 |
| 3344 /** Conditions that must be met for this operation to execute. */ |
| 3345 class ComposeRequestSourceObjectsObjectPreconditions { |
| 3346 /** |
| 3347 * Only perform the composition if the generation of the source object that |
| 3348 * would be used matches this value. If this value and a generation are both |
| 3349 * specified, they must be the same value or the call will fail. |
| 3350 */ |
| 3351 core.String ifGenerationMatch; |
| 3352 |
| 3353 |
| 3354 ComposeRequestSourceObjectsObjectPreconditions(); |
| 3355 |
| 3356 ComposeRequestSourceObjectsObjectPreconditions.fromJson(core.Map _json) { |
| 3357 if (_json.containsKey("ifGenerationMatch")) { |
| 3358 ifGenerationMatch = _json["ifGenerationMatch"]; |
| 3359 } |
| 3360 } |
| 3361 |
| 3362 core.Map toJson() { |
| 3363 var _json = new core.Map(); |
| 3364 if (ifGenerationMatch != null) { |
| 3365 _json["ifGenerationMatch"] = ifGenerationMatch; |
| 3366 } |
| 3367 return _json; |
| 3368 } |
| 3369 } |
| 3370 |
| 3371 |
| 3372 /** Not documented yet. */ |
| 3373 class ComposeRequestSourceObjects { |
| 3374 /** The generation of this object to use as the source. */ |
| 3375 core.String generation; |
| 3376 |
| 3377 /** |
| 3378 * The source object's name. The source object's bucket is implicitly the |
| 3379 * destination bucket. |
| 3380 */ |
| 3381 core.String name; |
| 3382 |
| 3383 /** Conditions that must be met for this operation to execute. */ |
| 3384 ComposeRequestSourceObjectsObjectPreconditions objectPreconditions; |
| 3385 |
| 3386 |
| 3387 ComposeRequestSourceObjects(); |
| 3388 |
| 3389 ComposeRequestSourceObjects.fromJson(core.Map _json) { |
| 3390 if (_json.containsKey("generation")) { |
| 3391 generation = _json["generation"]; |
| 3392 } |
| 3393 if (_json.containsKey("name")) { |
| 3394 name = _json["name"]; |
| 3395 } |
| 3396 if (_json.containsKey("objectPreconditions")) { |
| 3397 objectPreconditions = new ComposeRequestSourceObjectsObjectPreconditions.f
romJson(_json["objectPreconditions"]); |
| 3398 } |
| 3399 } |
| 3400 |
| 3401 core.Map toJson() { |
| 3402 var _json = new core.Map(); |
| 3403 if (generation != null) { |
| 3404 _json["generation"] = generation; |
| 3405 } |
| 3406 if (name != null) { |
| 3407 _json["name"] = name; |
| 3408 } |
| 3409 if (objectPreconditions != null) { |
| 3410 _json["objectPreconditions"] = (objectPreconditions).toJson(); |
| 3411 } |
| 3412 return _json; |
| 3413 } |
| 3414 } |
| 3415 |
| 3416 |
| 3417 /** A Compose request. */ |
| 3418 class ComposeRequest { |
| 3419 /** Properties of the resulting object. */ |
| 3420 Object destination; |
| 3421 |
| 3422 /** The kind of item this is. */ |
| 3423 core.String kind; |
| 3424 |
| 3425 /** |
| 3426 * The list of source objects that will be concatenated into a single object. |
| 3427 */ |
| 3428 core.List<ComposeRequestSourceObjects> sourceObjects; |
| 3429 |
| 3430 |
| 3431 ComposeRequest(); |
| 3432 |
| 3433 ComposeRequest.fromJson(core.Map _json) { |
| 3434 if (_json.containsKey("destination")) { |
| 3435 destination = new Object.fromJson(_json["destination"]); |
| 3436 } |
| 3437 if (_json.containsKey("kind")) { |
| 3438 kind = _json["kind"]; |
| 3439 } |
| 3440 if (_json.containsKey("sourceObjects")) { |
| 3441 sourceObjects = _json["sourceObjects"].map((value) => new ComposeRequestSo
urceObjects.fromJson(value)).toList(); |
| 3442 } |
| 3443 } |
| 3444 |
| 3445 core.Map toJson() { |
| 3446 var _json = new core.Map(); |
| 3447 if (destination != null) { |
| 3448 _json["destination"] = (destination).toJson(); |
| 3449 } |
| 3450 if (kind != null) { |
| 3451 _json["kind"] = kind; |
| 3452 } |
| 3453 if (sourceObjects != null) { |
| 3454 _json["sourceObjects"] = sourceObjects.map((value) => (value).toJson()).to
List(); |
| 3455 } |
| 3456 return _json; |
| 3457 } |
| 3458 } |
| 3459 |
| 3460 |
| 3461 /** The owner of the object. This will always be the uploader of the object. */ |
| 3462 class ObjectOwner { |
| 3463 /** The entity, in the form user-userId. */ |
| 3464 core.String entity; |
| 3465 |
| 3466 /** The ID for the entity. */ |
| 3467 core.String entityId; |
| 3468 |
| 3469 |
| 3470 ObjectOwner(); |
| 3471 |
| 3472 ObjectOwner.fromJson(core.Map _json) { |
| 3473 if (_json.containsKey("entity")) { |
| 3474 entity = _json["entity"]; |
| 3475 } |
| 3476 if (_json.containsKey("entityId")) { |
| 3477 entityId = _json["entityId"]; |
| 3478 } |
| 3479 } |
| 3480 |
| 3481 core.Map toJson() { |
| 3482 var _json = new core.Map(); |
| 3483 if (entity != null) { |
| 3484 _json["entity"] = entity; |
| 3485 } |
| 3486 if (entityId != null) { |
| 3487 _json["entityId"] = entityId; |
| 3488 } |
| 3489 return _json; |
| 3490 } |
| 3491 } |
| 3492 |
| 3493 |
| 3494 /** An object. */ |
| 3495 class Object { |
| 3496 /** Access controls on the object. */ |
| 3497 core.List<ObjectAccessControl> acl; |
| 3498 |
| 3499 /** The name of the bucket containing this object. */ |
| 3500 core.String bucket; |
| 3501 |
| 3502 /** Cache-Control directive for the object data. */ |
| 3503 core.String cacheControl; |
| 3504 |
| 3505 /** |
| 3506 * Number of underlying components that make up this object. Components are |
| 3507 * accumulated by compose operations. |
| 3508 */ |
| 3509 core.int componentCount; |
| 3510 |
| 3511 /** Content-Disposition of the object data. */ |
| 3512 core.String contentDisposition; |
| 3513 |
| 3514 /** Content-Encoding of the object data. */ |
| 3515 core.String contentEncoding; |
| 3516 |
| 3517 /** Content-Language of the object data. */ |
| 3518 core.String contentLanguage; |
| 3519 |
| 3520 /** Content-Type of the object data. */ |
| 3521 core.String contentType; |
| 3522 |
| 3523 /** |
| 3524 * CRC32c checksum, as described in RFC 4960, Appendix B; encoded using |
| 3525 * base64. |
| 3526 */ |
| 3527 core.String crc32c; |
| 3528 |
| 3529 /** HTTP 1.1 Entity tag for the object. */ |
| 3530 core.String etag; |
| 3531 |
| 3532 /** The content generation of this object. Used for object versioning. */ |
| 3533 core.String generation; |
| 3534 |
| 3535 /** The ID of the object. */ |
| 3536 core.String id; |
| 3537 |
| 3538 /** The kind of item this is. For objects, this is always storage#object. */ |
| 3539 core.String kind; |
| 3540 |
| 3541 /** MD5 hash of the data; encoded using base64. */ |
| 3542 core.String md5Hash; |
| 3543 |
| 3544 /** Media download link. */ |
| 3545 core.String mediaLink; |
| 3546 |
| 3547 /** User-provided metadata, in key/value pairs. */ |
| 3548 core.Map<core.String, core.String> metadata; |
| 3549 |
| 3550 /** |
| 3551 * The version of the metadata for this object at this generation. Used for |
| 3552 * preconditions and for detecting changes in metadata. A metageneration |
| 3553 * number is only meaningful in the context of a particular generation of a |
| 3554 * particular object. |
| 3555 */ |
| 3556 core.String metageneration; |
| 3557 |
| 3558 /** The name of this object. Required if not specified by URL parameter. */ |
| 3559 core.String name; |
| 3560 |
| 3561 /** |
| 3562 * The owner of the object. This will always be the uploader of the object. |
| 3563 */ |
| 3564 ObjectOwner owner; |
| 3565 |
| 3566 /** The link to this object. */ |
| 3567 core.String selfLink; |
| 3568 |
| 3569 /** Content-Length of the data in bytes. */ |
| 3570 core.String size; |
| 3571 |
| 3572 /** Storage class of the object. */ |
| 3573 core.String storageClass; |
| 3574 |
| 3575 /** |
| 3576 * The deletion time of the object in RFC 3339 format. Will be returned if and |
| 3577 * only if this version of the object has been deleted. |
| 3578 */ |
| 3579 core.DateTime timeDeleted; |
| 3580 |
| 3581 /** |
| 3582 * The creation or modification time of the object in RFC 3339 format. For |
| 3583 * buckets with versioning enabled, changing an object's metadata does not |
| 3584 * change this property. |
| 3585 */ |
| 3586 core.DateTime updated; |
| 3587 |
| 3588 |
| 3589 Object(); |
| 3590 |
| 3591 Object.fromJson(core.Map _json) { |
| 3592 if (_json.containsKey("acl")) { |
| 3593 acl = _json["acl"].map((value) => new ObjectAccessControl.fromJson(value))
.toList(); |
| 3594 } |
| 3595 if (_json.containsKey("bucket")) { |
| 3596 bucket = _json["bucket"]; |
| 3597 } |
| 3598 if (_json.containsKey("cacheControl")) { |
| 3599 cacheControl = _json["cacheControl"]; |
| 3600 } |
| 3601 if (_json.containsKey("componentCount")) { |
| 3602 componentCount = _json["componentCount"]; |
| 3603 } |
| 3604 if (_json.containsKey("contentDisposition")) { |
| 3605 contentDisposition = _json["contentDisposition"]; |
| 3606 } |
| 3607 if (_json.containsKey("contentEncoding")) { |
| 3608 contentEncoding = _json["contentEncoding"]; |
| 3609 } |
| 3610 if (_json.containsKey("contentLanguage")) { |
| 3611 contentLanguage = _json["contentLanguage"]; |
| 3612 } |
| 3613 if (_json.containsKey("contentType")) { |
| 3614 contentType = _json["contentType"]; |
| 3615 } |
| 3616 if (_json.containsKey("crc32c")) { |
| 3617 crc32c = _json["crc32c"]; |
| 3618 } |
| 3619 if (_json.containsKey("etag")) { |
| 3620 etag = _json["etag"]; |
| 3621 } |
| 3622 if (_json.containsKey("generation")) { |
| 3623 generation = _json["generation"]; |
| 3624 } |
| 3625 if (_json.containsKey("id")) { |
| 3626 id = _json["id"]; |
| 3627 } |
| 3628 if (_json.containsKey("kind")) { |
| 3629 kind = _json["kind"]; |
| 3630 } |
| 3631 if (_json.containsKey("md5Hash")) { |
| 3632 md5Hash = _json["md5Hash"]; |
| 3633 } |
| 3634 if (_json.containsKey("mediaLink")) { |
| 3635 mediaLink = _json["mediaLink"]; |
| 3636 } |
| 3637 if (_json.containsKey("metadata")) { |
| 3638 metadata = _json["metadata"]; |
| 3639 } |
| 3640 if (_json.containsKey("metageneration")) { |
| 3641 metageneration = _json["metageneration"]; |
| 3642 } |
| 3643 if (_json.containsKey("name")) { |
| 3644 name = _json["name"]; |
| 3645 } |
| 3646 if (_json.containsKey("owner")) { |
| 3647 owner = new ObjectOwner.fromJson(_json["owner"]); |
| 3648 } |
| 3649 if (_json.containsKey("selfLink")) { |
| 3650 selfLink = _json["selfLink"]; |
| 3651 } |
| 3652 if (_json.containsKey("size")) { |
| 3653 size = _json["size"]; |
| 3654 } |
| 3655 if (_json.containsKey("storageClass")) { |
| 3656 storageClass = _json["storageClass"]; |
| 3657 } |
| 3658 if (_json.containsKey("timeDeleted")) { |
| 3659 timeDeleted = core.DateTime.parse(_json["timeDeleted"]); |
| 3660 } |
| 3661 if (_json.containsKey("updated")) { |
| 3662 updated = core.DateTime.parse(_json["updated"]); |
| 3663 } |
| 3664 } |
| 3665 |
| 3666 core.Map toJson() { |
| 3667 var _json = new core.Map(); |
| 3668 if (acl != null) { |
| 3669 _json["acl"] = acl.map((value) => (value).toJson()).toList(); |
| 3670 } |
| 3671 if (bucket != null) { |
| 3672 _json["bucket"] = bucket; |
| 3673 } |
| 3674 if (cacheControl != null) { |
| 3675 _json["cacheControl"] = cacheControl; |
| 3676 } |
| 3677 if (componentCount != null) { |
| 3678 _json["componentCount"] = componentCount; |
| 3679 } |
| 3680 if (contentDisposition != null) { |
| 3681 _json["contentDisposition"] = contentDisposition; |
| 3682 } |
| 3683 if (contentEncoding != null) { |
| 3684 _json["contentEncoding"] = contentEncoding; |
| 3685 } |
| 3686 if (contentLanguage != null) { |
| 3687 _json["contentLanguage"] = contentLanguage; |
| 3688 } |
| 3689 if (contentType != null) { |
| 3690 _json["contentType"] = contentType; |
| 3691 } |
| 3692 if (crc32c != null) { |
| 3693 _json["crc32c"] = crc32c; |
| 3694 } |
| 3695 if (etag != null) { |
| 3696 _json["etag"] = etag; |
| 3697 } |
| 3698 if (generation != null) { |
| 3699 _json["generation"] = generation; |
| 3700 } |
| 3701 if (id != null) { |
| 3702 _json["id"] = id; |
| 3703 } |
| 3704 if (kind != null) { |
| 3705 _json["kind"] = kind; |
| 3706 } |
| 3707 if (md5Hash != null) { |
| 3708 _json["md5Hash"] = md5Hash; |
| 3709 } |
| 3710 if (mediaLink != null) { |
| 3711 _json["mediaLink"] = mediaLink; |
| 3712 } |
| 3713 if (metadata != null) { |
| 3714 _json["metadata"] = metadata; |
| 3715 } |
| 3716 if (metageneration != null) { |
| 3717 _json["metageneration"] = metageneration; |
| 3718 } |
| 3719 if (name != null) { |
| 3720 _json["name"] = name; |
| 3721 } |
| 3722 if (owner != null) { |
| 3723 _json["owner"] = (owner).toJson(); |
| 3724 } |
| 3725 if (selfLink != null) { |
| 3726 _json["selfLink"] = selfLink; |
| 3727 } |
| 3728 if (size != null) { |
| 3729 _json["size"] = size; |
| 3730 } |
| 3731 if (storageClass != null) { |
| 3732 _json["storageClass"] = storageClass; |
| 3733 } |
| 3734 if (timeDeleted != null) { |
| 3735 _json["timeDeleted"] = (timeDeleted).toIso8601String(); |
| 3736 } |
| 3737 if (updated != null) { |
| 3738 _json["updated"] = (updated).toIso8601String(); |
| 3739 } |
| 3740 return _json; |
| 3741 } |
| 3742 } |
| 3743 |
| 3744 |
| 3745 /** The project team associated with the entity, if any. */ |
| 3746 class ObjectAccessControlProjectTeam { |
| 3747 /** The project number. */ |
| 3748 core.String projectNumber; |
| 3749 |
| 3750 /** The team. Can be owners, editors, or viewers. */ |
| 3751 core.String team; |
| 3752 |
| 3753 |
| 3754 ObjectAccessControlProjectTeam(); |
| 3755 |
| 3756 ObjectAccessControlProjectTeam.fromJson(core.Map _json) { |
| 3757 if (_json.containsKey("projectNumber")) { |
| 3758 projectNumber = _json["projectNumber"]; |
| 3759 } |
| 3760 if (_json.containsKey("team")) { |
| 3761 team = _json["team"]; |
| 3762 } |
| 3763 } |
| 3764 |
| 3765 core.Map toJson() { |
| 3766 var _json = new core.Map(); |
| 3767 if (projectNumber != null) { |
| 3768 _json["projectNumber"] = projectNumber; |
| 3769 } |
| 3770 if (team != null) { |
| 3771 _json["team"] = team; |
| 3772 } |
| 3773 return _json; |
| 3774 } |
| 3775 } |
| 3776 |
| 3777 |
| 3778 /** An access-control entry. */ |
| 3779 class ObjectAccessControl { |
| 3780 /** The name of the bucket. */ |
| 3781 core.String bucket; |
| 3782 |
| 3783 /** The domain associated with the entity, if any. */ |
| 3784 core.String domain; |
| 3785 |
| 3786 /** The email address associated with the entity, if any. */ |
| 3787 core.String email; |
| 3788 |
| 3789 /** |
| 3790 * The entity holding the permission, in one of the following forms: |
| 3791 * - user-userId |
| 3792 * - user-email |
| 3793 * - group-groupId |
| 3794 * - group-email |
| 3795 * - domain-domain |
| 3796 * - project-team-projectId |
| 3797 * - allUsers |
| 3798 * - allAuthenticatedUsers Examples: |
| 3799 * - The user liz@example.com would be user-liz@example.com. |
| 3800 * - The group example@googlegroups.com would be |
| 3801 * group-example@googlegroups.com. |
| 3802 * - To refer to all members of the Google Apps for Business domain |
| 3803 * example.com, the entity would be domain-example.com. |
| 3804 */ |
| 3805 core.String entity; |
| 3806 |
| 3807 /** The ID for the entity, if any. */ |
| 3808 core.String entityId; |
| 3809 |
| 3810 /** HTTP 1.1 Entity tag for the access-control entry. */ |
| 3811 core.String etag; |
| 3812 |
| 3813 /** The content generation of the object. */ |
| 3814 core.String generation; |
| 3815 |
| 3816 /** The ID of the access-control entry. */ |
| 3817 core.String id; |
| 3818 |
| 3819 /** |
| 3820 * The kind of item this is. For object access control entries, this is always |
| 3821 * storage#objectAccessControl. |
| 3822 */ |
| 3823 core.String kind; |
| 3824 |
| 3825 /** The name of the object. */ |
| 3826 core.String object; |
| 3827 |
| 3828 /** The project team associated with the entity, if any. */ |
| 3829 ObjectAccessControlProjectTeam projectTeam; |
| 3830 |
| 3831 /** The access permission for the entity. Can be READER or OWNER. */ |
| 3832 core.String role; |
| 3833 |
| 3834 /** The link to this access-control entry. */ |
| 3835 core.String selfLink; |
| 3836 |
| 3837 |
| 3838 ObjectAccessControl(); |
| 3839 |
| 3840 ObjectAccessControl.fromJson(core.Map _json) { |
| 3841 if (_json.containsKey("bucket")) { |
| 3842 bucket = _json["bucket"]; |
| 3843 } |
| 3844 if (_json.containsKey("domain")) { |
| 3845 domain = _json["domain"]; |
| 3846 } |
| 3847 if (_json.containsKey("email")) { |
| 3848 email = _json["email"]; |
| 3849 } |
| 3850 if (_json.containsKey("entity")) { |
| 3851 entity = _json["entity"]; |
| 3852 } |
| 3853 if (_json.containsKey("entityId")) { |
| 3854 entityId = _json["entityId"]; |
| 3855 } |
| 3856 if (_json.containsKey("etag")) { |
| 3857 etag = _json["etag"]; |
| 3858 } |
| 3859 if (_json.containsKey("generation")) { |
| 3860 generation = _json["generation"]; |
| 3861 } |
| 3862 if (_json.containsKey("id")) { |
| 3863 id = _json["id"]; |
| 3864 } |
| 3865 if (_json.containsKey("kind")) { |
| 3866 kind = _json["kind"]; |
| 3867 } |
| 3868 if (_json.containsKey("object")) { |
| 3869 object = _json["object"]; |
| 3870 } |
| 3871 if (_json.containsKey("projectTeam")) { |
| 3872 projectTeam = new ObjectAccessControlProjectTeam.fromJson(_json["projectTe
am"]); |
| 3873 } |
| 3874 if (_json.containsKey("role")) { |
| 3875 role = _json["role"]; |
| 3876 } |
| 3877 if (_json.containsKey("selfLink")) { |
| 3878 selfLink = _json["selfLink"]; |
| 3879 } |
| 3880 } |
| 3881 |
| 3882 core.Map toJson() { |
| 3883 var _json = new core.Map(); |
| 3884 if (bucket != null) { |
| 3885 _json["bucket"] = bucket; |
| 3886 } |
| 3887 if (domain != null) { |
| 3888 _json["domain"] = domain; |
| 3889 } |
| 3890 if (email != null) { |
| 3891 _json["email"] = email; |
| 3892 } |
| 3893 if (entity != null) { |
| 3894 _json["entity"] = entity; |
| 3895 } |
| 3896 if (entityId != null) { |
| 3897 _json["entityId"] = entityId; |
| 3898 } |
| 3899 if (etag != null) { |
| 3900 _json["etag"] = etag; |
| 3901 } |
| 3902 if (generation != null) { |
| 3903 _json["generation"] = generation; |
| 3904 } |
| 3905 if (id != null) { |
| 3906 _json["id"] = id; |
| 3907 } |
| 3908 if (kind != null) { |
| 3909 _json["kind"] = kind; |
| 3910 } |
| 3911 if (object != null) { |
| 3912 _json["object"] = object; |
| 3913 } |
| 3914 if (projectTeam != null) { |
| 3915 _json["projectTeam"] = (projectTeam).toJson(); |
| 3916 } |
| 3917 if (role != null) { |
| 3918 _json["role"] = role; |
| 3919 } |
| 3920 if (selfLink != null) { |
| 3921 _json["selfLink"] = selfLink; |
| 3922 } |
| 3923 return _json; |
| 3924 } |
| 3925 } |
| 3926 |
| 3927 |
| 3928 /** An access-control list. */ |
| 3929 class ObjectAccessControls { |
| 3930 /** |
| 3931 * The list of items. |
| 3932 * |
| 3933 * The values for Object must be JSON objects. It can consist of `num`, |
| 3934 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 3935 */ |
| 3936 core.List<core.Object> items; |
| 3937 |
| 3938 /** |
| 3939 * The kind of item this is. For lists of object access control entries, this |
| 3940 * is always storage#objectAccessControls. |
| 3941 */ |
| 3942 core.String kind; |
| 3943 |
| 3944 |
| 3945 ObjectAccessControls(); |
| 3946 |
| 3947 ObjectAccessControls.fromJson(core.Map _json) { |
| 3948 if (_json.containsKey("items")) { |
| 3949 items = _json["items"]; |
| 3950 } |
| 3951 if (_json.containsKey("kind")) { |
| 3952 kind = _json["kind"]; |
| 3953 } |
| 3954 } |
| 3955 |
| 3956 core.Map toJson() { |
| 3957 var _json = new core.Map(); |
| 3958 if (items != null) { |
| 3959 _json["items"] = items; |
| 3960 } |
| 3961 if (kind != null) { |
| 3962 _json["kind"] = kind; |
| 3963 } |
| 3964 return _json; |
| 3965 } |
| 3966 } |
| 3967 |
| 3968 |
| 3969 /** A list of objects. */ |
| 3970 class Objects { |
| 3971 /** The list of items. */ |
| 3972 core.List<Object> items; |
| 3973 |
| 3974 /** |
| 3975 * The kind of item this is. For lists of objects, this is always |
| 3976 * storage#objects. |
| 3977 */ |
| 3978 core.String kind; |
| 3979 |
| 3980 /** |
| 3981 * The continuation token, used to page through large result sets. Provide |
| 3982 * this value in a subsequent request to return the next page of results. |
| 3983 */ |
| 3984 core.String nextPageToken; |
| 3985 |
| 3986 /** |
| 3987 * The list of prefixes of objects matching-but-not-listed up to and including |
| 3988 * the requested delimiter. |
| 3989 */ |
| 3990 core.List<core.String> prefixes; |
| 3991 |
| 3992 |
| 3993 Objects(); |
| 3994 |
| 3995 Objects.fromJson(core.Map _json) { |
| 3996 if (_json.containsKey("items")) { |
| 3997 items = _json["items"].map((value) => new Object.fromJson(value)).toList()
; |
| 3998 } |
| 3999 if (_json.containsKey("kind")) { |
| 4000 kind = _json["kind"]; |
| 4001 } |
| 4002 if (_json.containsKey("nextPageToken")) { |
| 4003 nextPageToken = _json["nextPageToken"]; |
| 4004 } |
| 4005 if (_json.containsKey("prefixes")) { |
| 4006 prefixes = _json["prefixes"]; |
| 4007 } |
| 4008 } |
| 4009 |
| 4010 core.Map toJson() { |
| 4011 var _json = new core.Map(); |
| 4012 if (items != null) { |
| 4013 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 4014 } |
| 4015 if (kind != null) { |
| 4016 _json["kind"] = kind; |
| 4017 } |
| 4018 if (nextPageToken != null) { |
| 4019 _json["nextPageToken"] = nextPageToken; |
| 4020 } |
| 4021 if (prefixes != null) { |
| 4022 _json["prefixes"] = prefixes; |
| 4023 } |
| 4024 return _json; |
| 4025 } |
| 4026 } |
| 4027 |
| 4028 |
OLD | NEW |