aws-sdk-s3 1.96.2 → 1.132.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +256 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-sdk-s3/bucket.rb +226 -76
  5. data/lib/aws-sdk-s3/bucket_acl.rb +30 -7
  6. data/lib/aws-sdk-s3/bucket_cors.rb +35 -10
  7. data/lib/aws-sdk-s3/bucket_lifecycle.rb +39 -12
  8. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +40 -10
  9. data/lib/aws-sdk-s3/bucket_logging.rb +30 -7
  10. data/lib/aws-sdk-s3/bucket_notification.rb +28 -10
  11. data/lib/aws-sdk-s3/bucket_policy.rb +35 -10
  12. data/lib/aws-sdk-s3/bucket_request_payment.rb +30 -7
  13. data/lib/aws-sdk-s3/bucket_tagging.rb +35 -10
  14. data/lib/aws-sdk-s3/bucket_versioning.rb +78 -17
  15. data/lib/aws-sdk-s3/bucket_website.rb +35 -10
  16. data/lib/aws-sdk-s3/client.rb +3854 -2120
  17. data/lib/aws-sdk-s3/client_api.rb +601 -208
  18. data/lib/aws-sdk-s3/customizations/bucket.rb +23 -47
  19. data/lib/aws-sdk-s3/customizations/errors.rb +27 -0
  20. data/lib/aws-sdk-s3/customizations/object.rb +130 -24
  21. data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
  22. data/lib/aws-sdk-s3/customizations.rb +2 -0
  23. data/lib/aws-sdk-s3/encryption/client.rb +7 -3
  24. data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +0 -4
  25. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +13 -9
  26. data/lib/aws-sdk-s3/encryptionV2/client.rb +7 -3
  27. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +1 -4
  28. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +0 -4
  29. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +10 -6
  30. data/lib/aws-sdk-s3/endpoint_parameters.rb +146 -0
  31. data/lib/aws-sdk-s3/endpoint_provider.rb +509 -0
  32. data/lib/aws-sdk-s3/endpoints.rb +2150 -0
  33. data/lib/aws-sdk-s3/file_downloader.rb +57 -27
  34. data/lib/aws-sdk-s3/file_uploader.rb +12 -5
  35. data/lib/aws-sdk-s3/multipart_file_uploader.rb +26 -7
  36. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +41 -13
  37. data/lib/aws-sdk-s3/multipart_upload.rb +138 -16
  38. data/lib/aws-sdk-s3/multipart_upload_part.rb +144 -18
  39. data/lib/aws-sdk-s3/object.rb +364 -160
  40. data/lib/aws-sdk-s3/object_acl.rb +32 -9
  41. data/lib/aws-sdk-s3/object_copier.rb +7 -5
  42. data/lib/aws-sdk-s3/object_multipart_copier.rb +41 -19
  43. data/lib/aws-sdk-s3/object_summary.rb +291 -123
  44. data/lib/aws-sdk-s3/object_version.rb +99 -46
  45. data/lib/aws-sdk-s3/plugins/accelerate.rb +3 -44
  46. data/lib/aws-sdk-s3/plugins/arn.rb +22 -180
  47. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +3 -39
  48. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +1 -6
  49. data/lib/aws-sdk-s3/plugins/dualstack.rb +1 -55
  50. data/lib/aws-sdk-s3/plugins/endpoints.rb +262 -0
  51. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +2 -1
  52. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +6 -29
  53. data/lib/aws-sdk-s3/plugins/md5s.rb +5 -3
  54. data/lib/aws-sdk-s3/plugins/s3_signer.rb +35 -100
  55. data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
  56. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +23 -2
  57. data/lib/aws-sdk-s3/presigned_post.rb +99 -78
  58. data/lib/aws-sdk-s3/presigner.rb +24 -29
  59. data/lib/aws-sdk-s3/resource.rb +25 -3
  60. data/lib/aws-sdk-s3/types.rb +3307 -4625
  61. data/lib/aws-sdk-s3.rb +5 -1
  62. metadata +14 -11
  63. data/lib/aws-sdk-s3/arn/access_point_arn.rb +0 -69
  64. data/lib/aws-sdk-s3/arn/object_lambda_arn.rb +0 -69
  65. data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +0 -73
  66. data/lib/aws-sdk-s3/plugins/object_lambda_endpoint.rb +0 -25
@@ -95,7 +95,9 @@ module Aws::S3
95
95
  options, params = separate_params_and_options(options)
96
96
  waiter = Waiters::BucketExists.new(options)
