aws-sdk-s3 1.17.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 +393 -75
  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 +47 -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 -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 +11474 -2521
  23. data/lib/aws-sdk-s3/client_api.rb +1074 -4
  24. data/lib/aws-sdk-s3/customizations/bucket.rb +60 -17
  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 +11 -3
  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 +21 -8
  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 +237 -44
  69. data/lib/aws-sdk-s3/object.rb +899 -154
  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 +651 -139
  74. data/lib/aws-sdk-s3/object_version.rb +167 -65
  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 -27
  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 +169 -63
  96. data/lib/aws-sdk-s3/resource.rb +45 -5
  97. data/lib/aws-sdk-s3/types.rb +9872 -1303
  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 Bucket
10
13
 
11
14
  extend Aws::Deprecations
@@ -21,6 +24,7 @@ module Aws::S3
21
24
  @name = extract_name(args, options)
22
25
  @data = options.delete(:data)
23
26
  @client = options.delete(:client) || Client.new(options)
27
+ @waiter_block_warned = false
24
28
  end
25
29
 
26
30
  # @!group Read-Only Attributes
@@ -30,7 +34,8 @@ module Aws::S3
30
34
  @name
31
35
  end
32
36
 
33
- # Date the bucket was created.
37
+ # Date the bucket was created. This date can change when making changes
38
+ # to your bucket, such as editing its bucket policy.
34
39
  # @return [Time]
35
40
  def creation_date
36
41
  data[:creation_date]
@@ -86,10 +91,10 @@ module Aws::S3
86
91
  # @option options [Proc] :before_attempt
87
92
  # @option options [Proc] :before_wait
88
93
  # @return [Bucket]
89
- def wait_until_exists(options = {})
94
+ def wait_until_exists(options = {}, &block)
90
95
  options, params = separate_params_and_options(options)
91
96
  waiter = Waiters::BucketExists.new(options)
92
- yield_waiter_and_warn(waiter, &Proc.new) if block_given?
97
+ yield_waiter_and_warn(waiter, &block) if block_given?
93
98
  waiter.wait(params.merge(bucket: @name))
