aws-sdk-s3 1.48.0 → 1.113.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +888 -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/multi_region_access_point_arn.rb +68 -0
  7. data/lib/aws-sdk-s3/arn/object_lambda_arn.rb +69 -0
  8. data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +74 -0
  9. data/lib/aws-sdk-s3/bucket.rb +375 -82
  10. data/lib/aws-sdk-s3/bucket_acl.rb +55 -15
  11. data/lib/aws-sdk-s3/bucket_cors.rb +67 -14
  12. data/lib/aws-sdk-s3/bucket_lifecycle.rb +54 -16
  13. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +56 -16
  14. data/lib/aws-sdk-s3/bucket_logging.rb +52 -13
  15. data/lib/aws-sdk-s3/bucket_notification.rb +43 -17
  16. data/lib/aws-sdk-s3/bucket_policy.rb +51 -13
  17. data/lib/aws-sdk-s3/bucket_region_cache.rb +2 -0
  18. data/lib/aws-sdk-s3/bucket_request_payment.rb +51 -12
  19. data/lib/aws-sdk-s3/bucket_tagging.rb +59 -14
  20. data/lib/aws-sdk-s3/bucket_versioning.rb +118 -12
  21. data/lib/aws-sdk-s3/bucket_website.rb +66 -17
  22. data/lib/aws-sdk-s3/client.rb +8973 -740
  23. data/lib/aws-sdk-s3/client_api.rb +778 -2
  24. data/lib/aws-sdk-s3/customizations/bucket.rb +59 -16
  25. data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
  26. data/lib/aws-sdk-s3/customizations/object.rb +200 -62
  27. data/lib/aws-sdk-s3/customizations/object_summary.rb +5 -0
  28. data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
  29. data/lib/aws-sdk-s3/customizations.rb +4 -1
  30. data/lib/aws-sdk-s3/encryption/client.rb +22 -5
  31. data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +71 -29
  32. data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +43 -5
  33. data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
  34. data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +13 -2
  35. data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
  36. data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +2 -0
  37. data/lib/aws-sdk-s3/encryption/io_decrypter.rb +11 -3
  38. data/lib/aws-sdk-s3/encryption/io_encrypter.rb +2 -0
  39. data/lib/aws-sdk-s3/encryption/key_provider.rb +2 -0
  40. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +34 -3
  41. data/lib/aws-sdk-s3/encryption/materials.rb +8 -6
  42. data/lib/aws-sdk-s3/encryption/utils.rb +25 -0
  43. data/lib/aws-sdk-s3/encryption.rb +4 -0
  44. data/lib/aws-sdk-s3/encryptionV2/client.rb +566 -0
  45. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +222 -0
  46. data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +170 -0
  47. data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
  48. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +65 -0
  49. data/lib/aws-sdk-s3/encryptionV2/errors.rb +37 -0
  50. data/lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb +58 -0
  51. data/lib/aws-sdk-s3/encryptionV2/io_decrypter.rb +37 -0
  52. data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +73 -0
  53. data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
  54. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +169 -0
  55. data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
  56. data/lib/aws-sdk-s3/encryptionV2/utils.rb +103 -0
  57. data/lib/aws-sdk-s3/encryption_v2.rb +23 -0
  58. data/lib/aws-sdk-s3/errors.rb +123 -1
  59. data/lib/aws-sdk-s3/event_streams.rb +8 -1
  60. data/lib/aws-sdk-s3/file_downloader.rb +17 -10
  61. data/lib/aws-sdk-s3/file_part.rb +11 -6
  62. data/lib/aws-sdk-s3/file_uploader.rb +33 -14
  63. data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
  64. data/lib/aws-sdk-s3/multipart_file_uploader.rb +78 -19
  65. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +18 -7
  66. data/lib/aws-sdk-s3/multipart_upload.rb +178 -29
  67. data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
  68. data/lib/aws-sdk-s3/multipart_upload_part.rb +233 -42
  69. data/lib/aws-sdk-s3/object.rb +846 -179
  70. data/lib/aws-sdk-s3/object_acl.rb +79 -21
  71. data/lib/aws-sdk-s3/object_copier.rb +2 -0
  72. data/lib/aws-sdk-s3/object_multipart_copier.rb +2 -0
  73. data/lib/aws-sdk-s3/object_summary.rb +611 -162
  74. data/lib/aws-sdk-s3/object_version.rb +162 -71
  75. data/lib/aws-sdk-s3/plugins/accelerate.rb +38 -38
  76. data/lib/aws-sdk-s3/plugins/arn.rb +254 -0
  77. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +8 -8
  78. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +25 -3
  79. data/lib/aws-sdk-s3/plugins/dualstack.rb +38 -33
  80. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +4 -4
  81. data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
  82. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +11 -3
  83. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +73 -0
  84. data/lib/aws-sdk-s3/plugins/location_constraint.rb +2 -0
  85. data/lib/aws-sdk-s3/plugins/md5s.rb +34 -30
  86. data/lib/aws-sdk-s3/plugins/object_lambda_endpoint.rb +25 -0
  87. data/lib/aws-sdk-s3/plugins/redirects.rb +2 -0
  88. data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
  89. data/lib/aws-sdk-s3/plugins/s3_signer.rb +89 -36
  90. data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
  91. data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
  92. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +118 -0
  93. data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -0
  94. data/lib/aws-sdk-s3/presigned_post.rb +110 -51
  95. data/lib/aws-sdk-s3/presigner.rb +133 -45
  96. data/lib/aws-sdk-s3/resource.rb +43 -7
  97. data/lib/aws-sdk-s3/types.rb +8437 -1132
  98. data/lib/aws-sdk-s3/waiters.rb +67 -1
  99. data/lib/aws-sdk-s3.rb +12 -6
  100. metadata +37 -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 MultipartUpload
