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
@@ -76,6 +76,62 @@ module Aws::S3
76
76
  data[:size]
77
77
  end
78
78
 
79
+ # This header can be used as a data integrity check to verify that the
80
+ # data received is the same data that was originally sent. This header
81
+ # specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
82
+ # more information, see [Checking object integrity][1] in the *Amazon S3
83
+ # User Guide*.
84
+ #
85
+ #
86
+ #
87
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
88
+ # @return [String]
89
+ def checksum_crc32
90
+ data[:checksum_crc32]
91
+ end
92
+
93
+ # The base64-encoded, 32-bit CRC32C checksum of the object. This will
94
+ # only be present if it was uploaded with the object. With multipart
95
+ # uploads, this may not be a checksum value of the object. For more
96
+ # information about how checksums are calculated with multipart uploads,
97
+ # see [ Checking object integrity][1] in the *Amazon S3 User Guide*.
98
+ #
99
+ #
100
+ #
101
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
102
+ # @return [String]
103
+ def checksum_crc32c
104
+ data[:checksum_crc32c]
105
+ end
106
+
107
+ # The base64-encoded, 160-bit SHA-1 digest of the object. This will only
108
+ # be present if it was uploaded with the object. With multipart uploads,
109
+ # this may not be a checksum value of the object. For more information
110
+ # about how checksums are calculated with multipart uploads, see [
111
+ # Checking object integrity][1] in the *Amazon S3 User Guide*.
112
+ #
113
+ #
114
+ #
115
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
116
+ # @return [String]
117
+ def checksum_sha1
118
+ data[:checksum_sha1]
119
+ end
120
+
121
+ # This header can be used as a data integrity check to verify that the
122
+ # data received is the same data that was originally sent. This header
123
+ # specifies the base64-encoded, 256-bit SHA-256 digest of the object.
124
+ # For more information, see [Checking object integrity][1] in the
125
+ # *Amazon S3 User Guide*.
126
+ #
127
+ #
128
+ #
129
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
130
+ # @return [String]
131
+ def checksum_sha256
132
+ data[:checksum_sha256]
133
+ end
134
+
79
135
  # @!endgroup
80
136
 
81
137
  # @return [Client]
@@ -200,7 +256,9 @@ module Aws::S3
200
256
  :retry
201
257
  end
202
258
  end
203
- Aws::Waiters::Waiter.new(options).wait({})
259
+ Aws::Plugins::UserAgent.feature('resource') do
260
+ Aws::Waiters::Waiter.new(options).wait({})
261
+ end
204
262
  end
205
263
 
206
264
  # @!group Actions
@@ -228,14 +286,14 @@ module Aws::S3
228
286
  # @option options [required, String] :copy_source
229
287
  # Specifies the source object for the copy operation. You specify the
230
288
  # value in one of two formats, depending on whether you want to access
231
- # the source object through an [access point][1]\:
289
+ # the source object through an [access point][1]:
232
290
  #
233
291
  # * For objects not accessed through an access point, specify the name
234
292
  # of the source bucket and key of the source object, separated by a
235
293
  # slash (/). For example, to copy the object `reports/january.pdf`
236
294
  # from the bucket `awsexamplebucket`, use
237
- # `awsexamplebucket/reports/january.pdf`. The value must be URL
238
- # encoded.
295
+ # `awsexamplebucket/reports/january.pdf`. The value must be
296
+ # URL-encoded.
239
297
  #
240
298
  # * For objects accessed through access points, specify the Amazon
241
299
  # Resource Name (ARN) of the object as accessed through the access
@@ -248,7 +306,8 @@ module Aws::S3
248
306
  # The value must be URL encoded.
249
307
  #
250
308
  # <note markdown="1"> Amazon S3 supports copy operations using access points only when the
251
- # source and destination buckets are in the same AWS Region.
309
+ # source and destination buckets are in the same Amazon Web Services
310
+ # Region.
252
311
  #
253
312
  # </note>
254
313
  #
@@ -259,7 +318,7 @@ module Aws::S3
259
318
  # outpost `my-outpost` owned by account `123456789012` in Region
260
319
  # `us-west-2`, use the URL encoding of
261
320
  # `arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf`.
262
- # The value must be URL encoded.
321
+ # The value must be URL-encoded.
263
322
  #
264
323
  # To copy a specific version of an object, append
265
324
  # `?versionId=<version-id>` to the value (for example,
@@ -315,8 +374,8 @@ module Aws::S3
315
374
  # @option options [String] :request_payer
316
375
  # Confirms that the requester knows that they will be charged for the
317
376
  # request. Bucket owners need not specify this parameter in their
318
- # requests. For information about downloading objects from requester
319
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
377
+ # requests. For information about downloading objects from Requester
378
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
320
379
  # in the *Amazon S3 User Guide*.
321
380
  #
322
381
  #
@@ -324,12 +383,12 @@ module Aws::S3
324
383
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
325
384
  # @option options [String] :expected_bucket_owner
326
385
  # The account ID of the expected destination bucket owner. If the
327
- # destination bucket is owned by a different account, the request will
328
- # fail with an HTTP `403 (Access Denied)` error.
386
+ # destination bucket is owned by a different account, the request fails
387
+ # with the HTTP status code `403 Forbidden` (access denied).
329
388
  # @option options [String] :expected_source_bucket_owner
330
389
  # The account ID of the expected source bucket owner. If the source
