aws-sdk-s3 1.36.0 → 1.95.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +768 -0
  3. data/LICENSE.txt +202 -0
  4. data/VERSION +1 -0
  5. data/lib/aws-sdk-s3/arn/access_point_arn.rb +69 -0
  6. data/lib/aws-sdk-s3/arn/object_lambda_arn.rb +69 -0
  7. data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +73 -0
  8. data/lib/aws-sdk-s3/bucket.rb +277 -76
  9. data/lib/aws-sdk-s3/bucket_acl.rb +40 -15
  10. data/lib/aws-sdk-s3/bucket_cors.rb +50 -14
  11. data/lib/aws-sdk-s3/bucket_lifecycle.rb +33 -14
  12. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +32 -14
  13. data/lib/aws-sdk-s3/bucket_logging.rb +35 -15
  14. data/lib/aws-sdk-s3/bucket_notification.rb +32 -18
  15. data/lib/aws-sdk-s3/bucket_policy.rb +34 -13
  16. data/lib/aws-sdk-s3/bucket_region_cache.rb +2 -0
  17. data/lib/aws-sdk-s3/bucket_request_payment.rb +34 -12
  18. data/lib/aws-sdk-s3/bucket_tagging.rb +42 -14
  19. data/lib/aws-sdk-s3/bucket_versioning.rb +67 -12
  20. data/lib/aws-sdk-s3/bucket_website.rb +49 -17
  21. data/lib/aws-sdk-s3/client.rb +7494 -618
  22. data/lib/aws-sdk-s3/client_api.rb +417 -2
  23. data/lib/aws-sdk-s3/customizations/bucket.rb +59 -16
  24. data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
  25. data/lib/aws-sdk-s3/customizations/object.rb +125 -60
  26. data/lib/aws-sdk-s3/customizations/object_summary.rb +5 -0
  27. data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
  28. data/lib/aws-sdk-s3/customizations.rb +4 -1
  29. data/lib/aws-sdk-s3/encryption/client.rb +22 -5
  30. data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +72 -26
  31. data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +43 -5
  32. data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
  33. data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +13 -2
  34. data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
  35. data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +2 -0
  36. data/lib/aws-sdk-s3/encryption/io_decrypter.rb +11 -3
  37. data/lib/aws-sdk-s3/encryption/io_encrypter.rb +2 -0
  38. data/lib/aws-sdk-s3/encryption/key_provider.rb +2 -0
  39. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +34 -3
  40. data/lib/aws-sdk-s3/encryption/materials.rb +8 -6
  41. data/lib/aws-sdk-s3/encryption/utils.rb +25 -0
  42. data/lib/aws-sdk-s3/encryption.rb +4 -0
  43. data/lib/aws-sdk-s3/encryptionV2/client.rb +566 -0
  44. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +226 -0
  45. data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +170 -0
  46. data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
  47. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +69 -0
  48. data/lib/aws-sdk-s3/encryptionV2/errors.rb +37 -0
  49. data/lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb +58 -0
  50. data/lib/aws-sdk-s3/encryptionV2/io_decrypter.rb +37 -0
  51. data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +73 -0
  52. data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
  53. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +169 -0
  54. data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
  55. data/lib/aws-sdk-s3/encryptionV2/utils.rb +103 -0
  56. data/lib/aws-sdk-s3/encryption_v2.rb +23 -0
  57. data/lib/aws-sdk-s3/errors.rb +123 -1
  58. data/lib/aws-sdk-s3/event_streams.rb +15 -8
  59. data/lib/aws-sdk-s3/file_downloader.rb +10 -8
  60. data/lib/aws-sdk-s3/file_part.rb +11 -6
  61. data/lib/aws-sdk-s3/file_uploader.rb +28 -14
  62. data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
  63. data/lib/aws-sdk-s3/multipart_file_uploader.rb +53 -13
  64. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +20 -7
  65. data/lib/aws-sdk-s3/multipart_upload.rb +64 -29
  66. data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
  67. data/lib/aws-sdk-s3/multipart_upload_part.rb +115 -42
  68. data/lib/aws-sdk-s3/object.rb +656 -151
  69. data/lib/aws-sdk-s3/object_acl.rb +64 -21
  70. data/lib/aws-sdk-s3/object_copier.rb +2 -0
  71. data/lib/aws-sdk-s3/object_multipart_copier.rb +2 -0
  72. data/lib/aws-sdk-s3/object_summary.rb +474 -138
  73. data/lib/aws-sdk-s3/object_version.rb +122 -58
  74. data/lib/aws-sdk-s3/plugins/accelerate.rb +32 -38
  75. data/lib/aws-sdk-s3/plugins/arn.rb +228 -0
  76. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +7 -7
  77. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +25 -3
  78. data/lib/aws-sdk-s3/plugins/dualstack.rb +15 -4
  79. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +4 -4
  80. data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +2 -0
  81. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +11 -3
  82. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +67 -0
  83. data/lib/aws-sdk-s3/plugins/location_constraint.rb +2 -0
  84. data/lib/aws-sdk-s3/plugins/md5s.rb +30 -28
  85. data/lib/aws-sdk-s3/plugins/object_lambda_endpoint.rb +25 -0
  86. data/lib/aws-sdk-s3/plugins/redirects.rb +2 -0
  87. data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
  88. data/lib/aws-sdk-s3/plugins/s3_signer.rb +64 -35
  89. data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
  90. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +118 -0
  91. data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -0
  92. data/lib/aws-sdk-s3/presigned_post.rb +72 -32
  93. data/lib/aws-sdk-s3/presigner.rb +162 -66
  94. data/lib/aws-sdk-s3/resource.rb +23 -5
  95. data/lib/aws-sdk-s3/types.rb +6441 -952
  96. data/lib/aws-sdk-s3/waiters.rb +67 -1
  97. data/lib/aws-sdk-s3.rb +12 -6
  98. metadata +35 -12