10
13
 
11
14
  extend Aws::Deprecations
@@ -27,6 +30,7 @@ module Aws::S3
27
30
  @id = extract_id(args, options)
28
31
  @data = options.delete(:data)
29
32
  @client = options.delete(:client) || Client.new(options)
33
+ @waiter_block_warned = false
30
34
  end
31
35
 
32
36
  # @!group Read-Only Attributes
@@ -70,7 +74,8 @@ module Aws::S3
70
74
  data[:storage_class]
71
75
  end
72
76
 
73
-
77
+ # Specifies the owner of the object that is part of the multipart
78
+ # upload.
74
79
  # @return [Types::Owner]
75
80
  def owner
76
81
  data[:owner]
@@ -82,6 +87,12 @@ module Aws::S3
82
87
  data[:initiator]
83
88
  end
84
89
 
90
+ # The algorithm that was used to create a checksum of the object.
91
+ # @return [String]
92
+ def checksum_algorithm
93
+ data[:checksum_algorithm]
94
+ end
95
+
85
96
  # @!endgroup
86
97
 
87
98
  # @return [Client]
@@ -117,7 +128,8 @@ module Aws::S3
117
128
  # Waiter polls an API operation until a resource enters a desired
118
129
  # state.
119
130
  #
120
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
131
+ # @note The waiting operation is performed on a copy. The original resource
132
+ # remains unchanged.
121
133
  #
122
134
  # ## Basic Usage
123
135
  #
@@ -130,13 +142,15 @@ module Aws::S3
130
142
  #
131
143
  # ## Example
132
144
  #
133
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
145
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
146
+ # instance.state.name == 'running'
147
+ # end
134
148
  #
135
149
  # ## Configuration
136
150
  #
137
151
  # You can configure the maximum number of polling attempts, and the
138
- # delay (in seconds) between each polling attempt. The waiting condition is set
139
- # by passing a block to {#wait_until}:
152
+ # delay (in seconds) between each polling attempt. The waiting condition is
153
+ # set by passing a block to {#wait_until}:
140
154
  #
141
155
  # # poll for ~25 seconds
142
156
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -167,17 +181,16 @@ module Aws::S3
167
181
  # # resource did not enter the desired state in time
168
182
  # end
169
183
  #
184
+ # @yieldparam [Resource] resource to be used in the waiting condition.
170
185
  #
171
- # @yield param [Resource] resource to be used in the waiting condition
172
- #
173
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
174
- # because the waiter has entered a state that it will not transition
175
- # out of, preventing success.
186
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
187
+ # terminates because the waiter has entered a state that it will not
188
+ # transition out of, preventing success.
176
189
  #
177
190
  # yet successful.
178
191
  #
179
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
180
- # while polling for a resource that is not expected.
192
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
193
+ # encountered while polling for a resource that is not expected.
181
194
  #
182
195
  # @raise [NotImplementedError] Raised when the resource does not
183
196
  #
@@ -213,14 +226,23 @@ module Aws::S3
213
226
  #
214
227
  # multipart_upload.abort({
215
228
  # request_payer: "requester", # accepts requester