94
99
  Bucket.new({
95
100
  name: @name,
@@ -103,10 +108,10 @@ module Aws::S3
103
108
  # @option options [Proc] :before_attempt
104
109
  # @option options [Proc] :before_wait
105
110
  # @return [Bucket]
106
- def wait_until_not_exists(options = {})
111
+ def wait_until_not_exists(options = {}, &block)
107
112
  options, params = separate_params_and_options(options)
108
113
  waiter = Waiters::BucketNotExists.new(options)
109
- yield_waiter_and_warn(waiter, &Proc.new) if block_given?
114
+ yield_waiter_and_warn(waiter, &block) if block_given?
110
115
  waiter.wait(params.merge(bucket: @name))
111
116
  Bucket.new({
112
117
  name: @name,
@@ -119,7 +124,8 @@ module Aws::S3
119
124
  # Waiter polls an API operation until a resource enters a desired
120
125
  # state.
121
126
  #
122
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
127
+ # @note The waiting operation is performed on a copy. The original resource
128
+ # remains unchanged.
123
129
  #
124
130
  # ## Basic Usage
125
131
  #
@@ -132,13 +138,15 @@ module Aws::S3
132
138
  #
133
139
  # ## Example
134
140
  #
135
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
141
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
142
+ # instance.state.name == 'running'
143
+ # end
136
144
  #
137
145
  # ## Configuration
138
146
  #
139
147
  # You can configure the maximum number of polling attempts, and the
140
- # delay (in seconds) between each polling attempt. The waiting condition is set
141
- # by passing a block to {#wait_until}:
148
+ # delay (in seconds) between each polling attempt. The waiting condition is
149
+ # set by passing a block to {#wait_until}:
142
150
  #
143
151
  # # poll for ~25 seconds
144
152
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -169,17 +177,16 @@ module Aws::S3
169
177
  # # resource did not enter the desired state in time
170
178
  # end
171
179
  #
180
+ # @yieldparam [Resource] resource to be used in the waiting condition.
172
181
  #
173
- # @yield param [Resource] resource to be used in the waiting condition
174
- #
175
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
176
- # because the waiter has entered a state that it will not transition
177
- # out of, preventing success.
182
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
183
+ # terminates because the waiter has entered a state that it will not
184
+ # transition out of, preventing success.
178
185
  #
179
186
  # yet successful.
180
187
  #
181
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
182
- # while polling for a resource that is not expected.
188
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
189
+ # encountered while polling for a resource that is not expected.
183
190
  #
184
191
  # @raise [NotImplementedError] Raised when the resource does not
185
192
  #
@@ -216,18 +223,21 @@ module Aws::S3
216
223
  # bucket.create({
217
224
  # acl: "private", # accepts private, public-read, public-read-write, authenticated-read
218
225
  # create_bucket_configuration: {
219
- # location_constraint: "EU", # accepts EU, eu-west-1, us-west-1, us-west-2, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, sa-east-1, cn-north-1, eu-central-1
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
220
227
  # },
221
228
  # grant_full_control: "GrantFullControl",
222
229
  # grant_read: "GrantRead",
223
230
  # grant_read_acp: "GrantReadACP",
224
231
  # grant_write: "GrantWrite",
225
232
  # grant_write_acp: "GrantWriteACP",
233
+ # object_lock_enabled_for_bucket: false,
234
+ # object_ownership: "BucketOwnerPreferred", # accepts BucketOwnerPreferred, ObjectWriter, BucketOwnerEnforced
226
235
  # })
227
236
  # @param [Hash] options ({})
228
237
  # @option options [String] :acl
229
238
  # The canned ACL to apply to the bucket.
230
239
  # @option options [Types::CreateBucketConfiguration] :create_bucket_configuration
240
+ # The configuration information for the bucket.
231
241
  # @option options [String] :grant_full_control
232
242
  # Allows grantee the read, write, read ACP, and write ACP permissions on
233
243
  # the bucket.
@@ -236,10 +246,32 @@ module Aws::S3
236
246
  # @option options [String] :grant_read_acp
237
247
  # Allows grantee to read the bucket ACL.
238
248
  # @option options [String] :grant_write
239
- # Allows grantee to create, overwrite, and delete any object in the
240
- # bucket.
249
+ # Allows grantee to create new objects in the bucket.
250
+ #
251
+ # For the bucket and object owners of existing objects, also allows
252
+ # deletions and overwrites of those objects.
241
253
  # @option options [String] :grant_write_acp
242
254
  # Allows grantee to write the ACL for the applicable bucket.
255
+ # @option options [Boolean] :object_lock_enabled_for_bucket
256
+ # Specifies whether you want S3 Object Lock to be enabled for the new
257
+ # bucket.
258
+ # @option options [String] :object_ownership
259
+ # The container element for object ownership for a bucket's ownership
260
+ # controls.
261
+ #
262
+ # BucketOwnerPreferred - Objects uploaded to the bucket change ownership
263
+ # to the bucket owner if the objects are uploaded with the
264
+ # `bucket-owner-full-control` canned ACL.
265
+ #
266
+ # ObjectWriter - The uploading account will own the object if the object
267
+ # is uploaded with the `bucket-owner-full-control` canned ACL.
268
+ #
269
+ # BucketOwnerEnforced - Access control lists (ACLs) are disabled and no
270
+ # longer affect permissions. The bucket owner automatically owns and has
271
+ # full control over every object in the bucket. The bucket only accepts
272
+ # PUT requests that don't specify an ACL or bucket owner full control
273
+ # ACLs, such as the `bucket-owner-full-control` canned ACL or an
274
+ # equivalent form of this ACL expressed in the XML format.
243
275
  # @return [Types::CreateBucketOutput]
244
276
  def create(options = {})
245
277
  options = options.merge(bucket: @name)
@@ -249,8 +281,14 @@ module Aws::S3
249
281
 
250
282
  # @example Request syntax with placeholder values
251
283
  #
252
- # bucket.delete()
284
+ # bucket.delete({
285
+ # expected_bucket_owner: "AccountId",
286
+ # })
253
287
  # @param [Hash] options ({})
288
+ # @option options [String] :expected_bucket_owner
289
+ # The account ID of the expected bucket owner. If the bucket is owned by
290
+ # a different account, the request fails with the HTTP status code `403
291
+ # Forbidden` (access denied).
254
292
  # @return [EmptyStructure]
255
293
  def delete(options = {})
256
294
  options = options.merge(bucket: @name)
@@ -272,18 +310,54 @@ module Aws::S3
272
310
  # },
273
311
  # mfa: "MFA",
274
312
  # request_payer: "requester", # accepts requester
313
+ # bypass_governance_retention: false,
314
+ # expected_bucket_owner: "AccountId",
315
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
275
316
  # })
276
317
  # @param [Hash] options ({})
277
318
  # @option options [required, Types::Delete] :delete
319
+ # Container for the request.
278
320
  # @option options [String] :mfa
279
321
  # The concatenation of the authentication device's serial number, a
280
322
  # space, and the value that is displayed on your authentication device.
323
+ # Required to permanently delete a versioned object if versioning is
324
+ # configured with MFA delete enabled.
281
325
  # @option options [String] :request_payer
282
- # Confirms that the requester knows that she or he will be charged for
283
- # the request. Bucket owners need not specify this parameter in their
284
- # requests. Documentation on downloading objects from requester pays
285
- # buckets can be found at
286
- # 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 [Boolean] :bypass_governance_retention
336
+ # Specifies whether you want to delete this object even if it has a
337
+ # Governance-type Object Lock in place. To use this header, you must
338
+ # have the `s3:BypassGovernanceRetention` permission.
339
+ # @option options [String] :expected_bucket_owner
340
+ # The account ID of the expected bucket owner. If the bucket is owned by
341
+ # a different account, the request fails with the HTTP status code `403
342
+ # Forbidden` (access denied).
343
+ # @option options [String] :checksum_algorithm
344
+ # Indicates the algorithm used to create the checksum for the object
345
+ # when using the SDK. This header will not provide any additional
346
+ # functionality if not using the SDK. When sending this header, there
347
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
348
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
349
+ # `400 Bad Request`. For more information, see [Checking object
350
+ # integrity][1] in the *Amazon S3 User Guide*.
351
+ #
352
+ # If you provide an individual checksum, Amazon S3 ignores any provided
353
+ # `ChecksumAlgorithm` parameter.
354
+ #
355
+ # This checksum algorithm must be the same for all parts and it match
356
+ # the checksum value supplied in the `CreateMultipartUpload` request.
357
+ #
358
+ #
359
+ #
360
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
287
361
  # @return [Types::DeleteObjectsOutput]
288
362
  def delete_objects(options = {})
289
363
  options = options.merge(bucket: @name)
@@ -303,6 +377,11 @@ module Aws::S3
303
377
  # content_length: 1,
304
378
  # content_md5: "ContentMD5",
305
379
  # content_type: "ContentType",
380
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
381
+ # checksum_crc32: "ChecksumCRC32",
382
+ # checksum_crc32c: "ChecksumCRC32C",
383
+ # checksum_sha1: "ChecksumSHA1",
384
+ # checksum_sha256: "ChecksumSHA256",
306
385
  # expires: Time.now,
307
386
  # grant_full_control: "GrantFullControl",
308
387
  # grant_read: "GrantRead",
@@ -313,93 +392,279 @@ module Aws::S3
313
392
  # "MetadataKey" => "MetadataValue",
314
393
  # },
315
394
  # server_side_encryption: "AES256", # accepts AES256, aws:kms
316
- # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA
395
+ # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE, OUTPOSTS, GLACIER_IR
317
396
  # website_redirect_location: "WebsiteRedirectLocation",
318
397
  # sse_customer_algorithm: "SSECustomerAlgorithm",
319
398
  # sse_customer_key: "SSECustomerKey",
320
399
  # sse_customer_key_md5: "SSECustomerKeyMD5",
321
400
  # ssekms_key_id: "SSEKMSKeyId",
401
+ # ssekms_encryption_context: "SSEKMSEncryptionContext",
402
+ # bucket_key_enabled: false,
322
403
  # request_payer: "requester", # accepts requester
323
404
  # tagging: "TaggingHeader",
405
+ # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE
406
+ # object_lock_retain_until_date: Time.now,
407
+ # object_lock_legal_hold_status: "ON", # accepts ON, OFF
408
+ # expected_bucket_owner: "AccountId",
324
409
  # })
325
410
  # @param [Hash] options ({})
326
411
  # @option options [String] :acl
327
- # The canned ACL to apply to the object.
328
- # @option options [String, IO] :body
412
+ # The canned ACL to apply to the object. For more information, see
413
+ # [Canned ACL][1].
414
+ #
415
+ # This action is not supported by Amazon S3 on Outposts.
416
+ #
417
+ #
418
+ #
419
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL
420
+ # @option options [String, StringIO, File] :body
329
421
  # Object data.
330
422
  # @option options [String] :cache_control
331
- # Specifies caching behavior along the request/reply chain.
423
+ # Can be used to specify caching behavior along the request/reply chain.
424
+ # For more information, see
425
+ # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9][1].
426
+ #
427
+ #
428
+ #
429
+ # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
332
430
  # @option options [String] :content_disposition
333
- # Specifies presentational information for the object.
431
+ # Specifies presentational information for the object. For more
432
+ # information, see
433
+ # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1][1].
434
+ #
435
+ #
436
+ #
437
+ # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
334
438
  # @option options [String] :content_encoding
335
439
  # Specifies what content encodings have been applied to the object and
336
440
  # thus what decoding mechanisms must be applied to obtain the media-type
337
- # referenced by the Content-Type header field.
441
+ # referenced by the Content-Type header field. For more information, see
442
+ # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11][1].
443
+ #
444
+ #
445
+ #
446
+ # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
338
447
  # @option options [String] :content_language
339
448
  # The language the content is in.
340
449
  # @option options [Integer] :content_length
341
450
  # Size of the body in bytes. This parameter is useful when the size of
342
- # the body cannot be determined automatically.
451
+ # the body cannot be determined automatically. For more information, see
452
+ # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13][1].
453
+ #
454
+ #
455
+ #
456
+ # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
343
457
  # @option options [String] :content_md5
344
- # The base64-encoded 128-bit MD5 digest of the part data.
458
+ # The base64-encoded 128-bit MD5 digest of the message (without the
459
+ # headers) according to RFC 1864. This header can be used as a message
460
+ # integrity check to verify that the data is the same data that was
461
+ # originally sent. Although it is optional, we recommend using the
462
+ # Content-MD5 mechanism as an end-to-end integrity check. For more
463
+ # information about REST request authentication, see [REST
464
+ # Authentication][1].
465
+ #
466
+ #
467
+ #
468
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
345
469
  # @option options [String] :content_type
346
- # A standard MIME type describing the format of the object data.
470
+ # A standard MIME type describing the format of the contents. For more
471
+ # information, see
472
+ # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17][1].
473
+ #
474
+ #
475
+ #
476
+ # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
477
+ # @option options [String] :checksum_algorithm
478
+ # Indicates the algorithm used to create the checksum for the object
479
+ # when using the SDK. This header will not provide any additional
480
+ # functionality if not using the SDK. When sending this header, there
481
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
482
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
483
+ # `400 Bad Request`. For more information, see [Checking object
484
+ # integrity][1] in the *Amazon S3 User Guide*.
485
+ #
486
+ # If you provide an individual checksum, Amazon S3 ignores any provided
487
+ # `ChecksumAlgorithm` parameter.
488
+ #
489
+ #
490
+ #
491
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
492
+ # @option options [String] :checksum_crc32
493
+ # This header can be used as a data integrity check to verify that the
494
+ # data received is the same data that was originally sent. This header
495
+ # specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
496
+ # more information, see [Checking object integrity][1] in the *Amazon S3
497
+ # User Guide*.
498
+ #
499
+ #
500
+ #
501
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
502
+ # @option options [String] :checksum_crc32c
503
+ # This header can be used as a data integrity check to verify that the
504
+ # data received is the same data that was originally sent. This header
505
+ # specifies the base64-encoded, 32-bit CRC32C checksum of the object.
506
+ # For more information, see [Checking object integrity][1] in the
507
+ # *Amazon S3 User Guide*.
508
+ #
509
+ #
510
+ #
511
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
512
+ # @option options [String] :checksum_sha1
513
+ # This header can be used as a data integrity check to verify that the
514
+ # data received is the same data that was originally sent. This header
515
+ # specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
516
+ # more information, see [Checking object integrity][1] in the *Amazon S3
517
+ # User Guide*.
518
+ #
519
+ #
520
+ #
521
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
522
+ # @option options [String] :checksum_sha256
523
+ # This header can be used as a data integrity check to verify that the
524
+ # data received is the same data that was originally sent. This header
525
+ # specifies the base64-encoded, 256-bit SHA-256 digest of the object.
526
+ # For more information, see [Checking object integrity][1] in the
527
+ # *Amazon S3 User Guide*.
528
+ #
529
+ #
530
+ #
531
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
347
532
  # @option options [Time,DateTime,Date,Integer,String] :expires
348
- # The date and time at which the object is no longer cacheable.
533
+ # The date and time at which the object is no longer cacheable. For more
534
+ # information, see
535
+ # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21][1].
536
+ #
537
+ #
538
+ #
539
+ # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21
349
540
  # @option options [String] :grant_full_control
350
541
  # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
351
542
  # object.
543
+ #
544
+ # This action is not supported by Amazon S3 on Outposts.
352
545
  # @option options [String] :grant_read
353
546
  # Allows grantee to read the object data and its metadata.
547
+ #
548
+ # This action is not supported by Amazon S3 on Outposts.
354
549
  # @option options [String] :grant_read_acp
355
550
  # Allows grantee to read the object ACL.
551
+ #
552
+ # This action is not supported by Amazon S3 on Outposts.
356
553
  # @option options [String] :grant_write_acp
357
554
  # Allows grantee to write the ACL for the applicable object.
555
+ #
556
+ # This action is not supported by Amazon S3 on Outposts.
358
557
  # @option options [required, String] :key
359
- # Object key for which the PUT operation was initiated.
558
+ # Object key for which the PUT action was initiated.
360
559
  # @option options [Hash<String,String>] :metadata
361
560
  # A map of metadata to store with the object in S3.
362
561
  # @option options [String] :server_side_encryption
363
- # The Server-side encryption algorithm used when storing this object in
364
- # S3 (e.g., AES256, aws:kms).
562
+ # The server-side encryption algorithm used when storing this object in
563
+ # Amazon S3 (for example, AES256, aws:kms).
365
564
  # @option options [String] :storage_class
366
- # The type of storage to use for the object. Defaults to 'STANDARD'.
565
+ # By default, Amazon S3 uses the STANDARD Storage Class to store newly
566
+ # created objects. The STANDARD storage class provides high durability
567
+ # and high availability. Depending on performance needs, you can specify
568
+ # a different Storage Class. Amazon S3 on Outposts only uses the
569
+ # OUTPOSTS Storage Class. For more information, see [Storage Classes][1]
570
+ # in the *Amazon S3 User Guide*.
571
+ #
572
+ #
573
+ #
574
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html
367
575
  # @option options [String] :website_redirect_location
368
576
  # If the bucket is configured as a website, redirects requests for this
369
577
  # object to another object in the same bucket or to an external URL.
370
- # Amazon S3 stores the value of this header in the object metadata.
578
+ # Amazon S3 stores the value of this header in the object metadata. For
579
+ # information about object metadata, see [Object Key and Metadata][1].
580
+ #
581
+ # In the following example, the request header sets the redirect to an
582
+ # object (anotherPage.html) in the same bucket:
583
+ #
584
+ # `x-amz-website-redirect-location: /anotherPage.html`
585
+ #
586
+ # In the following example, the request header sets the object redirect
587
+ # to another website:
588
+ #
589
+ # `x-amz-website-redirect-location: http://www.example.com/`
590
+ #
591
+ # For more information about website hosting in Amazon S3, see [Hosting
592
+ # Websites on Amazon S3][2] and [How to Configure Website Page
593
+ # Redirects][3].
594
+ #
595
+ #
596
+ #
597
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html
598
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
599
+ # [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html
371
600
  # @option options [String] :sse_customer_algorithm
372
- # Specifies the algorithm to use to when encrypting the object (e.g.,
373
- # AES256).
601
+ # Specifies the algorithm to use to when encrypting the object (for
602
+ # example, AES256).
374
603
  # @option options [String] :sse_customer_key
375
604
  # Specifies the customer-provided encryption key for Amazon S3 to use in
376
605
  # encrypting data. This value is used to store the object and then it is
377
- # discarded; Amazon does not store the encryption key. The key must be
378
- # appropriate for use with the algorithm specified in the
379
- # x-amz-server-side​-encryption​-customer-algorithm header.
606
+ # discarded; Amazon S3 does not store the encryption key. The key must
607
+ # be appropriate for use with the algorithm specified in the
608
+ # `x-amz-server-side-encryption-customer-algorithm` header.
380
609
  # @option options [String] :sse_customer_key_md5
381
610
  # Specifies the 128-bit MD5 digest of the encryption key according to
382
611
  # RFC 1321. Amazon S3 uses this header for a message integrity check to
383
- # ensure the encryption key was transmitted without error.
612
+ # ensure that the encryption key was transmitted without error.
384
613
  # @option options [String] :ssekms_key_id
385
- # Specifies the AWS KMS key ID to use for object encryption. All GET and
386
- # PUT requests for an object protected by AWS KMS will fail if not made
387
- # via SSL or using SigV4. Documentation on configuring any of the
388
- # officially supported AWS SDKs and CLI can be found at
389
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
614
+ # If `x-amz-server-side-encryption` is present and has the value of
615
+ # `aws:kms`, this header specifies the ID of the Amazon Web Services Key
616
+ # Management Service (Amazon Web Services KMS) symmetrical customer
617
+ # managed key that was used for the object. If you specify
618
+ # `x-amz-server-side-encryption:aws:kms`, but do not provide`
619
+ # x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the
620
+ # Amazon Web Services managed key to protect the data. If the KMS key
621
+ # does not exist in the same account issuing the command, you must use
622
+ # the full ARN and not just the ID.
623
+ # @option options [String] :ssekms_encryption_context
624
+ # Specifies the Amazon Web Services KMS Encryption Context to use for
625
+ # object encryption. The value of this header is a base64-encoded UTF-8
626
+ # string holding JSON with the encryption context key-value pairs.
627
+ # @option options [Boolean] :bucket_key_enabled
628
+ # Specifies whether Amazon S3 should use an S3 Bucket Key for object
629
+ # encryption with server-side encryption using AWS KMS (SSE-KMS).
630
+ # Setting this header to `true` causes Amazon S3 to use an S3 Bucket Key
631
+ # for object encryption with SSE-KMS.
632
+ #
633
+ # Specifying this header with a PUT action doesn’t affect bucket-level
634
+ # settings for S3 Bucket Key.
390
635
  # @option options [String] :request_payer
391
- # Confirms that the requester knows that she or he will be charged for
392
- # the request. Bucket owners need not specify this parameter in their
393
- # requests. Documentation on downloading objects from requester pays
394
- # buckets can be found at
395
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
636
+ # Confirms that the requester knows that they will be charged for the
637
+ # request. Bucket owners need not specify this parameter in their
638
+ # requests. For information about downloading objects from Requester
639
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
640
+ # in the *Amazon S3 User Guide*.
641
+ #
642
+ #
643
+ #
644
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
396
645
  # @option options [String] :tagging
397
646
  # The tag-set for the object. The tag-set must be encoded as URL Query
398
- # parameters
647
+ # parameters. (For example, "Key1=Value1")
648
+ # @option options [String] :object_lock_mode
649
+ # The Object Lock mode that you want to apply to this object.
650
+ # @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date
651
+ # The date and time when you want this object's Object Lock to expire.
652
+ # Must be formatted as a timestamp parameter.
653
+ # @option options [String] :object_lock_legal_hold_status
654
+ # Specifies whether a legal hold will be applied to this object. For
655
+ # more information about S3 Object Lock, see [Object Lock][1].
656
+ #
657
+ #
658
+ #
659
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html
660
+ # @option options [String] :expected_bucket_owner
661
+ # The account ID of the expected bucket owner. If the bucket is owned by
662
+ # a different account, the request fails with the HTTP status code `403
663
+ # Forbidden` (access denied).
399
664
  # @return [Object]
400
665
  def put_object(options = {})
401
666
  options = options.merge(bucket: @name)
402
- resp = @client.put_object(options)
667
+ @client.put_object(options)
403
668
  Object.new(
404
669
  bucket_name: @name,
405
670
  key: options[:key],
@@ -457,10 +722,18 @@ module Aws::S3
457
722
  # key_marker: "KeyMarker",
458
723
  # prefix: "Prefix",
459
724
  # upload_id_marker: "UploadIdMarker",
725
+ # expected_bucket_owner: "AccountId",
460
726
  # })
461
727
  # @param [Hash] options ({})
462
728
  # @option options [String] :delimiter
463
729
  # Character you use to group keys.
730
+ #
731
+ # All keys that contain the same string between the prefix, if
732
+ # specified, and the first occurrence of the delimiter after the prefix
733
+ # are grouped under a single result element, `CommonPrefixes`. If you
734
+ # don't specify the prefix parameter, then the substring starts at the
735
+ # beginning of the key. The keys that are grouped under `CommonPrefixes`
736
+ # result element are not returned elsewhere in the response.
464
737
  # @option options [String] :encoding_type
465
738
  # Requests Amazon S3 to encode the object keys in the response and
466
739
  # specifies the encoding method to use. An object key may contain any
@@ -471,13 +744,31 @@ module Aws::S3
471
744
  # @option options [String] :key_marker
472
745
  # Together with upload-id-marker, this parameter specifies the multipart
473
746
  # upload after which listing should begin.
747
+ #
748
+ # If `upload-id-marker` is not specified, only the keys
749
+ # lexicographically greater than the specified `key-marker` will be
750
+ # included in the list.
751
+ #
752
+ # If `upload-id-marker` is specified, any multipart uploads for a key
753
+ # equal to the `key-marker` might also be included, provided those
754
+ # multipart uploads have upload IDs lexicographically greater than the
755
+ # specified `upload-id-marker`.
474
756
  # @option options [String] :prefix
475
757
  # Lists in-progress uploads only for those keys that begin with the
476
- # specified prefix.
758
+ # specified prefix. You can use prefixes to separate a bucket into
759
+ # different grouping of keys. (You can think of using prefix to make
760
+ # groups in the same way you'd use a folder in a file system.)
477
761
  # @option options [String] :upload_id_marker
478
762
  # Together with key-marker, specifies the multipart upload after which
479
763
  # listing should begin. If key-marker is not specified, the
480
- # upload-id-marker parameter is ignored.
764
+ # upload-id-marker parameter is ignored. Otherwise, any multipart
765
+ # uploads for a key equal to the key-marker might be included in the
766
+ # list only if they have an upload ID lexicographically greater than the
767
+ # specified `upload-id-marker`.
768
+ # @option options [String] :expected_bucket_owner
769
+ # The account ID of the expected bucket owner. If the bucket is owned by
770
+ # a different account, the request fails with the HTTP status code `403
771
+ # Forbidden` (access denied).
481
772
  # @return [MultipartUpload::Collection]
482
773
  def multipart_uploads(options = {})
483
774
  batches = Enumerator.new do |y|
@@ -526,10 +817,16 @@ module Aws::S3
526
817
  # key_marker: "KeyMarker",
527
818
  # prefix: "Prefix",
528
819
  # version_id_marker: "VersionIdMarker",
820
+ # expected_bucket_owner: "AccountId",
529
821
  # })
530
822
  # @param [Hash] options ({})
531
823
  # @option options [String] :delimiter
532
- # A delimiter is a character you use to group keys.
824
+ # A delimiter is a character that you specify to group keys. All keys
825
+ # that contain the same string between the `prefix` and the first
826
+ # occurrence of the delimiter are grouped under a single result element
827
+ # in CommonPrefixes. These groups are counted as one result against the
828
+ # max-keys limitation. These keys are not returned elsewhere in the
829
+ # response.
533
830
  # @option options [String] :encoding_type
534
831
  # Requests Amazon S3 to encode the object keys in the response and
535
832
  # specifies the encoding method to use. An object key may contain any
@@ -540,9 +837,18 @@ module Aws::S3
540
837
  # @option options [String] :key_marker
541
838
  # Specifies the key to start with when listing objects in a bucket.
542
839
  # @option options [String] :prefix
543
- # Limits the response to keys that begin with the specified prefix.
840
+ # Use this parameter to select only those keys that begin with the
841
+ # specified prefix. You can use prefixes to separate a bucket into
842
+ # different groupings of keys. (You can think of using prefix to make
843
+ # groups in the same way you'd use a folder in a file system.) You can
844
+ # use prefix with delimiter to roll up numerous objects into a single
845
+ # result under CommonPrefixes.
544
846
  # @option options [String] :version_id_marker
545
847
  # Specifies the object version you want to start listing from.
848
+ # @option options [String] :expected_bucket_owner
849
+ # The account ID of the expected bucket owner. If the bucket is owned by
850
+ # a different account, the request fails with the HTTP status code `403
851
+ # Forbidden` (access denied).
546
852
  # @return [ObjectVersion::Collection]
547
853
  def object_versions(options = {})
548
854
  batches = Enumerator.new do |y|
@@ -571,29 +877,39 @@ module Aws::S3
571
877
  # delimiter: "Delimiter",
572
878
  # encoding_type: "url", # accepts url
573
879
  # prefix: "Prefix",
880
+ # fetch_owner: false,
881
+ # start_after: "StartAfter",
574
882
  # request_payer: "requester", # accepts requester
883
+ # expected_bucket_owner: "AccountId",
575
884
  # })
576
885
  # @param [Hash] options ({})
577
886
  # @option options [String] :delimiter
578
887
  # A delimiter is a character you use to group keys.
579
888
  # @option options [String] :encoding_type
580
- # Requests Amazon S3 to encode the object keys in the response and
581
- # specifies the encoding method to use. An object key may contain any
582
- # Unicode character; however, XML 1.0 parser cannot parse some
583
- # characters, such as characters with an ASCII value from 0 to 10. For
584
- # characters that are not supported in XML 1.0, you can add this
585
- # parameter to request that Amazon S3 encode the keys in the response.
889
+ # Encoding type used by Amazon S3 to encode object keys in the response.
586
890
  # @option options [String] :prefix
587
891
  # Limits the response to keys that begin with the specified prefix.
892
+ # @option options [Boolean] :fetch_owner
893
+ # The owner field is not present in listV2 by default, if you want to
894
+ # return owner field with each key in the result then set the fetch
895
+ # owner field to true.
896
+ # @option options [String] :start_after
897
+ # StartAfter is where you want Amazon S3 to start listing from. Amazon
898
+ # S3 starts listing after this specified key. StartAfter can be any key
899
+ # in the bucket.
588
900
  # @option options [String] :request_payer
589
901
  # Confirms that the requester knows that she or he will be charged for
590
- # the list objects request. Bucket owners need not specify this
591
- # parameter in their requests.
902
+ # the list objects request in V2 style. Bucket owners need not specify
903
+ # this parameter in their requests.
904
+ # @option options [String] :expected_bucket_owner
905
+ # The account ID of the expected bucket owner. If the bucket is owned by
906
+ # a different account, the request fails with the HTTP status code `403
907
+ # Forbidden` (access denied).
592
908
  # @return [ObjectSummary::Collection]
593
909
  def objects(options = {})
594
910
  batches = Enumerator.new do |y|
595
911
  options = options.merge(bucket: @name)
596
- resp = @client.list_objects(options)
912
+ resp = @client.list_objects_v2(options)
597
913
  resp.each_page do |page|
598
914
  batch = []
599
915
  page.data.contents.each do |c|
@@ -672,8 +988,8 @@ module Aws::S3
672
988
 
673
989
  def yield_waiter_and_warn(waiter, &block)
674
990
  if !@waiter_block_warned
675
- msg = "pass options to configure the waiter; "
676
- msg << "yielding the waiter is deprecated"
991
+ msg = "pass options to configure the waiter; "\
992
+ "yielding the waiter is deprecated"
677
993
  warn(msg)
678
994
  @waiter_block_warned = true
679
995
  end
@@ -681,7 +997,9 @@ module Aws::S3
681
997
  end
682
998
 
683
999
  def separate_params_and_options(options)
684
- opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
1000
+ opts = Set.new(
1001
+ [:client, :max_attempts, :delay, :before_attempt, :before_wait]
1002
+ )
685
1003
  waiter_opts = {}
686
1004
  waiter_params = {}
687
1005
  options.each_pair do |key, value|