aws-sdk-s3 1.48.0 → 1.183.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +1352 -0
  3. data/LICENSE.txt +202 -0
  4. data/VERSION +1 -0
  5. data/lib/aws-sdk-s3/access_grants_credentials.rb +57 -0
  6. data/lib/aws-sdk-s3/access_grants_credentials_provider.rb +250 -0
  7. data/lib/aws-sdk-s3/bucket.rb +1005 -106
  8. data/lib/aws-sdk-s3/bucket_acl.rb +65 -18
  9. data/lib/aws-sdk-s3/bucket_cors.rb +80 -18
  10. data/lib/aws-sdk-s3/bucket_lifecycle.rb +71 -20
  11. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +126 -21
  12. data/lib/aws-sdk-s3/bucket_logging.rb +68 -16
  13. data/lib/aws-sdk-s3/bucket_notification.rb +52 -20
  14. data/lib/aws-sdk-s3/bucket_policy.rb +108 -17
  15. data/lib/aws-sdk-s3/bucket_region_cache.rb +11 -5
  16. data/lib/aws-sdk-s3/bucket_request_payment.rb +60 -15
  17. data/lib/aws-sdk-s3/bucket_tagging.rb +71 -18
  18. data/lib/aws-sdk-s3/bucket_versioning.rb +133 -17
  19. data/lib/aws-sdk-s3/bucket_website.rb +78 -21
  20. data/lib/aws-sdk-s3/client.rb +14517 -941
  21. data/lib/aws-sdk-s3/client_api.rb +1296 -197
  22. data/lib/aws-sdk-s3/customizations/bucket.rb +56 -37
  23. data/lib/aws-sdk-s3/customizations/errors.rb +40 -0
  24. data/lib/aws-sdk-s3/customizations/multipart_upload.rb +2 -0
  25. data/lib/aws-sdk-s3/customizations/object.rb +288 -68
  26. data/lib/aws-sdk-s3/customizations/object_summary.rb +10 -0
  27. data/lib/aws-sdk-s3/customizations/object_version.rb +13 -0
  28. data/lib/aws-sdk-s3/customizations/types/list_object_versions_output.rb +2 -0
  29. data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
  30. data/lib/aws-sdk-s3/customizations.rb +27 -28
  31. data/lib/aws-sdk-s3/encryption/client.rb +28 -7
  32. data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +71 -29
  33. data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +43 -5
  34. data/lib/aws-sdk-s3/encryption/default_key_provider.rb +2 -0
  35. data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +13 -2
  36. data/lib/aws-sdk-s3/encryption/errors.rb +2 -0
  37. data/lib/aws-sdk-s3/encryption/io_auth_decrypter.rb +2 -0
  38. data/lib/aws-sdk-s3/encryption/io_decrypter.rb +11 -3
  39. data/lib/aws-sdk-s3/encryption/io_encrypter.rb +2 -0
  40. data/lib/aws-sdk-s3/encryption/key_provider.rb +2 -0
  41. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +46 -11
  42. data/lib/aws-sdk-s3/encryption/materials.rb +8 -6
  43. data/lib/aws-sdk-s3/encryption/utils.rb +25 -0
  44. data/lib/aws-sdk-s3/encryption.rb +4 -0
  45. data/lib/aws-sdk-s3/encryptionV2/client.rb +570 -0
  46. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +223 -0
  47. data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +170 -0
  48. data/lib/aws-sdk-s3/encryptionV2/default_key_provider.rb +40 -0
  49. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +65 -0
  50. data/lib/aws-sdk-s3/encryptionV2/errors.rb +37 -0
  51. data/lib/aws-sdk-s3/encryptionV2/io_auth_decrypter.rb +58 -0
  52. data/lib/aws-sdk-s3/encryptionV2/io_decrypter.rb +37 -0
  53. data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +73 -0
  54. data/lib/aws-sdk-s3/encryptionV2/key_provider.rb +31 -0
  55. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +173 -0
  56. data/lib/aws-sdk-s3/encryptionV2/materials.rb +60 -0
  57. data/lib/aws-sdk-s3/encryptionV2/utils.rb +103 -0
  58. data/lib/aws-sdk-s3/encryption_v2.rb +23 -0
  59. data/lib/aws-sdk-s3/endpoint_parameters.rb +181 -0
  60. data/lib/aws-sdk-s3/endpoint_provider.rb +716 -0
  61. data/lib/aws-sdk-s3/endpoints.rb +1434 -0
  62. data/lib/aws-sdk-s3/errors.rb +170 -1
  63. data/lib/aws-sdk-s3/event_streams.rb +8 -1
  64. data/lib/aws-sdk-s3/express_credentials.rb +55 -0
  65. data/lib/aws-sdk-s3/express_credentials_provider.rb +59 -0
  66. data/lib/aws-sdk-s3/file_downloader.rb +161 -46
  67. data/lib/aws-sdk-s3/file_part.rb +11 -6
  68. data/lib/aws-sdk-s3/file_uploader.rb +39 -18
  69. data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
  70. data/lib/aws-sdk-s3/multipart_file_uploader.rb +104 -27
  71. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +61 -21
  72. data/lib/aws-sdk-s3/multipart_upload.rb +342 -32
  73. data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
  74. data/lib/aws-sdk-s3/multipart_upload_part.rb +384 -46
  75. data/lib/aws-sdk-s3/object.rb +2600 -231
  76. data/lib/aws-sdk-s3/object_acl.rb +103 -25
  77. data/lib/aws-sdk-s3/object_copier.rb +9 -5
  78. data/lib/aws-sdk-s3/object_multipart_copier.rb +48 -22
  79. data/lib/aws-sdk-s3/object_summary.rb +2174 -204
  80. data/lib/aws-sdk-s3/object_version.rb +539 -80
  81. data/lib/aws-sdk-s3/plugins/accelerate.rb +17 -64
  82. data/lib/aws-sdk-s3/plugins/access_grants.rb +178 -0
  83. data/lib/aws-sdk-s3/plugins/arn.rb +70 -0
  84. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +7 -43
  85. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +20 -3
  86. data/lib/aws-sdk-s3/plugins/checksum_algorithm.rb +31 -0
  87. data/lib/aws-sdk-s3/plugins/dualstack.rb +7 -50
  88. data/lib/aws-sdk-s3/plugins/endpoints.rb +86 -0
  89. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +5 -4
  90. data/lib/aws-sdk-s3/plugins/express_session_auth.rb +88 -0
  91. data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
  92. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +62 -17
  93. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +44 -0
  94. data/lib/aws-sdk-s3/plugins/location_constraint.rb +5 -1
  95. data/lib/aws-sdk-s3/plugins/md5s.rb +14 -70
  96. data/lib/aws-sdk-s3/plugins/redirects.rb +2 -0
  97. data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
  98. data/lib/aws-sdk-s3/plugins/s3_signer.rb +63 -94
  99. data/lib/aws-sdk-s3/plugins/sse_cpk.rb +3 -1
  100. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +139 -0
  101. data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -0
  102. data/lib/aws-sdk-s3/presigned_post.rb +160 -99
  103. data/lib/aws-sdk-s3/presigner.rb +141 -62
  104. data/lib/aws-sdk-s3/resource.rb +156 -17
  105. data/lib/aws-sdk-s3/types.rb +13021 -4106
  106. data/lib/aws-sdk-s3/waiters.rb +67 -1
  107. data/lib/aws-sdk-s3.rb +46 -32
  108. data/sig/bucket.rbs +222 -0
  109. data/sig/bucket_acl.rbs +78 -0
  110. data/sig/bucket_cors.rbs +69 -0
  111. data/sig/bucket_lifecycle.rbs +88 -0
  112. data/sig/bucket_lifecycle_configuration.rbs +115 -0
  113. data/sig/bucket_logging.rbs +76 -0
  114. data/sig/bucket_notification.rbs +114 -0
  115. data/sig/bucket_policy.rbs +59 -0
  116. data/sig/bucket_request_payment.rbs +54 -0
  117. data/sig/bucket_tagging.rbs +65 -0
  118. data/sig/bucket_versioning.rbs +77 -0
  119. data/sig/bucket_website.rbs +93 -0
  120. data/sig/client.rbs +2472 -0
  121. data/sig/customizations/bucket.rbs +19 -0
  122. data/sig/customizations/object.rbs +38 -0
  123. data/sig/customizations/object_summary.rbs +35 -0
  124. data/sig/errors.rbs +42 -0
  125. data/sig/multipart_upload.rbs +120 -0
  126. data/sig/multipart_upload_part.rbs +109 -0
  127. data/sig/object.rbs +459 -0
  128. data/sig/object_acl.rbs +86 -0
  129. data/sig/object_summary.rbs +345 -0
  130. data/sig/object_version.rbs +143 -0
  131. data/sig/resource.rbs +134 -0
  132. data/sig/types.rbs +2712 -0
  133. data/sig/waiters.rbs +95 -0
  134. metadata +74 -15