331
- # bucket is owned by a different account, the request will fail with an
332
- # HTTP `403 (Access Denied)` error.
390
+ # bucket is owned by a different account, the request fails with the
391
+ # HTTP status code `403 Forbidden` (access denied).
333
392
  # @return [Types::UploadPartCopyOutput]
334
393
  def copy_from(options = {})
335
394
  options = options.merge(
@@ -338,7 +397,9 @@ module Aws::S3
338
397
  upload_id: @multipart_upload_id,
339
398
  part_number: @part_number
340
399
  )
341
- resp = @client.upload_part_copy(options)
400
+ resp = Aws::Plugins::UserAgent.feature('resource') do
401
+ @client.upload_part_copy(options)
402
+ end
342
403
  resp.data
343
404
  end
344
405
 
@@ -348,6 +409,11 @@ module Aws::S3
348
409
  # body: source_file,
349
410
  # content_length: 1,
350
411
  # content_md5: "ContentMD5",
412
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
413
+ # checksum_crc32: "ChecksumCRC32",
414
+ # checksum_crc32c: "ChecksumCRC32C",
415
+ # checksum_sha1: "ChecksumSHA1",
416
+ # checksum_sha256: "ChecksumSHA256",
351
417
  # sse_customer_algorithm: "SSECustomerAlgorithm",
352
418
  # sse_customer_key: "SSECustomerKey",
353
419
  # sse_customer_key_md5: "SSECustomerKeyMD5",
@@ -364,6 +430,64 @@ module Aws::S3
364
430
  # The base64-encoded 128-bit MD5 digest of the part data. This parameter
365
431
  # is auto-populated when using the command from the CLI. This parameter
366
432
  # is required if object lock parameters are specified.
433
+ # @option options [String] :checksum_algorithm
434
+ # Indicates the algorithm used to create the checksum for the object
435
+ # when using the SDK. This header will not provide any additional
436
+ # functionality if not using the SDK. When sending this header, there
437
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
438
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
439
+ # `400 Bad Request`. For more information, see [Checking object
440
+ # integrity][1] in the *Amazon S3 User Guide*.
441
+ #
442
+ # If you provide an individual checksum, Amazon S3 ignores any provided
443
+ # `ChecksumAlgorithm` parameter.
444
+ #
445
+ # This checksum algorithm must be the same for all parts and it match
446
+ # the checksum value supplied in the `CreateMultipartUpload` request.
447
+ #
448
+ #
449
+ #
450
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
451
+ # @option options [String] :checksum_crc32
452
+ # This header can be used as a data integrity check to verify that the
453
+ # data received is the same data that was originally sent. This header
454
+ # specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
455
+ # more information, see [Checking object integrity][1] in the *Amazon S3
456
+ # User Guide*.
457
+ #
458
+ #
459
+ #
460
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
461
+ # @option options [String] :checksum_crc32c
462
+ # This header can be used as a data integrity check to verify that the
463
+ # data received is the same data that was originally sent. This header
464
+ # specifies the base64-encoded, 32-bit CRC32C checksum of the object.
465
+ # For more information, see [Checking object integrity][1] in the
466
+ # *Amazon S3 User Guide*.
467
+ #
468
+ #
469
+ #
470
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
471
+ # @option options [String] :checksum_sha1
472
+ # This header can be used as a data integrity check to verify that the
473
+ # data received is the same data that was originally sent. This header
474
+ # specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
475
+ # more information, see [Checking object integrity][1] in the *Amazon S3
476
+ # User Guide*.
477
+ #
478
+ #
479
+ #
480
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
481
+ # @option options [String] :checksum_sha256
482
+ # This header can be used as a data integrity check to verify that the
483
+ # data received is the same data that was originally sent. This header
484
+ # specifies the base64-encoded, 256-bit SHA-256 digest of the object.
485
+ # For more information, see [Checking object integrity][1] in the
486
+ # *Amazon S3 User Guide*.
487
+ #
488
+ #
489
+ #
490
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
367
491
  # @option options [String] :sse_customer_algorithm
368
492
  # Specifies the algorithm to use to when encrypting the object (for
369
493
  # example, AES256).
@@ -382,8 +506,8 @@ module Aws::S3
382
506
  # @option options [String] :request_payer
383
507
  # Confirms that the requester knows that they will be charged for the
384
508
  # request. Bucket owners need not specify this parameter in their
385
- # requests. For information about downloading objects from requester
386
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
509
+ # requests. For information about downloading objects from Requester
510
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
387
511
  # in the *Amazon S3 User Guide*.
388
512
  #
389
513
  #
@@ -391,8 +515,8 @@ module Aws::S3
391
515
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
392
516
  # @option options [String] :expected_bucket_owner
393
517
  # The account ID of the expected bucket owner. If the bucket is owned by
394
- # a different account, the request will fail with an HTTP `403 (Access
395
- # Denied)` error.
518
+ # a different account, the request fails with the HTTP status code `403
519
+ # Forbidden` (access denied).
396
520
  # @return [Types::UploadPartOutput]
397
521
  def upload(options = {})
398
522
  options = options.merge(
@@ -401,7 +525,9 @@ module Aws::S3
401
525
  upload_id: @multipart_upload_id,
402
526
  part_number: @part_number
403
527
  )
404
- resp = @client.upload_part(options)
528
+ resp = Aws::Plugins::UserAgent.feature('resource') do
529
+ @client.upload_part(options)
530
+ end
405
531
  resp.data
406
532
  end
407
533