@@ -1,11 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # WARNING ABOUT GENERATED CODE
2
4
  #
3
5
  # This file is generated. See the contributing guide for more information:
4
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
5
7
  #
6
8
  # WARNING ABOUT GENERATED CODE
7
9
 
8
10
  module Aws::S3
11
+
9
12
  class MultipartUploadPart
10
13
 
11
14
  extend Aws::Deprecations
@@ -30,6 +33,7 @@ module Aws::S3
30
33
  @part_number = extract_part_number(args, options)
31
34
  @data = options.delete(:data)
32
35
  @client = options.delete(:client) || Client.new(options)
36
+ @waiter_block_warned = false
33
37
  end
34
38
 
35
39
  # @!group Read-Only Attributes
@@ -107,7 +111,8 @@ module Aws::S3
107
111
  # Waiter polls an API operation until a resource enters a desired
108
112
  # state.
109
113
  #
110
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
114
+ # @note The waiting operation is performed on a copy. The original resource
115
+ # remains unchanged.
111
116
  #
112
117
  # ## Basic Usage
113
118
  #
@@ -120,13 +125,15 @@ module Aws::S3
120
125
  #
121
126
  # ## Example
122
127
  #
123
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
128
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
129
+ # instance.state.name == 'running'
130
+ # end
124
131
  #
125
132
  # ## Configuration
126
133
  #
127
134
  # You can configure the maximum number of polling attempts, and the
128
- # delay (in seconds) between each polling attempt. The waiting condition is set
129
- # by passing a block to {#wait_until}:
135
+ # delay (in seconds) between each polling attempt. The waiting condition is
136
+ # set by passing a block to {#wait_until}:
130
137
  #
131
138
  # # poll for ~25 seconds
132
139
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -157,17 +164,16 @@ module Aws::S3
157
164
  # # resource did not enter the desired state in time
158
165
  # end
159
166
  #
167
+ # @yieldparam [Resource] resource to be used in the waiting condition.
160
168
  #
161
- # @yield param [Resource] resource to be used in the waiting condition
162
- #
163
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
164
- # because the waiter has entered a state that it will not transition
165
- # out of, preventing success.
169
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
170
+ # terminates because the waiter has entered a state that it will not
171
+ # transition out of, preventing success.
166
172
  #
167
173
  # yet successful.
168
174
  #
169
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
170
- # while polling for a resource that is not expected.
175
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
176
+ # encountered while polling for a resource that is not expected.
171
177
  #
172
178
  # @raise [NotImplementedError] Raised when the resource does not
173
179
  #
@@ -215,11 +221,55 @@ module Aws::S3
215
221
  # copy_source_sse_customer_key: "CopySourceSSECustomerKey",
216
222
  # copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5",
217
223
  # request_payer: "requester", # accepts requester
224
+ # expected_bucket_owner: "AccountId",
225
+ # expected_source_bucket_owner: "AccountId",
218
226
  # })