@@ -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,12 +34,21 @@ 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]
37
42
  end
38
43
 
44
+ # `BucketRegion` indicates the Amazon Web Services region where the
45
+ # bucket is located. If the request contains at least one valid
46
+ # parameter, it is included in the response.
47
+ # @return [String]
48
+ def bucket_region
49
+ data[:bucket_region]
50
+ end
51
+
39
52
  # @!endgroup
40
53
 
41
54
  # @return [Client]
@@ -90,7 +103,9 @@ module Aws::S3
90
103
  options, params = separate_params_and_options(options)
91
104
  waiter = Waiters::BucketExists.new(options)
92
105
  yield_waiter_and_warn(waiter, &block) if block_given?
93
- waiter.wait(params.merge(bucket: @name))
106
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
107
+ waiter.wait(params.merge(bucket: @name))
108
+ end
94
109
  Bucket.new({
95
110
  name: @name,
96
111
  client: @client
@@ -107,7 +122,9 @@ module Aws::S3
107
122
  options, params = separate_params_and_options(options)
108
123
  waiter = Waiters::BucketNotExists.new(options)
109
124
  yield_waiter_and_warn(waiter, &block) if block_given?
110
- waiter.wait(params.merge(bucket: @name))
125
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
126
+ waiter.wait(params.merge(bucket: @name))
127
+ end
111
128
  Bucket.new({
112
129
  name: @name,
113
130
  client: @client
@@ -119,7 +136,8 @@ module Aws::S3
119
136
  # Waiter polls an API operation until a resource enters a desired
120
137
  # state.
121
138
  #
122
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
139
+ # @note The waiting operation is performed on a copy. The original resource
140
+ # remains unchanged.
123
141
  #
124
142
  # ## Basic Usage
125
143
  #
@@ -132,13 +150,15 @@ module Aws::S3
132
150
  #
133
151
  # ## Example
134
152
  #
135
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
153
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
154
+ # instance.state.name == 'running'
155
+ # end
136
156
  #
137
157
  # ## Configuration
138
158
  #
139
159
  # 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}:
160
+ # delay (in seconds) between each polling attempt. The waiting condition is
161
+ # set by passing a block to {#wait_until}:
142
162
  #
143
163
  # # poll for ~25 seconds
144
164
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -169,17 +189,16 @@ module Aws::S3
169
189
  # # resource did not enter the desired state in time
170
190
  # end
171
191
  #
192
+ # @yieldparam [Resource] resource to be used in the waiting condition.
172
193
  #
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.
194
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
195
+ # terminates because the waiter has entered a state that it will not
196
+ # transition out of, preventing success.
178
197
  #
179
198
  # yet successful.
180
199
  #
181
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
182
- # while polling for a resource that is not expected.
200
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
201
+ # encountered while polling for a resource that is not expected.
183
202
  #
184
203
  # @raise [NotImplementedError] Raised when the resource does not
185
204
  #
@@ -206,7 +225,9 @@ module Aws::S3
206
225
  :retry
207
226
  end
208
227
  end
209
- Aws::Waiters::Waiter.new(options).wait({})
228
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
229
+ Aws::Waiters::Waiter.new(options).wait({})
230
+ end
210
231
  end
211
232
 
212
233
  # @!group Actions
@@ -216,7 +237,15 @@ module Aws::S3
216
237
  # bucket.create({
217
238
  # acl: "private", # accepts private, public-read, public-read-write, authenticated-read
218
239
  # 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
240
+ # 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-south-2, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-4, ap-southeast-5, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-central-2, eu-north-1, eu-south-1, eu-south-2, eu-west-1, eu-west-2, eu-west-3, il-central-1, me-central-1, me-south-1, sa-east-1, us-east-2, us-gov-east-1, us-gov-west-1, us-west-1, us-west-2
241
+ # location: {
242
+ # type: "AvailabilityZone", # accepts AvailabilityZone, LocalZone
243
+ # name: "LocationNameAsString",
244
+ # },
245
+ # bucket: {
246
+ # data_redundancy: "SingleAvailabilityZone", # accepts SingleAvailabilityZone, SingleLocalZone
247
+ # type: "Directory", # accepts Directory
248
+ # },
220
249
  # },
221
250
  # grant_full_control: "GrantFullControl",
222
251
  # grant_read: "GrantRead",
@@ -224,41 +253,123 @@ module Aws::S3
224
253
  # grant_write: "GrantWrite",
225
254
  # grant_write_acp: "GrantWriteACP",
226
255
  # object_lock_enabled_for_bucket: false,
256
+ # object_ownership: "BucketOwnerPreferred", # accepts BucketOwnerPreferred, ObjectWriter, BucketOwnerEnforced
227
257
  # })
228
258
  # @param [Hash] options ({})
229
259
  # @option options [String] :acl
230
260
  # The canned ACL to apply to the bucket.
261
+ #
262
+ # <note markdown="1"> This functionality is not supported for directory buckets.
263
+ #
264
+ # </note>
231
265
  # @option options [Types::CreateBucketConfiguration] :create_bucket_configuration
266
+ # The configuration information for the bucket.
232
267
  # @option options [String] :grant_full_control
233
268
  # Allows grantee the read, write, read ACP, and write ACP permissions on
234
269
  # the bucket.
270
+ #
271
+ # <note markdown="1"> This functionality is not supported for directory buckets.
272
+ #
273
+ # </note>
235
274
  # @option options [String] :grant_read
236
275
  # Allows grantee to list the objects in the bucket.
276
+ #
277
+ # <note markdown="1"> This functionality is not supported for directory buckets.
278
+ #
279
+ # </note>
237
280
  # @option options [String] :grant_read_acp
238
281
  # Allows grantee to read the bucket ACL.
282
+ #
283
+ # <note markdown="1"> This functionality is not supported for directory buckets.
284
+ #
285
+ # </note>
239
286
  # @option options [String] :grant_write
240
- # Allows grantee to create, overwrite, and delete any object in the
241
- # bucket.
287
+ # Allows grantee to create new objects in the bucket.
288
+ #
289
+ # For the bucket and object owners of existing objects, also allows
290
+ # deletions and overwrites of those objects.
291
+ #
292
+ # <note markdown="1"> This functionality is not supported for directory buckets.
293
+ #
294
+ # </note>
242
295
  # @option options [String] :grant_write_acp
243
296
  # Allows grantee to write the ACL for the applicable bucket.
297
+ #
298
+ # <note markdown="1"> This functionality is not supported for directory buckets.
299
+ #
300
+ # </note>
244
301
  # @option options [Boolean] :object_lock_enabled_for_bucket
245
- # Specifies whether you want Amazon S3 object lock to be enabled for the
246
- # new bucket.
302
+ # Specifies whether you want S3 Object Lock to be enabled for the new
303
+ # bucket.
304
+ #
305
+ # <note markdown="1"> This functionality is not supported for directory buckets.
306
+ #
307
+ # </note>
308
+ # @option options [String] :object_ownership
309
+ # The container element for object ownership for a bucket's ownership
310
+ # controls.
311
+ #
312
+ # `BucketOwnerPreferred` - Objects uploaded to the bucket change
313
+ # ownership to the bucket owner if the objects are uploaded with the
314
+ # `bucket-owner-full-control` canned ACL.
315
+ #
316
+ # `ObjectWriter` - The uploading account will own the object if the
317
+ # object is uploaded with the `bucket-owner-full-control` canned ACL.
318
+ #
319
+ # `BucketOwnerEnforced` - Access control lists (ACLs) are disabled and
320
+ # no longer affect permissions. The bucket owner automatically owns and
321
+ # has full control over every object in the bucket. The bucket only
322
+ # accepts PUT requests that don't specify an ACL or specify bucket
323
+ # owner full control ACLs (such as the predefined
324
+ # `bucket-owner-full-control` canned ACL or a custom ACL in XML format
325
+ # that grants the same permissions).
326
+ #
327
+ # By default, `ObjectOwnership` is set to `BucketOwnerEnforced` and ACLs
328
+ # are disabled. We recommend keeping ACLs disabled, except in uncommon
329
+ # use cases where you must control access for each object individually.
330
+ # For more information about S3 Object Ownership, see [Controlling
331
+ # ownership of objects and disabling ACLs for your bucket][1] in the
332
+ # *Amazon S3 User Guide*.
333
+ #
334
+ # <note markdown="1"> This functionality is not supported for directory buckets. Directory
335
+ # buckets use the bucket owner enforced setting for S3 Object Ownership.
336
+ #
337
+ # </note>
338
+ #
339
+ #
340
+ #
341
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html
247
342
  # @return [Types::CreateBucketOutput]
248
343
  def create(options = {})
249
344
  options = options.merge(bucket: @name)
250
- resp = @client.create_bucket(options)
345
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
346
+ @client.create_bucket(options)
347
+ end
251
348
  resp.data
252
349
  end
253
350
 
254
351
  # @example Request syntax with placeholder values
255
352
  #
256
- # bucket.delete()
353
+ # bucket.delete({
354
+ # expected_bucket_owner: "AccountId",
355
+ # })
257
356
  # @param [Hash] options ({})
357
+ # @option options [String] :expected_bucket_owner
358
+ # The account ID of the expected bucket owner. If the account ID that
359
+ # you provide does not match the actual owner of the bucket, the request
360
+ # fails with the HTTP status code `403 Forbidden` (access denied).
361
+ #
362
+ # <note markdown="1"> For directory buckets, this header is not supported in this API
363
+ # operation. If you specify this header, the request fails with the HTTP
364
+ # status code `501 Not Implemented`.
365
+ #
366
+ # </note>
258
367
  # @return [EmptyStructure]
259
368
  def delete(options = {})
260
369
  options = options.merge(bucket: @name)
261
- resp = @client.delete_bucket(options)
370
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
371
+ @client.delete_bucket(options)
372
+ end
262
373
  resp.data
263
374
  end
264
375
 
@@ -270,6 +381,9 @@ module Aws::S3
270
381
  # {
271
382
  # key: "ObjectKey", # required
272
383
  # version_id: "ObjectVersionId",
384
+ # etag: "ETag",
385
+ # last_modified_time: Time.now,
386
+ # size: 1,
273
387
  # },
274
388
  # ],
275
389
  # quiet: false,
@@ -277,26 +391,103 @@ module Aws::S3
277
391
  # mfa: "MFA",
278
392
  # request_payer: "requester", # accepts requester
279
393
  # bypass_governance_retention: false,
394
+ # expected_bucket_owner: "AccountId",
395
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
280
396
  # })
281
397
  # @param [Hash] options ({})
282
398
  # @option options [required, Types::Delete] :delete
399
+ # Container for the request.
283
400
  # @option options [String] :mfa
284
401
  # The concatenation of the authentication device's serial number, a
285
402
  # space, and the value that is displayed on your authentication device.
403
+ # Required to permanently delete a versioned object if versioning is
404
+ # configured with MFA delete enabled.
405
+ #
406
+ # When performing the `DeleteObjects` operation on an MFA delete enabled
407
+ # bucket, which attempts to delete the specified versioned objects, you
408
+ # must include an MFA token. If you don't provide an MFA token, the
409
+ # entire request will fail, even if there are non-versioned objects that
410
+ # you are trying to delete. If you provide an invalid token, whether
411
+ # there are versioned object keys in the request or not, the entire
412
+ # Multi-Object Delete request will fail. For information about MFA
413
+ # Delete, see [ MFA Delete][1] in the *Amazon S3 User Guide*.
414
+ #
415
+ # <note markdown="1"> This functionality is not supported for directory buckets.
416
+ #
417
+ # </note>
418
+ #
419
+ #
420
+ #
421
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete
286
422
  # @option options [String] :request_payer
287
- # Confirms that the requester knows that she or he will be charged for
288
- # the request. Bucket owners need not specify this parameter in their
289
- # requests. Documentation on downloading objects from requester pays
290
- # buckets can be found at
291
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
423
+ # Confirms that the requester knows that they will be charged for the
424
+ # request. Bucket owners need not specify this parameter in their
425
+ # requests. If either the source or destination S3 bucket has Requester
426
+ # Pays enabled, the requester will pay for corresponding charges to copy
427
+ # the object. For information about downloading objects from Requester
428
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
429
+ # in the *Amazon S3 User Guide*.
430
+ #
431
+ # <note markdown="1"> This functionality is not supported for directory buckets.
432
+ #
433
+ # </note>
434
+ #
435
+ #
436
+ #
437
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
292
438
  # @option options [Boolean] :bypass_governance_retention
293
439
  # Specifies whether you want to delete this object even if it has a
294
- # Governance-type object lock in place. You must have sufficient
295
- # permissions to perform this operation.
440
+ # Governance-type Object Lock in place. To use this header, you must
441
+ # have the `s3:BypassGovernanceRetention` permission.
442
+ #
443
+ # <note markdown="1"> This functionality is not supported for directory buckets.
444
+ #
445
+ # </note>
446
+ # @option options [String] :expected_bucket_owner
447
+ # The account ID of the expected bucket owner. If the account ID that
448
+ # you provide does not match the actual owner of the bucket, the request
449
+ # fails with the HTTP status code `403 Forbidden` (access denied).
450
+ # @option options [String] :checksum_algorithm
451
+ # Indicates the algorithm used to create the checksum for the object
452
+ # when you use the SDK. This header will not provide any additional
453
+ # functionality if you don't use the SDK. When you send this header,
454
+ # there must be a corresponding `x-amz-checksum-algorithm ` or
455
+ # `x-amz-trailer` header sent. Otherwise, Amazon S3 fails the request
456
+ # with the HTTP status code `400 Bad Request`.
457
+ #
458
+ # For the `x-amz-checksum-algorithm ` header, replace ` algorithm ` with
459
+ # the supported algorithm from the following list:
460
+ #
461
+ # * `CRC32`
462
+ #
463
+ # * `CRC32C`
464
+ #
465
+ # * `CRC64NVME`
466
+ #
467
+ # * `SHA1`
468
+ #
469
+ # * `SHA256`
470
+ #
471
+ # For more information, see [Checking object integrity][1] in the
472
+ # *Amazon S3 User Guide*.
473
+ #
474
+ # If the individual checksum value you provide through
475
+ # `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
476
+ # set through `x-amz-sdk-checksum-algorithm`, Amazon S3 fails the
477
+ # request with a `BadDigest` error.
478
+ #
479
+ # If you provide an individual checksum, Amazon S3 ignores any provided
480
+ # `ChecksumAlgorithm` parameter.
481
+ #
482
+ #
483
+ #
484
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
296
485
  # @return [Types::DeleteObjectsOutput]
297
486
  def delete_objects(options = {})
298
487
  options = options.merge(bucket: @name)
299
- resp = @client.delete_objects(options)
488
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
489
+ @client.delete_objects(options)
490
+ end
300
491
  resp.data
301
492
  end
302
493
 
@@ -312,119 +503,608 @@ module Aws::S3
312
503
  # content_length: 1,
313
504
  # content_md5: "ContentMD5",
314
505
  # content_type: "ContentType",
506
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
507
+ # checksum_crc32: "ChecksumCRC32",
508
+ # checksum_crc32c: "ChecksumCRC32C",
509
+ # checksum_crc64nvme: "ChecksumCRC64NVME",
510
+ # checksum_sha1: "ChecksumSHA1",
511
+ # checksum_sha256: "ChecksumSHA256",
315
512
  # expires: Time.now,
513
+ # if_match: "IfMatch",
514
+ # if_none_match: "IfNoneMatch",
316
515
  # grant_full_control: "GrantFullControl",
317
516
  # grant_read: "GrantRead",
318
517
  # grant_read_acp: "GrantReadACP",
319
518
  # grant_write_acp: "GrantWriteACP",
320
519
  # key: "ObjectKey", # required
520
+ # write_offset_bytes: 1,
321
521
  # metadata: {
322
522
  # "MetadataKey" => "MetadataValue",
323
523
  # },
324
- # server_side_encryption: "AES256", # accepts AES256, aws:kms
325
- # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE
524
+ # server_side_encryption: "AES256", # accepts AES256, aws:kms, aws:kms:dsse
525
+ # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE, OUTPOSTS, GLACIER_IR, SNOW, EXPRESS_ONEZONE
326
526
  # website_redirect_location: "WebsiteRedirectLocation",
327
527
  # sse_customer_algorithm: "SSECustomerAlgorithm",
328
528
  # sse_customer_key: "SSECustomerKey",
329
529
  # sse_customer_key_md5: "SSECustomerKeyMD5",
330
530
  # ssekms_key_id: "SSEKMSKeyId",
331
531
  # ssekms_encryption_context: "SSEKMSEncryptionContext",
532
+ # bucket_key_enabled: false,
332
533
  # request_payer: "requester", # accepts requester
333
534
  # tagging: "TaggingHeader",
334
535
  # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE
335
536
  # object_lock_retain_until_date: Time.now,
336
537
  # object_lock_legal_hold_status: "ON", # accepts ON, OFF
538
+ # expected_bucket_owner: "AccountId",
337
539
  # })
338
540
  # @param [Hash] options ({})
339
541
  # @option options [String] :acl
340
- # The canned ACL to apply to the object.
341
- # @option options [String, IO] :body
542
+ # The canned ACL to apply to the object. For more information, see
543
+ # [Canned ACL][1] in the *Amazon S3 User Guide*.
544
+ #
545
+ # When adding a new object, you can use headers to grant ACL-based
546
+ # permissions to individual Amazon Web Services accounts or to
547
+ # predefined groups defined by Amazon S3. These permissions are then
548
+ # added to the ACL on the object. By default, all objects are private.
549
+ # Only the owner has full access control. For more information, see
550
+ # [Access Control List (ACL) Overview][2] and [Managing ACLs Using the
551
+ # REST API][3] in the *Amazon S3 User Guide*.
552
+ #
553
+ # If the bucket that you're uploading objects to uses the bucket owner
554
+ # enforced setting for S3 Object Ownership, ACLs are disabled and no
555
+ # longer affect permissions. Buckets that use this setting only accept
556
+ # PUT requests that don't specify an ACL or PUT requests that specify
557
+ # bucket owner full control ACLs, such as the
558
+ # `bucket-owner-full-control` canned ACL or an equivalent form of this
559
+ # ACL expressed in the XML format. PUT requests that contain other ACLs
560
+ # (for example, custom grants to certain Amazon Web Services accounts)
561
+ # fail and return a `400` error with the error code
562
+ # `AccessControlListNotSupported`. For more information, see [
563
+ # Controlling ownership of objects and disabling ACLs][4] in the *Amazon
564
+ # S3 User Guide*.
565
+ #
566
+ # <note markdown="1"> * This functionality is not supported for directory buckets.
567
+ #
568
+ # * This functionality is not supported for Amazon S3 on Outposts.
569
+ #
570
+ # </note>
571
+ #
572
+ #
573
+ #
574
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL
575
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html
576
+ # [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html
577
+ # [4]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html
578
+ # @option options [String, StringIO, File] :body
342
579
  # Object data.
343
580
  # @option options [String] :cache_control
344
- # Specifies caching behavior along the request/reply chain.
581
+ # Can be used to specify caching behavior along the request/reply chain.
582
+ # For more information, see
583
+ # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9][1].
584
+ #
585
+ #
586
+ #
587
+ # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
345
588
  # @option options [String] :content_disposition
346
- # Specifies presentational information for the object.
589
+ # Specifies presentational information for the object. For more
590
+ # information, see
591
+ # [https://www.rfc-editor.org/rfc/rfc6266#section-4][1].
592
+ #
593
+ #
594
+ #
595
+ # [1]: https://www.rfc-editor.org/rfc/rfc6266#section-4
347
596
  # @option options [String] :content_encoding
348
597
  # Specifies what content encodings have been applied to the object and
349
598
  # thus what decoding mechanisms must be applied to obtain the media-type
350
- # referenced by the Content-Type header field.
599
+ # referenced by the Content-Type header field. For more information, see
600
+ # [https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding][1].
601
+ #
602
+ #
603
+ #
604
+ # [1]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding
351
605
  # @option options [String] :content_language
352
606
  # The language the content is in.
353
607
  # @option options [Integer] :content_length
354
608
  # Size of the body in bytes. This parameter is useful when the size of
355
- # the body cannot be determined automatically.
609
+ # the body cannot be determined automatically. For more information, see
610
+ # [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length][1].
611
+ #
612
+ #
613
+ #
614
+ # [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length
356
615
  # @option options [String] :content_md5
357
- # The base64-encoded 128-bit MD5 digest of the part data. This parameter
358
- # is auto-populated when using the command from the CLI. This parameted
359
- # is required if object lock parameters are specified.
616
+ # The Base64 encoded 128-bit `MD5` digest of the message (without the
617
+ # headers) according to RFC 1864. This header can be used as a message
618
+ # integrity check to verify that the data is the same data that was
619
+ # originally sent. Although it is optional, we recommend using the
620
+ # Content-MD5 mechanism as an end-to-end integrity check. For more
621
+ # information about REST request authentication, see [REST
622
+ # Authentication][1].
623
+ #
624
+ # <note markdown="1"> The `Content-MD5` or `x-amz-sdk-checksum-algorithm` header is required
625
+ # for any request to upload an object with a retention period configured
626
+ # using Amazon S3 Object Lock. For more information, see [Uploading
627
+ # objects to an Object Lock enabled bucket ][2] in the *Amazon S3 User
628
+ # Guide*.
629
+ #
630
+ # </note>
631
+ #
632
+ # <note markdown="1"> This functionality is not supported for directory buckets.
633
+ #
634
+ # </note>
635
+ #
636
+ #
637
+ #
638
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
639
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-put-object
360
640
  # @option options [String] :content_type
361
- # A standard MIME type describing the format of the object data.
641
+ # A standard MIME type describing the format of the contents. For more
642
+ # information, see
643
+ # [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type][1].
644
+ #
645
+ #
646
+ #
647
+ # [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type
648
+ # @option options [String] :checksum_algorithm
649
+ # Indicates the algorithm used to create the checksum for the object
650
+ # when you use the SDK. This header will not provide any additional
651
+ # functionality if you don't use the SDK. When you send this header,
652
+ # there must be a corresponding `x-amz-checksum-algorithm ` or
653
+ # `x-amz-trailer` header sent. Otherwise, Amazon S3 fails the request
654
+ # with the HTTP status code `400 Bad Request`.
655
+ #
656
+ # For the `x-amz-checksum-algorithm ` header, replace ` algorithm ` with
657
+ # the supported algorithm from the following list:
658
+ #
659
+ # * `CRC32`
660
+ #
661
+ # * `CRC32C`
662
+ #
663
+ # * `CRC64NVME`
664
+ #
665
+ # * `SHA1`
666
+ #
667
+ # * `SHA256`
668
+ #
669
+ # For more information, see [Checking object integrity][1] in the
670
+ # *Amazon S3 User Guide*.
671
+ #
672
+ # If the individual checksum value you provide through
673
+ # `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
674
+ # set through `x-amz-sdk-checksum-algorithm`, Amazon S3 fails the
675
+ # request with a `BadDigest` error.
676
+ #
677
+ # <note markdown="1"> The `Content-MD5` or `x-amz-sdk-checksum-algorithm` header is required
678
+ # for any request to upload an object with a retention period configured
679
+ # using Amazon S3 Object Lock. For more information, see [Uploading
680
+ # objects to an Object Lock enabled bucket ][2] in the *Amazon S3 User
681
+ # Guide*.
682
+ #
683
+ # </note>
684
+ #
685
+ # For directory buckets, when you use Amazon Web Services SDKs, `CRC32`
686
+ # is the default checksum algorithm that's used for performance.
687
+ #
688
+ #
689
+ #
690
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
691
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-put-object
692
+ # @option options [String] :checksum_crc32
693
+ # This header can be used as a data integrity check to verify that the
694
+ # data received is the same data that was originally sent. This header
695
+ # specifies the Base64 encoded, 32-bit `CRC32` checksum of the object.
696
+ # For more information, see [Checking object integrity][1] in the
697
+ # *Amazon S3 User Guide*.
698
+ #
699
+ #
700
+ #
701
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
702
+ # @option options [String] :checksum_crc32c
703
+ # This header can be used as a data integrity check to verify that the
704
+ # data received is the same data that was originally sent. This header
705
+ # specifies the Base64 encoded, 32-bit `CRC32C` checksum of the object.
706
+ # For more information, see [Checking object integrity][1] in the
707
+ # *Amazon S3 User Guide*.
708
+ #
709
+ #
710
+ #
711
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
712
+ # @option options [String] :checksum_crc64nvme
713
+ # This header can be used as a data integrity check to verify that the
714
+ # data received is the same data that was originally sent. This header
715
+ # specifies the Base64 encoded, 64-bit `CRC64NVME` checksum of the
716
+ # object. The `CRC64NVME` checksum is always a full object checksum. For
717
+ # more information, see [Checking object integrity in the Amazon S3 User
718
+ # Guide][1].
719
+ #
720
+ #
721
+ #
722
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
723
+ # @option options [String] :checksum_sha1
724
+ # This header can be used as a data integrity check to verify that the
725
+ # data received is the same data that was originally sent. This header
726
+ # specifies the Base64 encoded, 160-bit `SHA1` digest of the object. For
727
+ # more information, see [Checking object integrity][1] in the *Amazon S3
728
+ # User Guide*.
729
+ #
730
+ #
731
+ #
732
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
733
+ # @option options [String] :checksum_sha256
734
+ # This header can be used as a data integrity check to verify that the
735
+ # data received is the same data that was originally sent. This header
736
+ # specifies the Base64 encoded, 256-bit `SHA256` digest of the object.
737
+ # For more information, see [Checking object integrity][1] in the
738
+ # *Amazon S3 User Guide*.
739
+ #
740
+ #
741
+ #
742
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
362
743
  # @option options [Time,DateTime,Date,Integer,String] :expires
363
- # The date and time at which the object is no longer cacheable.
744
+ # The date and time at which the object is no longer cacheable. For more
745
+ # information, see
746
+ # [https://www.rfc-editor.org/rfc/rfc7234#section-5.3][1].
747
+ #
748
+ #
749
+ #
750
+ # [1]: https://www.rfc-editor.org/rfc/rfc7234#section-5.3
751
+ # @option options [String] :if_match
752
+ # Uploads the object only if the ETag (entity tag) value provided during
753
+ # the WRITE operation matches the ETag of the object in S3. If the ETag
754
+ # values do not match, the operation returns a `412 Precondition Failed`
755
+ # error.
756
+ #
757
+ # If a conflicting operation occurs during the upload S3 returns a `409
758
+ # ConditionalRequestConflict` response. On a 409 failure you should
759
+ # fetch the object's ETag and retry the upload.
760
+ #
761
+ # Expects the ETag value as a string.
762
+ #
763
+ # For more information about conditional requests, see [RFC 7232][1], or
764
+ # [Conditional requests][2] in the *Amazon S3 User Guide*.
765
+ #
766
+ #
767
+ #
768
+ # [1]: https://tools.ietf.org/html/rfc7232
769
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html
770
+ # @option options [String] :if_none_match
771
+ # Uploads the object only if the object key name does not already exist
772
+ # in the bucket specified. Otherwise, Amazon S3 returns a `412
773
+ # Precondition Failed` error.
774
+ #
775
+ # If a conflicting operation occurs during the upload S3 returns a `409
776
+ # ConditionalRequestConflict` response. On a 409 failure you should
777
+ # retry the upload.
778
+ #
779
+ # Expects the '*' (asterisk) character.
780
+ #
781
+ # For more information about conditional requests, see [RFC 7232][1], or
782
+ # [Conditional requests][2] in the *Amazon S3 User Guide*.
783
+ #
784
+ #
785
+ #
786
+ # [1]: https://tools.ietf.org/html/rfc7232
787
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html
364
788
  # @option options [String] :grant_full_control
365
789
  # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
366
790
  # object.
791
+ #
792
+ # <note markdown="1"> * This functionality is not supported for directory buckets.
793
+ #
794
+ # * This functionality is not supported for Amazon S3 on Outposts.
795
+ #
796
+ # </note>
367
797
  # @option options [String] :grant_read
368
798
  # Allows grantee to read the object data and its metadata.
799
+ #
800
+ # <note markdown="1"> * This functionality is not supported for directory buckets.
801
+ #
802
+ # * This functionality is not supported for Amazon S3 on Outposts.
803
+ #
804
+ # </note>
369
805
  # @option options [String] :grant_read_acp
370
806
  # Allows grantee to read the object ACL.
807
+ #
808
+ # <note markdown="1"> * This functionality is not supported for directory buckets.
809
+ #
810
+ # * This functionality is not supported for Amazon S3 on Outposts.
811
+ #
812
+ # </note>
371
813
  # @option options [String] :grant_write_acp
372
814
  # Allows grantee to write the ACL for the applicable object.
815
+ #
816
+ # <note markdown="1"> * This functionality is not supported for directory buckets.
817
+ #
818
+ # * This functionality is not supported for Amazon S3 on Outposts.
819
+ #
820
+ # </note>
373
821
  # @option options [required, String] :key
374
- # Object key for which the PUT operation was initiated.
822
+ # Object key for which the PUT action was initiated.
823
+ # @option options [Integer] :write_offset_bytes
824
+ # Specifies the offset for appending data to existing objects in bytes.
825
+ # The offset must be equal to the size of the existing object being
826
+ # appended to. If no object exists, setting this header to 0 will create
827
+ # a new object.
828
+ #
829
+ # <note markdown="1"> This functionality is only supported for objects in the Amazon S3
830
+ # Express One Zone storage class in directory buckets.
831
+ #
832
+ # </note>
375
833
  # @option options [Hash<String,String>] :metadata
376
834
  # A map of metadata to store with the object in S3.
377
835
  # @option options [String] :server_side_encryption
378
- # The Server-side encryption algorithm used when storing this object in
379
- # S3 (e.g., AES256, aws:kms).
836
+ # The server-side encryption algorithm that was used when you store this
837
+ # object in Amazon S3 (for example, `AES256`, `aws:kms`,
838
+ # `aws:kms:dsse`).
839
+ #
840
+ # * <b>General purpose buckets </b> - You have four mutually exclusive
841
+ # options to protect data using server-side encryption in Amazon S3,
842
+ # depending on how you choose to manage the encryption keys.
843
+ # Specifically, the encryption key options are Amazon S3 managed keys
844
+ # (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and
845
+ # customer-provided keys (SSE-C). Amazon S3 encrypts data with
846
+ # server-side encryption by using Amazon S3 managed keys (SSE-S3) by
847
+ # default. You can optionally tell Amazon S3 to encrypt data at rest
848
+ # by using server-side encryption with other key options. For more
849
+ # information, see [Using Server-Side Encryption][1] in the *Amazon S3
850
+ # User Guide*.
851
+ #
852
+ # * <b>Directory buckets </b> - For directory buckets, there are only
853
+ # two supported options for server-side encryption: server-side
854
+ # encryption with Amazon S3 managed keys (SSE-S3) (`AES256`) and
855
+ # server-side encryption with KMS keys (SSE-KMS) (`aws:kms`). We
856
+ # recommend that the bucket's default encryption uses the desired
857
+ # encryption configuration and you don't override the bucket default
858
+ # encryption in your `CreateSession` requests or `PUT` object
859
+ # requests. Then, new objects are automatically encrypted with the
860
+ # desired encryption settings. For more information, see [Protecting
861
+ # data with server-side encryption][2] in the *Amazon S3 User Guide*.
862
+ # For more information about the encryption overriding behaviors in
863
+ # directory buckets, see [Specifying server-side encryption with KMS
864
+ # for new object uploads][3].
865
+ #
866
+ # In the Zonal endpoint API calls (except [CopyObject][4] and
867
+ # [UploadPartCopy][5]) using the REST API, the encryption request
868
+ # headers must match the encryption settings that are specified in the
869
+ # `CreateSession` request. You can't override the values of the
870
+ # encryption settings (`x-amz-server-side-encryption`,
871
+ # `x-amz-server-side-encryption-aws-kms-key-id`,
872
+ # `x-amz-server-side-encryption-context`, and
873
+ # `x-amz-server-side-encryption-bucket-key-enabled`) that are
874
+ # specified in the `CreateSession` request. You don't need to
875
+ # explicitly specify these encryption settings values in Zonal
876
+ # endpoint API calls, and Amazon S3 will use the encryption settings
877
+ # values from the `CreateSession` request to protect new objects in
878
+ # the directory bucket.
879
+ #
880
+ # <note markdown="1"> When you use the CLI or the Amazon Web Services SDKs, for
881
+ # `CreateSession`, the session token refreshes automatically to avoid
882
+ # service interruptions when a session expires. The CLI or the Amazon
883
+ # Web Services SDKs use the bucket's default encryption configuration
884
+ # for the `CreateSession` request. It's not supported to override the
885
+ # encryption settings values in the `CreateSession` request. So in the
886
+ # Zonal endpoint API calls (except [CopyObject][4] and
887
+ # [UploadPartCopy][5]), the encryption request headers must match the
888
+ # default encryption configuration of the directory bucket.
889
+ #
890
+ # </note>
891
+ #
892
+ #
893
+ #
894
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html
895
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html
896
+ # [3]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html
897
+ # [4]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html
898
+ # [5]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html
380
899
  # @option options [String] :storage_class
381
- # The type of storage to use for the object. Defaults to 'STANDARD'.
900
+ # By default, Amazon S3 uses the STANDARD Storage Class to store newly
901
+ # created objects. The STANDARD storage class provides high durability
902
+ # and high availability. Depending on performance needs, you can specify
903
+ # a different Storage Class. For more information, see [Storage
904
+ # Classes][1] in the *Amazon S3 User Guide*.
905
+ #
906
+ # <note markdown="1"> * Directory buckets only support `EXPRESS_ONEZONE` (the S3 Express One
907
+ # Zone storage class) in Availability Zones and `ONEZONE_IA` (the S3
908
+ # One Zone-Infrequent Access storage class) in Dedicated Local Zones.
909
+ #
910
+ # * Amazon S3 on Outposts only uses the OUTPOSTS Storage Class.
911
+ #
912
+ # </note>
913
+ #
914
+ #
915
+ #
916
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html
382
917
  # @option options [String] :website_redirect_location
383
918
  # If the bucket is configured as a website, redirects requests for this
384
919
  # object to another object in the same bucket or to an external URL.
385
- # Amazon S3 stores the value of this header in the object metadata.
920
+ # Amazon S3 stores the value of this header in the object metadata. For
921
+ # information about object metadata, see [Object Key and Metadata][1] in
922
+ # the *Amazon S3 User Guide*.
923
+ #
924
+ # In the following example, the request header sets the redirect to an
925
+ # object (anotherPage.html) in the same bucket:
926
+ #
927
+ # `x-amz-website-redirect-location: /anotherPage.html`
928
+ #
929
+ # In the following example, the request header sets the object redirect
930
+ # to another website:
931
+ #
932
+ # `x-amz-website-redirect-location: http://www.example.com/`
933
+ #
934
+ # For more information about website hosting in Amazon S3, see [Hosting
935
+ # Websites on Amazon S3][2] and [How to Configure Website Page
936
+ # Redirects][3] in the *Amazon S3 User Guide*.
937
+ #
938
+ # <note markdown="1"> This functionality is not supported for directory buckets.
939
+ #
940
+ # </note>
941
+ #
942
+ #
943
+ #
944
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html
945
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
946
+ # [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html
386
947
  # @option options [String] :sse_customer_algorithm
387
- # Specifies the algorithm to use to when encrypting the object (e.g.,
388
- # AES256).
948
+ # Specifies the algorithm to use when encrypting the object (for
949
+ # example, `AES256`).
950
+ #
951
+ # <note markdown="1"> This functionality is not supported for directory buckets.
952
+ #
953
+ # </note>
389
954
  # @option options [String] :sse_customer_key
390
955
  # Specifies the customer-provided encryption key for Amazon S3 to use in
391
956
  # encrypting data. This value is used to store the object and then it is
392
- # discarded; Amazon does not store the encryption key. The key must be
393
- # appropriate for use with the algorithm specified in the
394
- # x-amz-server-side​-encryption​-customer-algorithm header.
957
+ # discarded; Amazon S3 does not store the encryption key. The key must
958
+ # be appropriate for use with the algorithm specified in the
959
+ # `x-amz-server-side-encryption-customer-algorithm` header.
960
+ #
961
+ # <note markdown="1"> This functionality is not supported for directory buckets.
962
+ #
963
+ # </note>
395
964
  # @option options [String] :sse_customer_key_md5
396
965
  # Specifies the 128-bit MD5 digest of the encryption key according to
397
966
  # RFC 1321. Amazon S3 uses this header for a message integrity check to
398
- # ensure the encryption key was transmitted without error.
967
+ # ensure that the encryption key was transmitted without error.
968
+ #
969
+ # <note markdown="1"> This functionality is not supported for directory buckets.
970
+ #
971
+ # </note>
399
972
  # @option options [String] :ssekms_key_id
400
- # Specifies the AWS KMS key ID to use for object encryption. All GET and
401
- # PUT requests for an object protected by AWS KMS will fail if not made
402
- # via SSL or using SigV4. Documentation on configuring any of the
403
- # officially supported AWS SDKs and CLI can be found at
404
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
973
+ # Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for
974
+ # object encryption. If the KMS key doesn't exist in the same account
975
+ # that's issuing the command, you must use the full Key ARN not the Key
976
+ # ID.
977
+ #
978
+ # **General purpose buckets** - If you specify
979
+ # `x-amz-server-side-encryption` with `aws:kms` or `aws:kms:dsse`, this
980
+ # header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key
981
+ # to use. If you specify `x-amz-server-side-encryption:aws:kms` or
982
+ # `x-amz-server-side-encryption:aws:kms:dsse`, but do not provide
983
+ # `x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the
984
+ # Amazon Web Services managed key (`aws/s3`) to protect the data.
985
+ #
986
+ # **Directory buckets** - To encrypt data using SSE-KMS, it's
987
+ # recommended to specify the `x-amz-server-side-encryption` header to
988
+ # `aws:kms`. Then, the `x-amz-server-side-encryption-aws-kms-key-id`
989
+ # header implicitly uses the bucket's default KMS customer managed key
990
+ # ID. If you want to explicitly set the `
991
+ # x-amz-server-side-encryption-aws-kms-key-id` header, it must match the
992
+ # bucket's default customer managed key (using key ID or ARN, not
993
+ # alias). Your SSE-KMS configuration can only support 1 [customer
994
+ # managed key][1] per directory bucket's lifetime. The [Amazon Web
995
+ # Services managed key][2] (`aws/s3`) isn't supported. Incorrect key
996
+ # specification results in an HTTP `400 Bad Request` error.
997
+ #
998
+ #
999
+ #
1000
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
1001
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
405
1002
  # @option options [String] :ssekms_encryption_context
406
- # Specifies the AWS KMS Encryption Context to use for object encryption.
407
- # The value of this header is a base64-encoded UTF-8 string holding JSON
408
- # with the encryption context key-value pairs.
1003
+ # Specifies the Amazon Web Services KMS Encryption Context as an
1004
+ # additional encryption context to use for object encryption. The value
1005
+ # of this header is a Base64 encoded string of a UTF-8 encoded JSON,
1006
+ # which contains the encryption context as key-value pairs. This value
1007
+ # is stored as object metadata and automatically gets passed on to
1008
+ # Amazon Web Services KMS for future `GetObject` operations on this
1009
+ # object.
1010
+ #
1011
+ # **General purpose buckets** - This value must be explicitly added
1012
+ # during `CopyObject` operations if you want an additional encryption
1013
+ # context for your object. For more information, see [Encryption
1014
+ # context][1] in the *Amazon S3 User Guide*.
1015
+ #
1016
+ # **Directory buckets** - You can optionally provide an explicit
1017
+ # encryption context value. The value must match the default encryption
1018
+ # context - the bucket Amazon Resource Name (ARN). An additional
1019
+ # encryption context value is not supported.
1020
+ #
1021
+ #
1022
+ #
1023
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#encryption-context
1024
+ # @option options [Boolean] :bucket_key_enabled
1025
+ # Specifies whether Amazon S3 should use an S3 Bucket Key for object
1026
+ # encryption with server-side encryption using Key Management Service
1027
+ # (KMS) keys (SSE-KMS).
1028
+ #
1029
+ # **General purpose buckets** - Setting this header to `true` causes
1030
+ # Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.
1031
+ # Also, specifying this header with a PUT action doesn't affect
1032
+ # bucket-level settings for S3 Bucket Key.
1033
+ #
1034
+ # **Directory buckets** - S3 Bucket Keys are always enabled for `GET`
1035
+ # and `PUT` operations in a directory bucket and can’t be disabled. S3
1036
+ # Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects
1037
+ # from general purpose buckets to directory buckets, from directory
1038
+ # buckets to general purpose buckets, or between directory buckets,
1039
+ # through [CopyObject][1], [UploadPartCopy][2], [the Copy operation in
1040
+ # Batch Operations][3], or [the import jobs][4]. In this case, Amazon S3
1041
+ # makes a call to KMS every time a copy request is made for a
1042
+ # KMS-encrypted object.
1043
+ #
1044
+ #
1045
+ #
1046
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html
1047
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html
1048
+ # [3]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops
1049
+ # [4]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job
409
1050
  # @option options [String] :request_payer
410
- # Confirms that the requester knows that she or he will be charged for
411
- # the request. Bucket owners need not specify this parameter in their
412
- # requests. Documentation on downloading objects from requester pays
413
- # buckets can be found at
414
- # http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
1051
+ # Confirms that the requester knows that they will be charged for the
1052
+ # request. Bucket owners need not specify this parameter in their
1053
+ # requests. If either the source or destination S3 bucket has Requester
1054
+ # Pays enabled, the requester will pay for corresponding charges to copy
1055
+ # the object. For information about downloading objects from Requester
1056
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
1057
+ # in the *Amazon S3 User Guide*.
1058
+ #
1059
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1060
+ #
1061
+ # </note>
1062
+ #
1063
+ #
1064
+ #
1065
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
415
1066
  # @option options [String] :tagging
416
1067
  # The tag-set for the object. The tag-set must be encoded as URL Query
417
1068
  # parameters. (For example, "Key1=Value1")
1069
+ #
1070
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1071
+ #
1072
+ # </note>
418
1073
  # @option options [String] :object_lock_mode
419
- # The object lock mode that you want to apply to this object.
1074
+ # The Object Lock mode that you want to apply to this object.
1075
+ #
1076
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1077
+ #
1078
+ # </note>
420
1079
  # @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date
421
- # The date and time when you want this object's object lock to expire.
1080
+ # The date and time when you want this object's Object Lock to expire.
1081
+ # Must be formatted as a timestamp parameter.
1082
+ #
1083
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1084
+ #
1085
+ # </note>
422
1086
  # @option options [String] :object_lock_legal_hold_status
423
- # The Legal Hold status that you want to apply to the specified object.
1087
+ # Specifies whether a legal hold will be applied to this object. For
1088
+ # more information about S3 Object Lock, see [Object Lock][1] in the
1089
+ # *Amazon S3 User Guide*.
1090
+ #
1091
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1092
+ #
1093
+ # </note>
1094
+ #
1095
+ #
1096
+ #
1097
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html
1098
+ # @option options [String] :expected_bucket_owner
1099
+ # The account ID of the expected bucket owner. If the account ID that
1100
+ # you provide does not match the actual owner of the bucket, the request
1101
+ # fails with the HTTP status code `403 Forbidden` (access denied).
424
1102
  # @return [Object]
425
1103
  def put_object(options = {})
426
1104
  options = options.merge(bucket: @name)
427
- resp = @client.put_object(options)
1105
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1106
+ @client.put_object(options)
1107
+ end
428
1108
  Object.new(
429
1109
  bucket_name: @name,
430
1110
  key: options[:key],
@@ -482,32 +1162,121 @@ module Aws::S3
482
1162
  # key_marker: "KeyMarker",
483
1163
  # prefix: "Prefix",
484
1164
  # upload_id_marker: "UploadIdMarker",
1165
+ # expected_bucket_owner: "AccountId",
1166
+ # request_payer: "requester", # accepts requester
485
1167
  # })
486
1168
  # @param [Hash] options ({})
487
1169
  # @option options [String] :delimiter
488
1170
  # Character you use to group keys.
1171
+ #
1172
+ # All keys that contain the same string between the prefix, if
1173
+ # specified, and the first occurrence of the delimiter after the prefix
1174
+ # are grouped under a single result element, `CommonPrefixes`. If you
1175
+ # don't specify the prefix parameter, then the substring starts at the
1176
+ # beginning of the key. The keys that are grouped under `CommonPrefixes`
1177
+ # result element are not returned elsewhere in the response.
1178
+ #
1179
+ # <note markdown="1"> **Directory buckets** - For directory buckets, `/` is the only
1180
+ # supported delimiter.
1181
+ #
1182
+ # </note>
489
1183
  # @option options [String] :encoding_type
490
- # Requests Amazon S3 to encode the object keys in the response and
491
- # specifies the encoding method to use. An object key may contain any
492
- # Unicode character; however, XML 1.0 parser cannot parse some
493
- # characters, such as characters with an ASCII value from 0 to 10. For
494
- # characters that are not supported in XML 1.0, you can add this
495
- # parameter to request that Amazon S3 encode the keys in the response.
1184
+ # Encoding type used by Amazon S3 to encode the [object keys][1] in the
1185
+ # response. Responses are encoded only in UTF-8. An object key can
1186
+ # contain any Unicode character. However, the XML 1.0 parser can't
1187
+ # parse certain characters, such as characters with an ASCII value from
1188
+ # 0 to 10. For characters that aren't supported in XML 1.0, you can add
1189
+ # this parameter to request that Amazon S3 encode the keys in the
1190
+ # response. For more information about characters to avoid in object key
1191
+ # names, see [Object key naming guidelines][2].
1192
+ #
1193
+ # <note markdown="1"> When using the URL encoding type, non-ASCII characters that are used
1194
+ # in an object's key name will be percent-encoded according to UTF-8
1195
+ # code values. For example, the object `test_file(3).png` will appear as
1196
+ # `test_file%283%29.png`.
1197
+ #
1198
+ # </note>
1199
+ #
1200
+ #
1201
+ #
1202
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
1203
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines
496
1204
  # @option options [String] :key_marker
497
- # Together with upload-id-marker, this parameter specifies the multipart
498
- # upload after which listing should begin.
1205
+ # Specifies the multipart upload after which listing should begin.
1206
+ #
1207
+ # <note markdown="1"> * **General purpose buckets** - For general purpose buckets,
1208
+ # `key-marker` is an object key. Together with `upload-id-marker`,
1209
+ # this parameter specifies the multipart upload after which listing
1210
+ # should begin.
1211
+ #
1212
+ # If `upload-id-marker` is not specified, only the keys
1213
+ # lexicographically greater than the specified `key-marker` will be
1214
+ # included in the list.
1215
+ #
1216
+ # If `upload-id-marker` is specified, any multipart uploads for a key
1217
+ # equal to the `key-marker` might also be included, provided those
1218
+ # multipart uploads have upload IDs lexicographically greater than the
1219
+ # specified `upload-id-marker`.
1220
+ #
1221
+ # * **Directory buckets** - For directory buckets, `key-marker` is
1222
+ # obfuscated and isn't a real object key. The `upload-id-marker`
1223
+ # parameter isn't supported by directory buckets. To list the
1224
+ # additional multipart uploads, you only need to set the value of
1225
+ # `key-marker` to the `NextKeyMarker` value from the previous
1226
+ # response.
1227
+ #
1228
+ # In the `ListMultipartUploads` response, the multipart uploads
1229
+ # aren't sorted lexicographically based on the object keys.
1230
+ #
1231
+ # </note>
499
1232
  # @option options [String] :prefix
500
1233
  # Lists in-progress uploads only for those keys that begin with the
501
- # specified prefix.
1234
+ # specified prefix. You can use prefixes to separate a bucket into
1235
+ # different grouping of keys. (You can think of using `prefix` to make
1236
+ # groups in the same way that you'd use a folder in a file system.)
1237
+ #
1238
+ # <note markdown="1"> **Directory buckets** - For directory buckets, only prefixes that end
1239
+ # in a delimiter (`/`) are supported.
1240
+ #
1241
+ # </note>
502
1242
  # @option options [String] :upload_id_marker
503
1243
  # Together with key-marker, specifies the multipart upload after which
504
1244
  # listing should begin. If key-marker is not specified, the
505
- # upload-id-marker parameter is ignored.
1245
+ # upload-id-marker parameter is ignored. Otherwise, any multipart
1246
+ # uploads for a key equal to the key-marker might be included in the
1247
+ # list only if they have an upload ID lexicographically greater than the
1248
+ # specified `upload-id-marker`.
1249
+ #
1250
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1251
+ #
1252
+ # </note>
1253
+ # @option options [String] :expected_bucket_owner
1254
+ # The account ID of the expected bucket owner. If the account ID that
1255
+ # you provide does not match the actual owner of the bucket, the request
1256
+ # fails with the HTTP status code `403 Forbidden` (access denied).
1257
+ # @option options [String] :request_payer
1258
+ # Confirms that the requester knows that they will be charged for the
1259
+ # request. Bucket owners need not specify this parameter in their
1260
+ # requests. If either the source or destination S3 bucket has Requester
1261
+ # Pays enabled, the requester will pay for corresponding charges to copy
1262
+ # the object. For information about downloading objects from Requester
1263
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
1264
+ # in the *Amazon S3 User Guide*.
1265
+ #
1266
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1267
+ #
1268
+ # </note>
1269
+ #
1270
+ #
1271
+ #
1272
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
506
1273
  # @return [MultipartUpload::Collection]
507
1274
  def multipart_uploads(options = {})
508
1275
  batches = Enumerator.new do |y|
509
1276
  options = options.merge(bucket: @name)
510
- resp = @client.list_multipart_uploads(options)
1277
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1278
+ @client.list_multipart_uploads(options)
1279
+ end
511
1280
  resp.each_page do |page|
512
1281
  batch = []
513
1282
  page.data.uploads.each do |u|
@@ -551,28 +1320,80 @@ module Aws::S3
551
1320
  # key_marker: "KeyMarker",
552
1321
  # prefix: "Prefix",
553
1322
  # version_id_marker: "VersionIdMarker",
1323
+ # expected_bucket_owner: "AccountId",
1324
+ # request_payer: "requester", # accepts requester
1325
+ # optional_object_attributes: ["RestoreStatus"], # accepts RestoreStatus
554
1326
  # })
555
1327
  # @param [Hash] options ({})
556
1328
  # @option options [String] :delimiter
557
- # A delimiter is a character you use to group keys.
1329
+ # A delimiter is a character that you specify to group keys. All keys
1330
+ # that contain the same string between the `prefix` and the first
1331
+ # occurrence of the delimiter are grouped under a single result element
1332
+ # in `CommonPrefixes`. These groups are counted as one result against
1333
+ # the `max-keys` limitation. These keys are not returned elsewhere in
1334
+ # the response.
558
1335
  # @option options [String] :encoding_type
559
- # Requests Amazon S3 to encode the object keys in the response and
560
- # specifies the encoding method to use. An object key may contain any
561
- # Unicode character; however, XML 1.0 parser cannot parse some
562
- # characters, such as characters with an ASCII value from 0 to 10. For
563
- # characters that are not supported in XML 1.0, you can add this
564
- # parameter to request that Amazon S3 encode the keys in the response.
1336
+ # Encoding type used by Amazon S3 to encode the [object keys][1] in the
1337
+ # response. Responses are encoded only in UTF-8. An object key can
1338
+ # contain any Unicode character. However, the XML 1.0 parser can't
1339
+ # parse certain characters, such as characters with an ASCII value from
1340
+ # 0 to 10. For characters that aren't supported in XML 1.0, you can add
1341
+ # this parameter to request that Amazon S3 encode the keys in the
1342
+ # response. For more information about characters to avoid in object key
1343
+ # names, see [Object key naming guidelines][2].
1344
+ #
1345
+ # <note markdown="1"> When using the URL encoding type, non-ASCII characters that are used
1346
+ # in an object's key name will be percent-encoded according to UTF-8
1347
+ # code values. For example, the object `test_file(3).png` will appear as
1348
+ # `test_file%283%29.png`.
1349
+ #
1350
+ # </note>
1351
+ #
1352
+ #
1353
+ #
1354
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
1355
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines
565
1356
  # @option options [String] :key_marker
566
1357
  # Specifies the key to start with when listing objects in a bucket.
567
1358
  # @option options [String] :prefix
568
- # Limits the response to keys that begin with the specified prefix.
1359
+ # Use this parameter to select only those keys that begin with the
1360
+ # specified prefix. You can use prefixes to separate a bucket into
1361
+ # different groupings of keys. (You can think of using `prefix` to make
1362
+ # groups in the same way that you'd use a folder in a file system.) You
1363
+ # can use `prefix` with `delimiter` to roll up numerous objects into a
1364
+ # single result under `CommonPrefixes`.
569
1365
  # @option options [String] :version_id_marker
570
1366
  # Specifies the object version you want to start listing from.
1367
+ # @option options [String] :expected_bucket_owner
1368
+ # The account ID of the expected bucket owner. If the account ID that
1369
+ # you provide does not match the actual owner of the bucket, the request
1370
+ # fails with the HTTP status code `403 Forbidden` (access denied).
1371
+ # @option options [String] :request_payer
1372
+ # Confirms that the requester knows that they will be charged for the
1373
+ # request. Bucket owners need not specify this parameter in their
1374
+ # requests. If either the source or destination S3 bucket has Requester
1375
+ # Pays enabled, the requester will pay for corresponding charges to copy
1376
+ # the object. For information about downloading objects from Requester
1377
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
1378
+ # in the *Amazon S3 User Guide*.
1379
+ #
1380
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1381
+ #
1382
+ # </note>
1383
+ #
1384
+ #
1385
+ #
1386
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
1387
+ # @option options [Array<String>] :optional_object_attributes
1388
+ # Specifies the optional fields that you want returned in the response.
1389
+ # Fields that you do not specify are not returned.
571
1390
  # @return [ObjectVersion::Collection]
572
1391
  def object_versions(options = {})
573
1392
  batches = Enumerator.new do |y|
574
1393
  options = options.merge(bucket: @name)
575
- resp = @client.list_object_versions(options)
1394
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1395
+ @client.list_object_versions(options)
1396
+ end
576
1397
  resp.each_page do |page|
577
1398
  batch = []
578
1399
  page.data.versions_delete_markers.each do |v|
@@ -596,29 +1417,102 @@ module Aws::S3
596
1417
  # delimiter: "Delimiter",
597
1418
  # encoding_type: "url", # accepts url
598
1419
  # prefix: "Prefix",
1420
+ # fetch_owner: false,
1421
+ # start_after: "StartAfter",
599
1422
  # request_payer: "requester", # accepts requester
1423
+ # expected_bucket_owner: "AccountId",
1424
+ # optional_object_attributes: ["RestoreStatus"], # accepts RestoreStatus
600
1425
  # })
601
1426
  # @param [Hash] options ({})
602
1427
  # @option options [String] :delimiter
603
- # A delimiter is a character you use to group keys.
1428
+ # A delimiter is a character that you use to group keys.
1429
+ #
1430
+ # <note markdown="1"> * **Directory buckets** - For directory buckets, `/` is the only
1431
+ # supported delimiter.
1432
+ #
1433
+ # * <b>Directory buckets </b> - When you query `ListObjectsV2` with a
1434
+ # delimiter during in-progress multipart uploads, the `CommonPrefixes`
1435
+ # response parameter contains the prefixes that are associated with
1436
+ # the in-progress multipart uploads. For more information about
1437
+ # multipart uploads, see [Multipart Upload Overview][1] in the *Amazon
1438
+ # S3 User Guide*.
1439
+ #
1440
+ # </note>
1441
+ #
1442
+ #
1443
+ #
1444
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html
604
1445
  # @option options [String] :encoding_type
605
- # Requests Amazon S3 to encode the object keys in the response and
606
- # specifies the encoding method to use. An object key may contain any
607
- # Unicode character; however, XML 1.0 parser cannot parse some
608
- # characters, such as characters with an ASCII value from 0 to 10. For
609
- # characters that are not supported in XML 1.0, you can add this
610
- # parameter to request that Amazon S3 encode the keys in the response.
1446
+ # Encoding type used by Amazon S3 to encode the [object keys][1] in the
1447
+ # response. Responses are encoded only in UTF-8. An object key can
1448
+ # contain any Unicode character. However, the XML 1.0 parser can't
1449
+ # parse certain characters, such as characters with an ASCII value from
1450
+ # 0 to 10. For characters that aren't supported in XML 1.0, you can add
1451
+ # this parameter to request that Amazon S3 encode the keys in the
1452
+ # response. For more information about characters to avoid in object key
1453
+ # names, see [Object key naming guidelines][2].
1454
+ #
1455
+ # <note markdown="1"> When using the URL encoding type, non-ASCII characters that are used
1456
+ # in an object's key name will be percent-encoded according to UTF-8
1457
+ # code values. For example, the object `test_file(3).png` will appear as
1458
+ # `test_file%283%29.png`.
1459
+ #
1460
+ # </note>
1461
+ #
1462
+ #
1463
+ #
1464
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
1465
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines
611
1466
  # @option options [String] :prefix
612
1467
  # Limits the response to keys that begin with the specified prefix.
1468
+ #
1469
+ # <note markdown="1"> **Directory buckets** - For directory buckets, only prefixes that end
1470
+ # in a delimiter (`/`) are supported.
1471
+ #
1472
+ # </note>
1473
+ # @option options [Boolean] :fetch_owner
1474
+ # The owner field is not present in `ListObjectsV2` by default. If you
1475
+ # want to return the owner field with each key in the result, then set
1476
+ # the `FetchOwner` field to `true`.
1477
+ #
1478
+ # <note markdown="1"> **Directory buckets** - For directory buckets, the bucket owner is
1479
+ # returned as the object owner for all objects.
1480
+ #
1481
+ # </note>
1482
+ # @option options [String] :start_after
1483
+ # StartAfter is where you want Amazon S3 to start listing from. Amazon
1484
+ # S3 starts listing after this specified key. StartAfter can be any key
1485
+ # in the bucket.
1486
+ #
1487
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1488
+ #
1489
+ # </note>
613
1490
  # @option options [String] :request_payer
614
1491
  # Confirms that the requester knows that she or he will be charged for
615
- # the list objects request. Bucket owners need not specify this
616
- # parameter in their requests.
1492
+ # the list objects request in V2 style. Bucket owners need not specify
1493
+ # this parameter in their requests.
1494
+ #
1495
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1496
+ #
1497
+ # </note>
1498
+ # @option options [String] :expected_bucket_owner
1499
+ # The account ID of the expected bucket owner. If the account ID that
1500
+ # you provide does not match the actual owner of the bucket, the request
1501
+ # fails with the HTTP status code `403 Forbidden` (access denied).
1502
+ # @option options [Array<String>] :optional_object_attributes
1503
+ # Specifies the optional fields that you want returned in the response.
1504
+ # Fields that you do not specify are not returned.
1505
+ #
1506
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1507
+ #
1508
+ # </note>
617
1509
  # @return [ObjectSummary::Collection]
618
1510
  def objects(options = {})
619
1511
  batches = Enumerator.new do |y|
620
1512
  options = options.merge(bucket: @name)
621
- resp = @client.list_objects(options)
1513
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1514
+ @client.list_objects_v2(options)
1515
+ end
622
1516
  resp.each_page do |page|
623
1517
  batch = []
624
1518
  page.data.contents.each do |c|
@@ -697,8 +1591,8 @@ module Aws::S3
697
1591
 
698
1592
  def yield_waiter_and_warn(waiter, &block)
699
1593
  if !@waiter_block_warned
700
- msg = "pass options to configure the waiter; "
701
- msg << "yielding the waiter is deprecated"
1594
+ msg = "pass options to configure the waiter; "\
1595
+ "yielding the waiter is deprecated"
702
1596
  warn(msg)
703
1597
  @waiter_block_warned = true
704
1598
  end
@@ -706,7 +1600,9 @@ module Aws::S3
706
1600
  end
707
1601
 
708
1602
  def separate_params_and_options(options)
709
- opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
1603
+ opts = Set.new(
1604
+ [:client, :max_attempts, :delay, :before_attempt, :before_wait]
1605
+ )
710
1606
  waiter_opts = {}
711
1607
  waiter_params = {}
712
1608
  options.each_pair do |key, value|
@@ -723,3 +1619,6 @@ module Aws::S3
723
1619
  class Collection < Aws::Resources::Collection; end
724
1620
  end
725
1621
  end
1622
+
1623
+ # Load customizations if they exist
1624
+ require 'aws-sdk-s3/customizations/bucket'