229
+ # expected_bucket_owner: "AccountId",
216
230
  # })
217
231
  # @param [Hash] options ({})
218
232
  # @option options [String] :request_payer
219
- # Confirms that the requester knows that she or he will be charged for
220
- # the request. Bucket owners need not specify this parameter in their
221
- # requests. Documentation on downloading objects from requester pays
222
- # buckets can be found at
223
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
233
+ # Confirms that the requester knows that they will be charged for the
234
+ # request. Bucket owners need not specify this parameter in their
235
+ # requests. For information about downloading objects from Requester
236
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
237
+ # in the *Amazon S3 User Guide*.
238
+ #
239
+ #
240
+ #
241
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
242
+ # @option options [String] :expected_bucket_owner
243
+ # The account ID of the expected bucket owner. If the bucket is owned by
244
+ # a different account, the request fails with the HTTP status code `403
245
+ # Forbidden` (access denied).
224
246
  # @return [Types::AbortMultipartUploadOutput]
225
247
  def abort(options = {})
226
248
  options = options.merge(
@@ -239,20 +261,108 @@ module Aws::S3
239
261
  # parts: [
240
262
  # {
241
263
  # etag: "ETag",
264
+ # checksum_crc32: "ChecksumCRC32",
265
+ # checksum_crc32c: "ChecksumCRC32C",
266
+ # checksum_sha1: "ChecksumSHA1",
267
+ # checksum_sha256: "ChecksumSHA256",
242
268
  # part_number: 1,
243
269
  # },
244
270
  # ],
245
271
  # },
272
+ # checksum_crc32: "ChecksumCRC32",
273
+ # checksum_crc32c: "ChecksumCRC32C",
274
+ # checksum_sha1: "ChecksumSHA1",
275
+ # checksum_sha256: "ChecksumSHA256",
246
276
  # request_payer: "requester", # accepts requester
277
+ # expected_bucket_owner: "AccountId",
278
+ # sse_customer_algorithm: "SSECustomerAlgorithm",
279
+ # sse_customer_key: "SSECustomerKey",
280
+ # sse_customer_key_md5: "SSECustomerKeyMD5",
247
281
  # })
248
282
  # @param [Hash] options ({})
249
283
  # @option options [Types::CompletedMultipartUpload] :multipart_upload
284
+ # The container for the multipart upload request information.
285
+ # @option options [String] :checksum_crc32
286
+ # This header can be used as a data integrity check to verify that the
287
+ # data received is the same data that was originally sent. This header
288
+ # specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
289
+ # more information, see [Checking object integrity][1] in the *Amazon S3
290
+ # User Guide*.
291
+ #
292
+ #
293
+ #
294
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
295
+ # @option options [String] :checksum_crc32c
296
+ # This header can be used as a data integrity check to verify that the
297
+ # data received is the same data that was originally sent. This header
298
+ # specifies the base64-encoded, 32-bit CRC32C checksum of the object.
299
+ # For more information, see [Checking object integrity][1] in the
300
+ # *Amazon S3 User Guide*.
301
+ #
302
+ #
303
+ #
304
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
305
+ # @option options [String] :checksum_sha1
306
+ # This header can be used as a data integrity check to verify that the
307
+ # data received is the same data that was originally sent. This header
308
+ # specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
309
+ # more information, see [Checking object integrity][1] in the *Amazon S3
310
+ # User Guide*.
311
+ #
312
+ #
313
+ #
314
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
315
+ # @option options [String] :checksum_sha256
316
+ # This header can be used as a data integrity check to verify that the
317
+ # data received is the same data that was originally sent. This header
318
+ # specifies the base64-encoded, 256-bit SHA-256 digest of the object.
319
+ # For more information, see [Checking object integrity][1] in the
320
+ # *Amazon S3 User Guide*.
321
+ #
322
+ #
323
+ #
324
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
250
325
  # @option options [String] :request_payer
251
- # Confirms that the requester knows that she or he will be charged for
252
- # the request. Bucket owners need not specify this parameter in their
253
- # requests. Documentation on downloading objects from requester pays
254
- # buckets can be found at
255
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
326
+ # Confirms that the requester knows that they will be charged for the
327
+ # request. Bucket owners need not specify this parameter in their
328
+ # requests. For information about downloading objects from Requester
329
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
330
+ # in the *Amazon S3 User Guide*.
331
+ #
332
+ #
333
+ #
334
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
335
+ # @option options [String] :expected_bucket_owner
336
+ # The account ID of the expected bucket owner. If the bucket is owned by
337
+ # a different account, the request fails with the HTTP status code `403
338
+ # Forbidden` (access denied).
339
+ # @option options [String] :sse_customer_algorithm
340
+ # The server-side encryption (SSE) algorithm used to encrypt the object.
341
+ # This parameter is needed only when the object was created using a
342
+ # checksum algorithm. For more information, see [Protecting data using
343
+ # SSE-C keys][1] in the *Amazon S3 User Guide*.
344
+ #
345
+ #
346
+ #
347
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
348
+ # @option options [String] :sse_customer_key
349
+ # The server-side encryption (SSE) customer managed key. This parameter
350
+ # is needed only when the object was created using a checksum algorithm.
351
+ # For more information, see [Protecting data using SSE-C keys][1] in the
352
+ # *Amazon S3 User Guide*.
353
+ #
354
+ #
355
+ #
356
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
357
+ # @option options [String] :sse_customer_key_md5
358
+ # The MD5 server-side encryption (SSE) customer managed key. This
359
+ # parameter is needed only when the object was created using a checksum
360
+ # algorithm. For more information, see [Protecting data using SSE-C
361
+ # keys][1] in the *Amazon S3 User Guide*.
362
+ #
363
+ #
364
+ #
365
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
256
366
  # @return [Object]
257
367
  def complete(options = {})
258
368
  options = options.merge(
@@ -260,7 +370,7 @@ module Aws::S3
260
370
  key: @object_key,
261
371
  upload_id: @id
262
372
  )
263
- resp = @client.complete_multipart_upload(options)
373
+ @client.complete_multipart_upload(options)
264
374
  Object.new(
265
375
  bucket_name: @bucket_name,
266
376
  key: @object_key,
@@ -295,14 +405,53 @@ module Aws::S3
295
405
  #
296
406
  # parts = multipart_upload.parts({
297
407
  # request_payer: "requester", # accepts requester
408
+ # expected_bucket_owner: "AccountId",
409
+ # sse_customer_algorithm: "SSECustomerAlgorithm",
410
+ # sse_customer_key: "SSECustomerKey",
411
+ # sse_customer_key_md5: "SSECustomerKeyMD5",
298
412
  # })
299
413
  # @param [Hash] options ({})
300
414
  # @option options [String] :request_payer
301
- # Confirms that the requester knows that she or he will be charged for
302
- # the request. Bucket owners need not specify this parameter in their
303
- # requests. Documentation on downloading objects from requester pays
304
- # buckets can be found at
305
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
415
+ # Confirms that the requester knows that they will be charged for the
416
+ # request. Bucket owners need not specify this parameter in their
417
+ # requests. For information about downloading objects from Requester
418
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
419
+ # in the *Amazon S3 User Guide*.
420
+ #
421
+ #
422
+ #
423
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
424
+ # @option options [String] :expected_bucket_owner
425
+ # The account ID of the expected bucket owner. If the bucket is owned by
426
+ # a different account, the request fails with the HTTP status code `403
427
+ # Forbidden` (access denied).
428
+ # @option options [String] :sse_customer_algorithm
429
+ # The server-side encryption (SSE) algorithm used to encrypt the object.
430
+ # This parameter is needed only when the object was created using a
431
+ # checksum algorithm. For more information, see [Protecting data using
432
+ # SSE-C keys][1] in the *Amazon S3 User Guide*.
433
+ #
434
+ #
435
+ #
436
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
437
+ # @option options [String] :sse_customer_key
438
+ # The server-side encryption (SSE) customer managed key. This parameter
439
+ # is needed only when the object was created using a checksum algorithm.
440
+ # For more information, see [Protecting data using SSE-C keys][1] in the
441
+ # *Amazon S3 User Guide*.
442
+ #
443
+ #
444
+ #
445
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
446
+ # @option options [String] :sse_customer_key_md5
447
+ # The MD5 server-side encryption (SSE) customer managed key. This
448
+ # parameter is needed only when the object was created using a checksum
449
+ # algorithm. For more information, see [Protecting data using SSE-C
450
+ # keys][1] in the *Amazon S3 User Guide*.
451
+ #
452
+ #
453
+ #
454
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
306
455
  # @return [MultipartUploadPart::Collection]
307
456
  def parts(options = {})
308
457
  batches = Enumerator.new do |y|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aws
2
4
  module S3
3
5
  class MultipartUploadError < StandardError