219
227
  # @param [Hash] options ({})
220
228
  # @option options [required, String] :copy_source
221
- # The name of the source bucket and key name of the source object,
222
- # separated by a slash (/). Must be URL-encoded.
229
+ # Specifies the source object for the copy operation. You specify the
230
+ # value in one of two formats, depending on whether you want to access
231
+ # the source object through an [access point][1]\:
232
+ #
233
+ # * For objects not accessed through an access point, specify the name
234
+ # of the source bucket and key of the source object, separated by a
235
+ # slash (/). For example, to copy the object `reports/january.pdf`
236
+ # from the bucket `awsexamplebucket`, use
237
+ # `awsexamplebucket/reports/january.pdf`. The value must be URL
238
+ # encoded.
239
+ #
240
+ # * For objects accessed through access points, specify the Amazon
241
+ # Resource Name (ARN) of the object as accessed through the access
242
+ # point, in the format
243
+ # `arn:aws:s3:<Region>:<account-id>:accesspoint/<access-point-name>/object/<key>`.
244
+ # For example, to copy the object `reports/january.pdf` through access
245
+ # point `my-access-point` owned by account `123456789012` in Region
246
+ # `us-west-2`, use the URL encoding of
247
+ # `arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf`.
248
+ # The value must be URL encoded.
249
+ #
250
+ # <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.
252
+ #
253
+ # </note>
254
+ #
255
+ # Alternatively, for objects accessed through Amazon S3 on Outposts,
256
+ # specify the ARN of the object as accessed in the format
257
+ # `arn:aws:s3-outposts:<Region>:<account-id>:outpost/<outpost-id>/object/<key>`.
258
+ # For example, to copy the object `reports/january.pdf` through
259
+ # outpost `my-outpost` owned by account `123456789012` in Region
260
+ # `us-west-2`, use the URL encoding of
261
+ # `arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf`.
262
+ # The value must be URL encoded.
263
+ #
264
+ # To copy a specific version of an object, append
265
+ # `?versionId=<version-id>` to the value (for example,
266
+ # `awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893`).
267
+ # If you don't specify a version ID, Amazon S3 copies the latest
268
+ # version of the source object.
269
+ #
270
+ #
271
+ #
272
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html
223
273
  # @option options [String] :copy_source_if_match
224
274
  # Copies the object if its entity tag (ETag) matches the specified tag.
225
275
  # @option options [Time,DateTime,Date,Integer,String] :copy_source_if_modified_since
@@ -234,26 +284,26 @@ module Aws::S3
234
284
  # The range of bytes to copy from the source object. The range value
235
285
  # must use the form bytes=first-last, where the first and last are the
236
286
  # zero-based byte offsets to copy. For example, bytes=0-9 indicates that
237
- # you want to copy the first ten bytes of the source. You can copy a
287
+ # you want to copy the first 10 bytes of the source. You can copy a
238
288
  # range only if the source object is greater than 5 MB.
239
289
  # @option options [String] :sse_customer_algorithm
240
- # Specifies the algorithm to use to when encrypting the object (e.g.,
241
- # AES256).
290
+ # Specifies the algorithm to use to when encrypting the object (for
291
+ # example, AES256).
242
292
  # @option options [String] :sse_customer_key
243
293
  # Specifies the customer-provided encryption key for Amazon S3 to use in
244
294
  # encrypting data. This value is used to store the object and then it is
245
- # discarded; Amazon does not store the encryption key. The key must be
246
- # appropriate for use with the algorithm specified in the
247
- # x-amz-server-side​-encryption​-customer-algorithm header. This must be
295
+ # discarded; Amazon S3 does not store the encryption key. The key must
296
+ # be appropriate for use with the algorithm specified in the
297
+ # `x-amz-server-side-encryption-customer-algorithm` header. This must be
248
298
  # the same encryption key specified in the initiate multipart upload
249
299
  # request.
250
300
  # @option options [String] :sse_customer_key_md5
251
301
  # Specifies the 128-bit MD5 digest of the encryption key according to
252
302
  # RFC 1321. Amazon S3 uses this header for a message integrity check to
253
- # ensure the encryption key was transmitted without error.
303
+ # ensure that the encryption key was transmitted without error.
254
304
  # @option options [String] :copy_source_sse_customer_algorithm