97
97
  yield_waiter_and_warn(waiter, &block) if block_given?
98
- waiter.wait(params.merge(bucket: @name))
98
+ Aws::Plugins::UserAgent.feature('resource') do
99
+ waiter.wait(params.merge(bucket: @name))
100
+ end
99
101
  Bucket.new({
100
102
  name: @name,
101
103
  client: @client
@@ -112,7 +114,9 @@ module Aws::S3
112
114
  options, params = separate_params_and_options(options)
113
115
  waiter = Waiters::BucketNotExists.new(options)
114
116
  yield_waiter_and_warn(waiter, &block) if block_given?
115
- waiter.wait(params.merge(bucket: @name))
117
+ Aws::Plugins::UserAgent.feature('resource') do
118
+ waiter.wait(params.merge(bucket: @name))
119
+ end
116
120
  Bucket.new({
117
121
  name: @name,
118
122
  client: @client
@@ -213,7 +217,9 @@ module Aws::S3
213
217
  :retry
214
218
  end
215
219
  end
216
- Aws::Waiters::Waiter.new(options).wait({})
220
+ Aws::Plugins::UserAgent.feature('resource') do
221
+ Aws::Waiters::Waiter.new(options).wait({})
222
+ end
217
223
  end
218
224
 
219
225
  # @!group Actions
@@ -223,7 +229,7 @@ module Aws::S3
223
229
  # bucket.create({
224
230
  # acl: "private", # accepts private, public-read, public-read-write, authenticated-read
225
231
  # create_bucket_configuration: {
226
- # location_constraint: "af-south-1", # accepts af-south-1, ap-east-1, ap-northeast-1, ap-northeast-2, ap-northeast-3, ap-south-1, ap-southeast-1, ap-southeast-2, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-north-1, eu-south-1, eu-west-1, eu-west-2, eu-west-3, me-south-1, sa-east-1, us-east-2, us-gov-east-1, us-gov-west-1, us-west-1, us-west-2
232
+ # location_constraint: "af-south-1", # accepts af-south-1, ap-east-1, ap-northeast-1, ap-northeast-2, ap-northeast-3, ap-south-1, ap-southeast-1, ap-southeast-2, ap-southeast-3, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-north-1, eu-south-1, eu-west-1, eu-west-2, eu-west-3, me-south-1, sa-east-1, us-east-2, us-gov-east-1, us-gov-west-1, us-west-1, us-west-2, ap-south-2, eu-south-2
227
233
  # },
228
234
  # grant_full_control: "GrantFullControl",
229
235
  # grant_read: "GrantRead",
@@ -231,6 +237,7 @@ module Aws::S3
231
237
  # grant_write: "GrantWrite",
232
238
  # grant_write_acp: "GrantWriteACP",
233
239
  # object_lock_enabled_for_bucket: false,
240
+ # object_ownership: "BucketOwnerPreferred", # accepts BucketOwnerPreferred, ObjectWriter, BucketOwnerEnforced
234
241
  # })
235
242
  # @param [Hash] options ({})
236
243
  # @option options [String] :acl
@@ -254,10 +261,29 @@ module Aws::S3
254
261
  # @option options [Boolean] :object_lock_enabled_for_bucket
255
262
  # Specifies whether you want S3 Object Lock to be enabled for the new
256
263
  # bucket.
264
+ # @option options [String] :object_ownership
265
+ # The container element for object ownership for a bucket's ownership
266
+ # controls.
267
+ #
268
+ # BucketOwnerPreferred - Objects uploaded to the bucket change ownership
269
+ # to the bucket owner if the objects are uploaded with the
270
+ # `bucket-owner-full-control` canned ACL.
271
+ #
272
+ # ObjectWriter - The uploading account will own the object if the object
273
+ # is uploaded with the `bucket-owner-full-control` canned ACL.
274
+ #
275
+ # BucketOwnerEnforced - Access control lists (ACLs) are disabled and no
276
+ # longer affect permissions. The bucket owner automatically owns and has
277
+ # full control over every object in the bucket. The bucket only accepts
278
+ # PUT requests that don't specify an ACL or bucket owner full control
279
+ # ACLs, such as the `bucket-owner-full-control` canned ACL or an
280
+ # equivalent form of this ACL expressed in the XML format.
257
281
  # @return [Types::CreateBucketOutput]
258
282
  def create(options = {})
259
283
  options = options.merge(bucket: @name)
260
- resp = @client.create_bucket(options)
284
+ resp = Aws::Plugins::UserAgent.feature('resource') do
285
+ @client.create_bucket(options)
286
+ end
261
287
  resp.data
262
288
  end
263
289
 
@@ -269,12 +295,14 @@ module Aws::S3
269
295
  # @param [Hash] options ({})
270
296
  # @option options [String] :expected_bucket_owner
271
297
  # The account ID of the expected bucket owner. If the bucket is owned by
272
- # a different account, the request will fail with an HTTP `403 (Access
273
- # Denied)` error.
298
+ # a different account, the request fails with the HTTP status code `403
299
+ # Forbidden` (access denied).
274
300
  # @return [EmptyStructure]
275
301
  def delete(options = {})
276
302
  options = options.merge(bucket: @name)
277
- resp = @client.delete_bucket(options)
303
+ resp = Aws::Plugins::UserAgent.feature('resource') do
304
+ @client.delete_bucket(options)
305
+ end
278
306
  resp.data
279
307
  end
280
308
 
@@ -294,6 +322,7 @@ module Aws::S3
294
322
  # request_payer: "requester", # accepts requester
295
323
  # bypass_governance_retention: false,
296
324
  # expected_bucket_owner: "AccountId",
325
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
297
326
  # })
298
327
  # @param [Hash] options ({})
299
328
  # @option options [required, Types::Delete] :delete
@@ -306,8 +335,8 @@ module Aws::S3
306
335
  # @option options [String] :request_payer
307
336
  # Confirms that the requester knows that they will be charged for the
308
337
  # request. Bucket owners need not specify this parameter in their
309
- # requests. For information about downloading objects from requester
310
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
338
+ # requests. For information about downloading objects from Requester
339
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
311
340
  # in the *Amazon S3 User Guide*.
312
341
  #
313
342
  #
@@ -315,16 +344,36 @@ module Aws::S3
315
344
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
316
345
  # @option options [Boolean] :bypass_governance_retention
317
346
  # Specifies whether you want to delete this object even if it has a
318
- # Governance-type Object Lock in place. You must have sufficient
319
- # permissions to perform this operation.
347
+ # Governance-type Object Lock in place. To use this header, you must
348
+ # have the `s3:BypassGovernanceRetention` permission.
320
349
  # @option options [String] :expected_bucket_owner
321
350
  # The account ID of the expected bucket owner. If the bucket is owned by
322
- # a different account, the request will fail with an HTTP `403 (Access
323
- # Denied)` error.
351
+ # a different account, the request fails with the HTTP status code `403
352
+ # Forbidden` (access denied).
353
+ # @option options [String] :checksum_algorithm
354
+ # Indicates the algorithm used to create the checksum for the object
355
+ # when using the SDK. This header will not provide any additional
356
+ # functionality if not using the SDK. When sending this header, there
357
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
358
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
359
+ # `400 Bad Request`. For more information, see [Checking object
360
+ # integrity][1] in the *Amazon S3 User Guide*.
361
+ #
362
+ # If you provide an individual checksum, Amazon S3 ignores any provided
363
+ # `ChecksumAlgorithm` parameter.
364
+ #
365
+ # This checksum algorithm must be the same for all parts and it match
366
+ # the checksum value supplied in the `CreateMultipartUpload` request.
367
+ #
368
+ #
369
+ #
370
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
324
371
  # @return [Types::DeleteObjectsOutput]
325
372
  def delete_objects(options = {})
326
373
  options = options.merge(bucket: @name)
327
- resp = @client.delete_objects(options)
374
+ resp = Aws::Plugins::UserAgent.feature('resource') do
375
+ @client.delete_objects(options)
376
+ end
328
377
  resp.data
329
378
  end
330
379
 
@@ -340,6 +389,11 @@ module Aws::S3
340
389
  # content_length: 1,
341
390
  # content_md5: "ContentMD5",
342
391
  # content_type: "ContentType",
392
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
393
+ # checksum_crc32: "ChecksumCRC32",
394
+ # checksum_crc32c: "ChecksumCRC32C",
395
+ # checksum_sha1: "ChecksumSHA1",
396
+ # checksum_sha256: "ChecksumSHA256",
343
397
  # expires: Time.now,
344
398
  # grant_full_control: "GrantFullControl",
345
399
  # grant_read: "GrantRead",
@@ -349,8 +403,8 @@ module Aws::S3
349
403
  # metadata: {
350
404
  # "MetadataKey" => "MetadataValue",
351
405
  # },
352
- # server_side_encryption: "AES256", # accepts AES256, aws:kms
353
- # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE, OUTPOSTS
406
+ # server_side_encryption: "AES256", # accepts AES256, aws:kms, aws:kms:dsse
407
+ # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE, OUTPOSTS, GLACIER_IR, SNOW
354
408
  # website_redirect_location: "WebsiteRedirectLocation",
355
409
  # sse_customer_algorithm: "SSECustomerAlgorithm",
356
410
  # sse_customer_key: "SSECustomerKey",
@@ -388,30 +442,30 @@ module Aws::S3
388
442
  # @option options [String] :content_disposition
389
443
  # Specifies presentational information for the object. For more
390
444
  # information, see
391
- # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1][1].
445
+ # [https://www.rfc-editor.org/rfc/rfc6266#section-4][1].
392
446
  #
393
447
  #
394
448
  #
395
- # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
449
+ # [1]: https://www.rfc-editor.org/rfc/rfc6266#section-4
396
450
  # @option options [String] :content_encoding
397
451
  # Specifies what content encodings have been applied to the object and
398
452
  # thus what decoding mechanisms must be applied to obtain the media-type
399
453
  # referenced by the Content-Type header field. For more information, see
400
- # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11][1].
454
+ # [https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding][1].
401
455
  #
402
456
  #
403
457
  #
404
- # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
458
+ # [1]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding
405
459
  # @option options [String] :content_language
406
460
  # The language the content is in.
407
461
  # @option options [Integer] :content_length
408
462
  # Size of the body in bytes. This parameter is useful when the size of
409
463
  # the body cannot be determined automatically. For more information, see
410
- # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13][1].
464
+ # [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length][1].
411
465
  #
412
466
  #
413
467
  #
414
- # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
468
+ # [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length
415
469
  # @option options [String] :content_md5
416
470
  # The base64-encoded 128-bit MD5 digest of the message (without the
417
471
  # headers) according to RFC 1864. This header can be used as a message
@@ -427,19 +481,74 @@ module Aws::S3
427
481
  # @option options [String] :content_type
428
482
  # A standard MIME type describing the format of the contents. For more
429
483
  # information, see
430
- # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17][1].
484
+ # [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type][1].
485
+ #
486
+ #
487
+ #
488
+ # [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type
489
+ # @option options [String] :checksum_algorithm
490
+ # Indicates the algorithm used to create the checksum for the object
491
+ # when using the SDK. This header will not provide any additional
492
+ # functionality if not using the SDK. When sending this header, there
493
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
494
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
495
+ # `400 Bad Request`. For more information, see [Checking object
496
+ # integrity][1] in the *Amazon S3 User Guide*.
497
+ #
498
+ # If you provide an individual checksum, Amazon S3 ignores any provided
499
+ # `ChecksumAlgorithm` parameter.
500
+ #
501
+ #
502
+ #
503
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
504
+ # @option options [String] :checksum_crc32
505
+ # This header can be used as a data integrity check to verify that the
506
+ # data received is the same data that was originally sent. This header
507
+ # specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
508
+ # more information, see [Checking object integrity][1] in the *Amazon S3
509
+ # User Guide*.
510
+ #
511
+ #
512
+ #
513
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
514
+ # @option options [String] :checksum_crc32c
515
+ # This header can be used as a data integrity check to verify that the
516
+ # data received is the same data that was originally sent. This header
517
+ # specifies the base64-encoded, 32-bit CRC32C checksum of the object.
518
+ # For more information, see [Checking object integrity][1] in the
519
+ # *Amazon S3 User Guide*.
520
+ #
521
+ #
522
+ #
523
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
524
+ # @option options [String] :checksum_sha1
525
+ # This header can be used as a data integrity check to verify that the
526
+ # data received is the same data that was originally sent. This header
527
+ # specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
528
+ # more information, see [Checking object integrity][1] in the *Amazon S3
529
+ # User Guide*.
530
+ #
431
531
  #
432
532
  #
533
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
534
+ # @option options [String] :checksum_sha256
535
+ # This header can be used as a data integrity check to verify that the
536
+ # data received is the same data that was originally sent. This header
537
+ # specifies the base64-encoded, 256-bit SHA-256 digest of the object.
538
+ # For more information, see [Checking object integrity][1] in the
539
+ # *Amazon S3 User Guide*.
433
540
  #
434
- # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
541
+ #
542
+ #
543
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
435
544
  # @option options [Time,DateTime,Date,Integer,String] :expires
436
545
  # The date and time at which the object is no longer cacheable. For more
437
546
  # information, see
438
- # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21][1].
547
+ # [https://www.rfc-editor.org/rfc/rfc7234#section-5.3][1].
439
548
  #
440
549
  #
441
550
  #
442
- # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21
551
+ # [1]: https://www.rfc-editor.org/rfc/rfc7234#section-5.3
443
552
  # @option options [String] :grant_full_control
444
553
  # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
445
554
  # object.
@@ -463,7 +572,7 @@ module Aws::S3
463
572
  # A map of metadata to store with the object in S3.
464
573
  # @option options [String] :server_side_encryption
465
574
  # The server-side encryption algorithm used when storing this object in
466
- # Amazon S3 (for example, AES256, aws:kms).
575
+ # Amazon S3 (for example, `AES256`, `aws:kms`, `aws:kms:dsse`).
467
576
  # @option options [String] :storage_class
468
577
  # By default, Amazon S3 uses the STANDARD Storage Class to store newly
469
578
  # created objects. The STANDARD storage class provides high durability
@@ -514,32 +623,35 @@ module Aws::S3
514
623
  # RFC 1321. Amazon S3 uses this header for a message integrity check to
515
624
  # ensure that the encryption key was transmitted without error.
516
625
  # @option options [String] :ssekms_key_id
517
- # If `x-amz-server-side-encryption` is present and has the value of
518
- # `aws:kms`, this header specifies the ID of the AWS Key Management
519
- # Service (AWS KMS) symmetrical customer managed customer master key
520
- # (CMK) that was used for the object. If you specify
521
- # `x-amz-server-side-encryption:aws:kms`, but do not provide`
522
- # x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the AWS
523
- # managed CMK in AWS to protect the data. If the KMS key does not exist
524
- # in the same account issuing the command, you must use the full ARN and
525
- # not just the ID.
626
+ # If `x-amz-server-side-encryption` has a valid value of `aws:kms` or
627
+ # `aws:kms:dsse`, this header specifies the ID of the Key Management
628
+ # Service (KMS) symmetric encryption customer managed key that was used
629
+ # for the object. If you specify `x-amz-server-side-encryption:aws:kms`
630
+ # or `x-amz-server-side-encryption:aws:kms:dsse`, but do not provide`
631
+ # x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the
632
+ # Amazon Web Services managed key (`aws/s3`) to protect the data. If the
633
+ # KMS key does not exist in the same account that's issuing the
634
+ # command, you must use the full ARN and not just the ID.
526
635
  # @option options [String] :ssekms_encryption_context
527
- # Specifies the AWS KMS Encryption Context to use for object encryption.
528
- # The value of this header is a base64-encoded UTF-8 string holding JSON
529
- # with the encryption context key-value pairs.
636
+ # Specifies the Amazon Web Services KMS Encryption Context to use for
637
+ # object encryption. The value of this header is a base64-encoded UTF-8
638
+ # string holding JSON with the encryption context key-value pairs. This
639
+ # value is stored as object metadata and automatically gets passed on to
640
+ # Amazon Web Services KMS for future `GetObject` or `CopyObject`
641
+ # operations on this object.
530
642
  # @option options [Boolean] :bucket_key_enabled
531
643
  # Specifies whether Amazon S3 should use an S3 Bucket Key for object
532
- # encryption with server-side encryption using AWS KMS (SSE-KMS).
533
- # Setting this header to `true` causes Amazon S3 to use an S3 Bucket Key
534
- # for object encryption with SSE-KMS.
644
+ # encryption with server-side encryption using Key Management Service
645
+ # (KMS) keys (SSE-KMS). Setting this header to `true` causes Amazon S3
646
+ # to use an S3 Bucket Key for object encryption with SSE-KMS.
535
647
  #
536
648
  # Specifying this header with a PUT action doesn’t affect bucket-level
537
649
  # settings for S3 Bucket Key.
538
650
  # @option options [String] :request_payer
539
651
  # Confirms that the requester knows that they will be charged for the
540
652
  # request. Bucket owners need not specify this parameter in their
541
- # requests. For information about downloading objects from requester
542
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
653
+ # requests. For information about downloading objects from Requester
654
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
543
655
  # in the *Amazon S3 User Guide*.
544
656
  #
545
657
  #
@@ -562,12 +674,14 @@ module Aws::S3
562
674
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html
563
675
  # @option options [String] :expected_bucket_owner
564
676
  # The account ID of the expected bucket owner. If the bucket is owned by
565
- # a different account, the request will fail with an HTTP `403 (Access
566
- # Denied)` error.
677
+ # a different account, the request fails with the HTTP status code `403
678
+ # Forbidden` (access denied).
567
679
  # @return [Object]
568
680
  def put_object(options = {})
569
681
  options = options.merge(bucket: @name)
570
- @client.put_object(options)
682
+ Aws::Plugins::UserAgent.feature('resource') do
683
+ @client.put_object(options)
684
+ end
571
685
  Object.new(
572
686
  bucket_name: @name,
573
687
  key: options[:key],
@@ -626,6 +740,7 @@ module Aws::S3
626
740
  # prefix: "Prefix",
627
741
  # upload_id_marker: "UploadIdMarker",
628
742
  # expected_bucket_owner: "AccountId",
743
+ # request_payer: "requester", # accepts requester
629
744
  # })
630
745
  # @param [Hash] options ({})
631
746
  # @option options [String] :delimiter
@@ -639,14 +754,14 @@ module Aws::S3
639
754
  # result element are not returned elsewhere in the response.
640
755
  # @option options [String] :encoding_type
641
756
  # Requests Amazon S3 to encode the object keys in the response and
642
- # specifies the encoding method to use. An object key may contain any
643
- # Unicode character; however, XML 1.0 parser cannot parse some
757
+ # specifies the encoding method to use. An object key can contain any
758
+ # Unicode character; however, the XML 1.0 parser cannot parse some
644
759
  # characters, such as characters with an ASCII value from 0 to 10. For
645
760
  # characters that are not supported in XML 1.0, you can add this
646
761
  # parameter to request that Amazon S3 encode the keys in the response.
647
762
  # @option options [String] :key_marker
648
- # Together with upload-id-marker, this parameter specifies the multipart
649
- # upload after which listing should begin.
763
+ # Together with `upload-id-marker`, this parameter specifies the
764
+ # multipart upload after which listing should begin.
650
765
  #
651
766
  # If `upload-id-marker` is not specified, only the keys
652
767
  # lexicographically greater than the specified `key-marker` will be
@@ -659,8 +774,8 @@ module Aws::S3
659
774
  # @option options [String] :prefix
660
775
  # Lists in-progress uploads only for those keys that begin with the
661
776
  # specified prefix. You can use prefixes to separate a bucket into
662
- # different grouping of keys. (You can think of using prefix to make
663
- # groups in the same way you'd use a folder in a file system.)
777
+ # different grouping of keys. (You can think of using `prefix` to make
778
+ # groups in the same way that you'd use a folder in a file system.)
664
779
  # @option options [String] :upload_id_marker
665
780
  # Together with key-marker, specifies the multipart upload after which
666
781
  # listing should begin. If key-marker is not specified, the
@@ -670,13 +785,25 @@ module Aws::S3
670
785
  # specified `upload-id-marker`.
671
786
  # @option options [String] :expected_bucket_owner
672
787
  # The account ID of the expected bucket owner. If the bucket is owned by
673
- # a different account, the request will fail with an HTTP `403 (Access
674
- # Denied)` error.
788
+ # a different account, the request fails with the HTTP status code `403
789
+ # Forbidden` (access denied).
790
+ # @option options [String] :request_payer
791
+ # Confirms that the requester knows that they will be charged for the
792
+ # request. Bucket owners need not specify this parameter in their
793
+ # requests. For information about downloading objects from Requester
794
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
795
+ # in the *Amazon S3 User Guide*.
796
+ #
797
+ #
798
+ #
799
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
675
800
  # @return [MultipartUpload::Collection]
676
801
  def multipart_uploads(options = {})
677
802
  batches = Enumerator.new do |y|
678
803
  options = options.merge(bucket: @name)
679
- resp = @client.list_multipart_uploads(options)
804
+ resp = Aws::Plugins::UserAgent.feature('resource') do
805
+ @client.list_multipart_uploads(options)
806
+ end
680
807
  resp.each_page do |page|
681
808
  batch = []
682
809
  page.data.uploads.each do |u|
@@ -721,19 +848,21 @@ module Aws::S3
721
848
  # prefix: "Prefix",
722
849
  # version_id_marker: "VersionIdMarker",
723
850
  # expected_bucket_owner: "AccountId",
851
+ # request_payer: "requester", # accepts requester
852
+ # optional_object_attributes: ["RestoreStatus"], # accepts RestoreStatus
724
853
  # })
725
854
  # @param [Hash] options ({})
726
855
  # @option options [String] :delimiter
727
856
  # A delimiter is a character that you specify to group keys. All keys
728
857
  # that contain the same string between the `prefix` and the first
729
858
  # occurrence of the delimiter are grouped under a single result element
730
- # in CommonPrefixes. These groups are counted as one result against the
731
- # max-keys limitation. These keys are not returned elsewhere in the
732
- # response.
859
+ # in `CommonPrefixes`. These groups are counted as one result against
860
+ # the `max-keys` limitation. These keys are not returned elsewhere in
861
+ # the response.
733
862
  # @option options [String] :encoding_type
734
863
  # Requests Amazon S3 to encode the object keys in the response and
735
- # specifies the encoding method to use. An object key may contain any
736
- # Unicode character; however, XML 1.0 parser cannot parse some
864
+ # specifies the encoding method to use. An object key can contain any
865
+ # Unicode character; however, the XML 1.0 parser cannot parse some
737
866
  # characters, such as characters with an ASCII value from 0 to 10. For
738
867
  # characters that are not supported in XML 1.0, you can add this
739
868
  # parameter to request that Amazon S3 encode the keys in the response.
@@ -742,21 +871,36 @@ module Aws::S3
742
871
  # @option options [String] :prefix
743
872
  # Use this parameter to select only those keys that begin with the
744
873
  # specified prefix. You can use prefixes to separate a bucket into
745
- # different groupings of keys. (You can think of using prefix to make
746
- # groups in the same way you'd use a folder in a file system.) You can
747
- # use prefix with delimiter to roll up numerous objects into a single
748
- # result under CommonPrefixes.
874
+ # different groupings of keys. (You can think of using `prefix` to make
875
+ # groups in the same way that you'd use a folder in a file system.) You
876
+ # can use `prefix` with `delimiter` to roll up numerous objects into a
877
+ # single result under `CommonPrefixes`.
749
878
  # @option options [String] :version_id_marker
750
879
  # Specifies the object version you want to start listing from.
751
880
  # @option options [String] :expected_bucket_owner
752
881
  # The account ID of the expected bucket owner. If the bucket is owned by
753
- # a different account, the request will fail with an HTTP `403 (Access
754
- # Denied)` error.
882
+ # a different account, the request fails with the HTTP status code `403
883
+ # Forbidden` (access denied).
884
+ # @option options [String] :request_payer
885
+ # Confirms that the requester knows that they will be charged for the
886
+ # request. Bucket owners need not specify this parameter in their
887
+ # requests. For information about downloading objects from Requester
888
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
889
+ # in the *Amazon S3 User Guide*.
890
+ #
891
+ #
892
+ #
893
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
894
+ # @option options [Array<String>] :optional_object_attributes
895
+ # Specifies the optional fields that you want returned in the response.
896
+ # Fields that you do not specify are not returned.
755
897
  # @return [ObjectVersion::Collection]
756
898
  def object_versions(options = {})
757
899
  batches = Enumerator.new do |y|
758
900
  options = options.merge(bucket: @name)
759
- resp = @client.list_object_versions(options)
901
+ resp = Aws::Plugins::UserAgent.feature('resource') do
902
+ @client.list_object_versions(options)
903
+ end
760
904
  resp.each_page do |page|
761
905
  batch = []
762
906
  page.data.versions_delete_markers.each do |v|
@@ -784,18 +928,19 @@ module Aws::S3
784
928
  # start_after: "StartAfter",
785
929
  # request_payer: "requester", # accepts requester
786
930
  # expected_bucket_owner: "AccountId",
931
+ # optional_object_attributes: ["RestoreStatus"], # accepts RestoreStatus
787
932
  # })
788
933
  # @param [Hash] options ({})
789
934
  # @option options [String] :delimiter
790
- # A delimiter is a character you use to group keys.
935
+ # A delimiter is a character that you use to group keys.
791
936
  # @option options [String] :encoding_type
792
937
  # Encoding type used by Amazon S3 to encode object keys in the response.
793
938
  # @option options [String] :prefix
794
939
  # Limits the response to keys that begin with the specified prefix.
795
940
  # @option options [Boolean] :fetch_owner
796
- # The owner field is not present in listV2 by default, if you want to
797
- # return owner field with each key in the result then set the fetch
798
- # owner field to true.
941
+ # The owner field is not present in `ListObjectsV2` by default. If you
942
+ # want to return the owner field with each key in the result, then set
943
+ # the `FetchOwner` field to `true`.
799
944
  # @option options [String] :start_after
800
945
  # StartAfter is where you want Amazon S3 to start listing from. Amazon
801
946
  # S3 starts listing after this specified key. StartAfter can be any key
@@ -806,13 +951,18 @@ module Aws::S3
806
951
  # this parameter in their requests.
807
952
  # @option options [String] :expected_bucket_owner
808
953
  # The account ID of the expected bucket owner. If the bucket is owned by
809
- # a different account, the request will fail with an HTTP `403 (Access
810
- # Denied)` error.
954
+ # a different account, the request fails with the HTTP status code `403
955
+ # Forbidden` (access denied).
956
+ # @option options [Array<String>] :optional_object_attributes
957
+ # Specifies the optional fields that you want returned in the response.
958
+ # Fields that you do not specify are not returned.
811
959
  # @return [ObjectSummary::Collection]
812
960
  def objects(options = {})
813
961
  batches = Enumerator.new do |y|
814
962
  options = options.merge(bucket: @name)
815
- resp = @client.list_objects_v2(options)
963
+ resp = Aws::Plugins::UserAgent.feature('resource') do
964
+ @client.list_objects_v2(options)
965
+ end
816
966
  resp.each_page do |page|
817
967
  batch = []
818
968
  page.data.contents.each do |c|
@@ -60,7 +60,9 @@ module Aws::S3
60
60
  #
61
61
  # @return [self]
62
62
  def load
63
- resp = @client.get_bucket_acl(bucket: @bucket_name)
63
+ resp = Aws::Plugins::UserAgent.feature('resource') do
64
+ @client.get_bucket_acl(bucket: @bucket_name)
65
+ end
64
66
  @data = resp.data
65
67
  self
66
68
  end
@@ -175,7 +177,9 @@ module Aws::S3
175
177
  :retry
176
178
  end
177
179
  end
178
- Aws::Waiters::Waiter.new(options).wait({})
180
+ Aws::Plugins::UserAgent.feature('resource') do
181
+ Aws::Waiters::Waiter.new(options).wait({})
182
+ end
179
183
  end
180
184
 
181
185
  # @!group Actions
@@ -203,6 +207,7 @@ module Aws::S3
203
207
  # },
204
208
  # },
205
209
  # content_md5: "ContentMD5",
210
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
206
211
  # grant_full_control: "GrantFullControl",
207
212
  # grant_read: "GrantRead",
208
213
  # grant_read_acp: "GrantReadACP",
@@ -221,12 +226,28 @@ module Aws::S3
221
226
  # used as a message integrity check to verify that the request body was
222
227
  # not corrupted in transit. For more information, go to [RFC 1864.][1]
223
228
  #
224
- # For requests made using the AWS Command Line Interface (CLI) or AWS
225
- # SDKs, this field is calculated automatically.
229
+ # For requests made using the Amazon Web Services Command Line Interface
230
+ # (CLI) or Amazon Web Services SDKs, this field is calculated
231
+ # automatically.
226
232
  #
227
233
  #
228
234
  #
229
235
  # [1]: http://www.ietf.org/rfc/rfc1864.txt
236
+ # @option options [String] :checksum_algorithm
237
+ # Indicates the algorithm used to create the checksum for the object
238
+ # when using the SDK. This header will not provide any additional
239
+ # functionality if not using the SDK. When sending this header, there
240
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
241
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
242
+ # `400 Bad Request`. For more information, see [Checking object
243
+ # integrity][1] in the *Amazon S3 User Guide*.
244
+ #
245
+ # If you provide an individual checksum, Amazon S3 ignores any provided
246
+ # `ChecksumAlgorithm` parameter.
247
+ #
248
+ #
249
+ #
250
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
230
251
  # @option options [String] :grant_full_control
231
252
  # Allows grantee the read, write, read ACP, and write ACP permissions on
232
253
  # the bucket.
@@ -243,12 +264,14 @@ module Aws::S3
243
264
  # Allows grantee to write the ACL for the applicable bucket.
244
265
  # @option options [String] :expected_bucket_owner
245
266
  # The account ID of the expected bucket owner. If the bucket is owned by
246
- # a different account, the request will fail with an HTTP `403 (Access
247
- # Denied)` error.
267
+ # a different account, the request fails with the HTTP status code `403
268
+ # Forbidden` (access denied).
248
269
  # @return [EmptyStructure]
249
270
  def put(options = {})
250
271
  options = options.merge(bucket: @bucket_name)
251
- resp = @client.put_bucket_acl(options)
272
+ resp = Aws::Plugins::UserAgent.feature('resource') do
273
+ @client.put_bucket_acl(options)
274
+ end
252
275
  resp.data
253
276
  end
254
277