aws-sdk-s3 1.30.0 → 1.114.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 +903 -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 +377 -77
  10. data/lib/aws-sdk-s3/bucket_acl.rb +57 -14
  11. data/lib/aws-sdk-s3/bucket_cors.rb +67 -13
  12. data/lib/aws-sdk-s3/bucket_lifecycle.rb +54 -15
  13. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +56 -15
  14. data/lib/aws-sdk-s3/bucket_logging.rb +52 -15
  15. data/lib/aws-sdk-s3/bucket_notification.rb +44 -15
  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 -13
  20. data/lib/aws-sdk-s3/bucket_versioning.rb +118 -12
  21. data/lib/aws-sdk-s3/bucket_website.rb +66 -13
  22. data/lib/aws-sdk-s3/client.rb +9016 -669
  23. data/lib/aws-sdk-s3/client_api.rb +786 -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 +23 -6
  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 +20 -7
  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 +20 -7
  66. data/lib/aws-sdk-s3/multipart_upload.rb +178 -28
  67. data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
  68. data/lib/aws-sdk-s3/multipart_upload_part.rb +236 -43
  69. data/lib/aws-sdk-s3/object.rb +848 -162
  70. data/lib/aws-sdk-s3/object_acl.rb +81 -20
  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 +615 -144
  74. data/lib/aws-sdk-s3/object_version.rb +161 -68
  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 +95 -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 +139 -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 +168 -66
  96. data/lib/aws-sdk-s3/resource.rb +41 -5
  97. data/lib/aws-sdk-s3/types.rb +8652 -1146
  98. data/lib/aws-sdk-s3/waiters.rb +67 -1
  99. data/lib/aws-sdk-s3.rb +12 -6
  100. metadata +38 -13
@@ -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,6 +74,8 @@ module Aws::S3
70
74
  data[:storage_class]
71
75
  end
72
76
 
77
+ # Specifies the owner of the object that is part of the multipart
78
+ # upload.
73
79
  # @return [Types::Owner]
74
80
  def owner
75
81
  data[:owner]
@@ -81,6 +87,12 @@ module Aws::S3
81
87
  data[:initiator]
82
88
  end
83
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
+
84
96
  # @!endgroup
85
97
 
86
98
  # @return [Client]
@@ -116,7 +128,8 @@ module Aws::S3
116
128
  # Waiter polls an API operation until a resource enters a desired
117
129
  # state.
118
130
  #
119
- # @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.
120
133
  #
121
134
  # ## Basic Usage
122
135
  #
@@ -129,13 +142,15 @@ module Aws::S3
129
142
  #
130
143
  # ## Example
131
144
  #
132
- # 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
133
148
  #
134
149
  # ## Configuration
135
150
  #
136
151
  # You can configure the maximum number of polling attempts, and the
137
- # delay (in seconds) between each polling attempt. The waiting condition is set
138
- # 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}:
139
154
  #
140
155
  # # poll for ~25 seconds
141
156
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -166,17 +181,16 @@ module Aws::S3
166
181
  # # resource did not enter the desired state in time
167
182
  # end
168
183
  #
184
+ # @yieldparam [Resource] resource to be used in the waiting condition.
169
185
  #
170
- # @yield param [Resource] resource to be used in the waiting condition
171
- #
172
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
173
- # because the waiter has entered a state that it will not transition
174
- # 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.
175
189
  #
176
190
  # yet successful.
177
191
  #
178
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
179
- # 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.
180
194
  #
181
195
  # @raise [NotImplementedError] Raised when the resource does not
182
196
  #
@@ -212,14 +226,23 @@ module Aws::S3
212
226
  #
213
227
  # multipart_upload.abort({
214
228
  # request_payer: "requester", # accepts requester
229
+ # expected_bucket_owner: "AccountId",
215
230
  # })
216
231
  # @param [Hash] options ({})
217
232
  # @option options [String] :request_payer
218
- # Confirms that the requester knows that she or he will be charged for
219
- # the request. Bucket owners need not specify this parameter in their
220
- # requests. Documentation on downloading objects from requester pays
221
- # buckets can be found at
222
- # 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).
223
246
  # @return [Types::AbortMultipartUploadOutput]
224
247
  def abort(options = {})
225
248
  options = options.merge(
@@ -238,20 +261,108 @@ module Aws::S3
238
261
  # parts: [
239
262
  # {
240
263
  # etag: "ETag",
264
+ # checksum_crc32: "ChecksumCRC32",
265
+ # checksum_crc32c: "ChecksumCRC32C",
266
+ # checksum_sha1: "ChecksumSHA1",
267
+ # checksum_sha256: "ChecksumSHA256",
241
268
  # part_number: 1,
242
269
  # },
243
270
  # ],
244
271
  # },
272
+ # checksum_crc32: "ChecksumCRC32",
273
+ # checksum_crc32c: "ChecksumCRC32C",
274
+ # checksum_sha1: "ChecksumSHA1",
275
+ # checksum_sha256: "ChecksumSHA256",
245
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",
246
281
  # })
247
282
  # @param [Hash] options ({})
248
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
249
325
  # @option options [String] :request_payer
250
- # Confirms that the requester knows that she or he will be charged for
251
- # the request. Bucket owners need not specify this parameter in their
252
- # requests. Documentation on downloading objects from requester pays
253
- # buckets can be found at
254
- # 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
255
366
  # @return [Object]
256
367
  def complete(options = {})
257
368
  options = options.merge(
@@ -259,7 +370,7 @@ module Aws::S3
259
370
  key: @object_key,
260
371
  upload_id: @id
261
372
  )
262
- resp = @client.complete_multipart_upload(options)
373
+ @client.complete_multipart_upload(options)
263
374
  Object.new(
264
375
  bucket_name: @bucket_name,
265
376
  key: @object_key,
@@ -294,14 +405,53 @@ module Aws::S3
294
405
  #
295
406
  # parts = multipart_upload.parts({
296
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",
297
412
  # })
298
413
  # @param [Hash] options ({})
299
414
  # @option options [String] :request_payer
300
- # Confirms that the requester knows that she or he will be charged for
301
- # the request. Bucket owners need not specify this parameter in their
302
- # requests. Documentation on downloading objects from requester pays
303
- # buckets can be found at
304
- # 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
305
455
  # @return [MultipartUploadPart::Collection]
306
456
  def parts(options = {})
307
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