255
- # Specifies the algorithm to use when decrypting the source object
256
- # (e.g., AES256).
305
+ # Specifies the algorithm to use when decrypting the source object (for
306
+ # example, AES256).
257
307
  # @option options [String] :copy_source_sse_customer_key
258
308
  # Specifies the customer-provided encryption key for Amazon S3 to use to
259
309
  # decrypt the source object. The encryption key provided in this header
@@ -261,13 +311,25 @@ module Aws::S3
261
311
  # @option options [String] :copy_source_sse_customer_key_md5
262
312
  # Specifies the 128-bit MD5 digest of the encryption key according to
263
313
  # RFC 1321. Amazon S3 uses this header for a message integrity check to
264
- # ensure the encryption key was transmitted without error.
314
+ # ensure that the encryption key was transmitted without error.
265
315
  # @option options [String] :request_payer
266
- # Confirms that the requester knows that she or he will be charged for
267
- # the request. Bucket owners need not specify this parameter in their
268
- # requests. Documentation on downloading objects from requester pays
269
- # buckets can be found at
270
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
316
+ # Confirms that the requester knows that they will be charged for the
317
+ # 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]
320
+ # in the *Amazon S3 User Guide*.
321
+ #
322
+ #
323
+ #
324
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
325
+ # @option options [String] :expected_bucket_owner
326
+ # 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.
329
+ # @option options [String] :expected_source_bucket_owner
330
+ # 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.
271
333
  # @return [Types::UploadPartCopyOutput]
272
334
  def copy_from(options = {})
273
335
  options = options.merge(
@@ -290,36 +352,47 @@ module Aws::S3
290
352
  # sse_customer_key: "SSECustomerKey",
291
353
  # sse_customer_key_md5: "SSECustomerKeyMD5",
292
354
  # request_payer: "requester", # accepts requester
355
+ # expected_bucket_owner: "AccountId",
293
356
  # })
294
357
  # @param [Hash] options ({})
295
- # @option options [String, IO] :body
358
+ # @option options [String, StringIO, File] :body
296
359
  # Object data.
297
360
  # @option options [Integer] :content_length
298
361
  # Size of the body in bytes. This parameter is useful when the size of
299
362
  # the body cannot be determined automatically.
300
363
  # @option options [String] :content_md5
301
- # The base64-encoded 128-bit MD5 digest of the part data.
364
+ # The base64-encoded 128-bit MD5 digest of the part data. This parameter
365
+ # is auto-populated when using the command from the CLI. This parameter
366
+ # is required if object lock parameters are specified.
302
367
  # @option options [String] :sse_customer_algorithm
303
- # Specifies the algorithm to use to when encrypting the object (e.g.,
304
- # AES256).
368
+ # Specifies the algorithm to use to when encrypting the object (for
369
+ # example, AES256).
305
370
  # @option options [String] :sse_customer_key
306
371
  # Specifies the customer-provided encryption key for Amazon S3 to use in
307
372
  # encrypting data. This value is used to store the object and then it is
308
- # discarded; Amazon does not store the encryption key. The key must be
309
- # appropriate for use with the algorithm specified in the
310
- # x-amz-server-side​-encryption​-customer-algorithm header. This must be
373
+ # discarded; Amazon S3 does not store the encryption key. The key must
374
+ # be appropriate for use with the algorithm specified in the
375
+ # `x-amz-server-side-encryption-customer-algorithm header`. This must be
311
376
  # the same encryption key specified in the initiate multipart upload
312
377
  # request.
313
378
  # @option options [String] :sse_customer_key_md5
314
379
  # Specifies the 128-bit MD5 digest of the encryption key according to
315
380
  # RFC 1321. Amazon S3 uses this header for a message integrity check to
316
- # ensure the encryption key was transmitted without error.
381
+ # ensure that the encryption key was transmitted without error.
317
382
  # @option options [String] :request_payer
318
- # Confirms that the requester knows that she or he will be charged for
319
- # the request. Bucket owners need not specify this parameter in their
320
- # requests. Documentation on downloading objects from requester pays
321
- # buckets can be found at
322
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
383
+ # Confirms that the requester knows that they will be charged for the
384
+ # 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]
387
+ # in the *Amazon S3 User Guide*.
388
+ #
389
+ #
390
+ #
391
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
392
+ # @option options [String] :expected_bucket_owner
393
+ # 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.
323
396
  # @return [Types::UploadPartOutput]
324
397
  def upload(options = {})
325
398
  options = options.merge(