aws-sdk-s3 1.61.1 → 1.166.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 (135) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1255 -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 +814 -112
  8. data/lib/aws-sdk-s3/bucket_acl.rb +54 -17
  9. data/lib/aws-sdk-s3/bucket_cors.rb +63 -20
  10. data/lib/aws-sdk-s3/bucket_lifecycle.rb +63 -19
  11. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +64 -19
  12. data/lib/aws-sdk-s3/bucket_logging.rb +58 -17
  13. data/lib/aws-sdk-s3/bucket_notification.rb +47 -20
  14. data/lib/aws-sdk-s3/bucket_policy.rb +104 -17
  15. data/lib/aws-sdk-s3/bucket_region_cache.rb +11 -5
  16. data/lib/aws-sdk-s3/bucket_request_payment.rb +53 -19
  17. data/lib/aws-sdk-s3/bucket_tagging.rb +60 -17
  18. data/lib/aws-sdk-s3/bucket_versioning.rb +106 -17
  19. data/lib/aws-sdk-s3/bucket_website.rb +64 -19
  20. data/lib/aws-sdk-s3/client.rb +11280 -3232
  21. data/lib/aws-sdk-s3/client_api.rb +1078 -197
  22. data/lib/aws-sdk-s3/customizations/bucket.rb +33 -45
  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 +237 -39
  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 +25 -8
  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 +186 -0
  60. data/lib/aws-sdk-s3/endpoint_provider.rb +592 -0
  61. data/lib/aws-sdk-s3/endpoints.rb +2392 -0
  62. data/lib/aws-sdk-s3/errors.rb +27 -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 +176 -44
  67. data/lib/aws-sdk-s3/file_part.rb +2 -0
  68. data/lib/aws-sdk-s3/file_uploader.rb +28 -8
  69. data/lib/aws-sdk-s3/legacy_signer.rb +17 -25
  70. data/lib/aws-sdk-s3/multipart_file_uploader.rb +69 -13
  71. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +49 -18
  72. data/lib/aws-sdk-s3/multipart_upload.rb +242 -25
  73. data/lib/aws-sdk-s3/multipart_upload_error.rb +2 -0
  74. data/lib/aws-sdk-s3/multipart_upload_part.rb +343 -31
  75. data/lib/aws-sdk-s3/object.rb +2240 -218
  76. data/lib/aws-sdk-s3/object_acl.rb +80 -21
  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 +1900 -178
  80. data/lib/aws-sdk-s3/object_version.rb +449 -59
  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 +5 -41
  85. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +3 -6
  86. data/lib/aws-sdk-s3/plugins/dualstack.rb +7 -50
  87. data/lib/aws-sdk-s3/plugins/endpoints.rb +289 -0
  88. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +5 -4
  89. data/lib/aws-sdk-s3/plugins/express_session_auth.rb +97 -0
  90. data/lib/aws-sdk-s3/plugins/get_bucket_location_fix.rb +3 -1
  91. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +60 -15
  92. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +11 -27
  93. data/lib/aws-sdk-s3/plugins/location_constraint.rb +5 -1
  94. data/lib/aws-sdk-s3/plugins/md5s.rb +32 -26
  95. data/lib/aws-sdk-s3/plugins/redirects.rb +2 -0
  96. data/lib/aws-sdk-s3/plugins/s3_host_id.rb +2 -0
  97. data/lib/aws-sdk-s3/plugins/s3_signer.rb +50 -88
  98. data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +31 -0
  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 -103
  103. data/lib/aws-sdk-s3/presigner.rb +136 -61
  104. data/lib/aws-sdk-s3/resource.rb +120 -15
  105. data/lib/aws-sdk-s3/types.rb +9683 -4358
  106. data/lib/aws-sdk-s3/waiters.rb +67 -1
  107. data/lib/aws-sdk-s3.rb +40 -29
  108. data/sig/bucket.rbs +213 -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 +111 -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 +2397 -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 +34 -0
  125. data/sig/multipart_upload.rbs +111 -0
  126. data/sig/multipart_upload_part.rbs +105 -0
  127. data/sig/object.rbs +443 -0
  128. data/sig/object_acl.rbs +86 -0
  129. data/sig/object_summary.rbs +335 -0
  130. data/sig/object_version.rbs +137 -0
  131. data/sig/resource.rbs +130 -0
  132. data/sig/types.rbs +2585 -0
  133. data/sig/waiters.rbs +95 -0
  134. metadata +73 -15
  135. data/lib/aws-sdk-s3/plugins/bucket_arn.rb +0 -211
@@ -1,7 +1,9 @@
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
 
@@ -32,7 +34,8 @@ module Aws::S3
32
34
  @name
33
35
  end
34
36
 
35
- # 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.
36
39
  # @return [Time]
37
40
  def creation_date
38
41
  data[:creation_date]
@@ -92,7 +95,9 @@ module Aws::S3
92
95
  options, params = separate_params_and_options(options)
93
96
  waiter = Waiters::BucketExists.new(options)
94
97
  yield_waiter_and_warn(waiter, &block) if block_given?
95
- waiter.wait(params.merge(bucket: @name))
98
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
99
+ waiter.wait(params.merge(bucket: @name))
100
+ end
96
101
  Bucket.new({
97
102
  name: @name,
98
103
  client: @client
@@ -109,7 +114,9 @@ module Aws::S3
109
114
  options, params = separate_params_and_options(options)
110
115
  waiter = Waiters::BucketNotExists.new(options)
111
116
  yield_waiter_and_warn(waiter, &block) if block_given?
112
- waiter.wait(params.merge(bucket: @name))
117
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
118
+ waiter.wait(params.merge(bucket: @name))
119
+ end
113
120
  Bucket.new({
114
121
  name: @name,
115
122
  client: @client
@@ -121,7 +128,8 @@ module Aws::S3
121
128
  # Waiter polls an API operation until a resource enters a desired
122
129
  # state.
123
130
  #
124
- # @note The waiting operation is performed on a copy. The original resource remains unchanged
131
+ # @note The waiting operation is performed on a copy. The original resource
132
+ # remains unchanged.
125
133
  #
126
134
  # ## Basic Usage
127
135
  #
@@ -134,13 +142,15 @@ module Aws::S3
134
142
  #
135
143
  # ## Example
136
144
  #
137
- # instance.wait_until(max_attempts:10, delay:5) {|instance| instance.state.name == 'running' }
145
+ # instance.wait_until(max_attempts:10, delay:5) do |instance|
146
+ # instance.state.name == 'running'
147
+ # end
138
148
  #
139
149
  # ## Configuration
140
150
  #
141
151
  # You can configure the maximum number of polling attempts, and the
142
- # delay (in seconds) between each polling attempt. The waiting condition is set
143
- # by passing a block to {#wait_until}:
152
+ # delay (in seconds) between each polling attempt. The waiting condition is
153
+ # set by passing a block to {#wait_until}:
144
154
  #
145
155
  # # poll for ~25 seconds
146
156
  # resource.wait_until(max_attempts:5,delay:5) {|resource|...}
@@ -171,17 +181,16 @@ module Aws::S3
171
181
  # # resource did not enter the desired state in time
172
182
  # end
173
183
  #
184
+ # @yieldparam [Resource] resource to be used in the waiting condition.
174
185
  #
175
- # @yield param [Resource] resource to be used in the waiting condition
176
- #
177
- # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter terminates
178
- # because the waiter has entered a state that it will not transition
179
- # out of, preventing success.
186
+ # @raise [Aws::Waiters::Errors::FailureStateError] Raised when the waiter
187
+ # terminates because the waiter has entered a state that it will not
188
+ # transition out of, preventing success.
180
189
  #
181
190
  # yet successful.
182
191
  #
183
- # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is encountered
184
- # while polling for a resource that is not expected.
192
+ # @raise [Aws::Waiters::Errors::UnexpectedError] Raised when an error is
193
+ # encountered while polling for a resource that is not expected.
185
194
  #
186
195
  # @raise [NotImplementedError] Raised when the resource does not
187
196
  #
@@ -208,7 +217,9 @@ module Aws::S3
208
217
  :retry
209
218
  end
210
219
  end
211
- Aws::Waiters::Waiter.new(options).wait({})
220
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
221
+ Aws::Waiters::Waiter.new(options).wait({})
222
+ end
212
223
  end
213
224
 
214
225
  # @!group Actions
@@ -218,7 +229,15 @@ module Aws::S3
218
229
  # bucket.create({
219
230
  # acl: "private", # accepts private, public-read, public-read-write, authenticated-read
220
231
  # create_bucket_configuration: {
221
- # 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
232
+ # 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, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-north-1, eu-south-1, eu-south-2, 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
233
+ # location: {
234
+ # type: "AvailabilityZone", # accepts AvailabilityZone
235
+ # name: "LocationNameAsString",
236
+ # },
237
+ # bucket: {
238
+ # data_redundancy: "SingleAvailabilityZone", # accepts SingleAvailabilityZone
239
+ # type: "Directory", # accepts Directory
240
+ # },
222
241
  # },
223
242
  # grant_full_control: "GrantFullControl",
224
243
  # grant_read: "GrantRead",
@@ -226,42 +245,123 @@ module Aws::S3
226
245
  # grant_write: "GrantWrite",
227
246
  # grant_write_acp: "GrantWriteACP",
228
247
  # object_lock_enabled_for_bucket: false,
248
+ # object_ownership: "BucketOwnerPreferred", # accepts BucketOwnerPreferred, ObjectWriter, BucketOwnerEnforced
229
249
  # })
230
250
  # @param [Hash] options ({})
231
251
  # @option options [String] :acl
232
252
  # The canned ACL to apply to the bucket.
253
+ #
254
+ # <note markdown="1"> This functionality is not supported for directory buckets.
255
+ #
256
+ # </note>
233
257
  # @option options [Types::CreateBucketConfiguration] :create_bucket_configuration
234
258
  # The configuration information for the bucket.
235
259
  # @option options [String] :grant_full_control
236
260
  # Allows grantee the read, write, read ACP, and write ACP permissions on
237
261
  # the bucket.
262
+ #
263
+ # <note markdown="1"> This functionality is not supported for directory buckets.
264
+ #
265
+ # </note>
238
266
  # @option options [String] :grant_read
239
267
  # Allows grantee to list the objects in the bucket.
268
+ #
269
+ # <note markdown="1"> This functionality is not supported for directory buckets.
270
+ #
271
+ # </note>
240
272
  # @option options [String] :grant_read_acp
241
273
  # Allows grantee to read the bucket ACL.
274
+ #
275
+ # <note markdown="1"> This functionality is not supported for directory buckets.
276
+ #
277
+ # </note>
242
278
  # @option options [String] :grant_write
243
- # Allows grantee to create, overwrite, and delete any object in the
244
- # bucket.
279
+ # Allows grantee to create new objects in the bucket.
280
+ #
281
+ # For the bucket and object owners of existing objects, also allows
282
+ # deletions and overwrites of those objects.
283
+ #
284
+ # <note markdown="1"> This functionality is not supported for directory buckets.
285
+ #
286
+ # </note>
245
287
  # @option options [String] :grant_write_acp
246
288
  # Allows grantee to write the ACL for the applicable bucket.
289
+ #
290
+ # <note markdown="1"> This functionality is not supported for directory buckets.
291
+ #
292
+ # </note>
247
293
  # @option options [Boolean] :object_lock_enabled_for_bucket
248
294
  # Specifies whether you want S3 Object Lock to be enabled for the new
249
295
  # bucket.
296
+ #
297
+ # <note markdown="1"> This functionality is not supported for directory buckets.
298
+ #
299
+ # </note>
300
+ # @option options [String] :object_ownership
301
+ # The container element for object ownership for a bucket's ownership
302
+ # controls.
303
+ #
304
+ # `BucketOwnerPreferred` - Objects uploaded to the bucket change
305
+ # ownership to the bucket owner if the objects are uploaded with the
306
+ # `bucket-owner-full-control` canned ACL.
307
+ #
308
+ # `ObjectWriter` - The uploading account will own the object if the
309
+ # object is uploaded with the `bucket-owner-full-control` canned ACL.
310
+ #
311
+ # `BucketOwnerEnforced` - Access control lists (ACLs) are disabled and
312
+ # no longer affect permissions. The bucket owner automatically owns and
313
+ # has full control over every object in the bucket. The bucket only
314
+ # accepts PUT requests that don't specify an ACL or specify bucket
315
+ # owner full control ACLs (such as the predefined
316
+ # `bucket-owner-full-control` canned ACL or a custom ACL in XML format
317
+ # that grants the same permissions).
318
+ #
319
+ # By default, `ObjectOwnership` is set to `BucketOwnerEnforced` and ACLs
320
+ # are disabled. We recommend keeping ACLs disabled, except in uncommon
321
+ # use cases where you must control access for each object individually.
322
+ # For more information about S3 Object Ownership, see [Controlling
323
+ # ownership of objects and disabling ACLs for your bucket][1] in the
324
+ # *Amazon S3 User Guide*.
325
+ #
326
+ # <note markdown="1"> This functionality is not supported for directory buckets. Directory
327
+ # buckets use the bucket owner enforced setting for S3 Object Ownership.
328
+ #
329
+ # </note>
330
+ #
331
+ #
332
+ #
333
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html
250
334
  # @return [Types::CreateBucketOutput]
251
335
  def create(options = {})
252
336
  options = options.merge(bucket: @name)
253
- resp = @client.create_bucket(options)
337
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
338
+ @client.create_bucket(options)
339
+ end
254
340
  resp.data
255
341
  end
256
342
 
257
343
  # @example Request syntax with placeholder values
258
344
  #
259
- # bucket.delete()
345
+ # bucket.delete({
346
+ # expected_bucket_owner: "AccountId",
347
+ # })
260
348
  # @param [Hash] options ({})
349
+ # @option options [String] :expected_bucket_owner
350
+ # The account ID of the expected bucket owner. If the account ID that
351
+ # you provide does not match the actual owner of the bucket, the request
352
+ # fails with the HTTP status code `403 Forbidden` (access denied).
353
+ #
354
+ # <note markdown="1"> For directory buckets, this header is not supported in this API
355
+ # operation. If you specify this header, the request fails with the HTTP
356
+ # status code `501 Not Implemented`.
357
+ #
358
+ # </note>
261
359
  # @return [EmptyStructure]
262
360
  def delete(options = {})
263
361
  options = options.merge(bucket: @name)
264
- resp = @client.delete_bucket(options)
362
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
363
+ @client.delete_bucket(options)
364
+ end
265
365
  resp.data
266
366
  end
267
367
 
@@ -280,6 +380,8 @@ module Aws::S3
280
380
  # mfa: "MFA",
281
381
  # request_payer: "requester", # accepts requester
282
382
  # bypass_governance_retention: false,
383
+ # expected_bucket_owner: "AccountId",
384
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
283
385
  # })
284
386
  # @param [Hash] options ({})
285
387
  # @option options [required, Types::Delete] :delete
@@ -289,24 +391,91 @@ module Aws::S3
289
391
  # space, and the value that is displayed on your authentication device.
290
392
  # Required to permanently delete a versioned object if versioning is
291
393
  # configured with MFA delete enabled.
394
+ #
395
+ # When performing the `DeleteObjects` operation on an MFA delete enabled
396
+ # bucket, which attempts to delete the specified versioned objects, you
397
+ # must include an MFA token. If you don't provide an MFA token, the
398
+ # entire request will fail, even if there are non-versioned objects that
399
+ # you are trying to delete. If you provide an invalid token, whether
400
+ # there are versioned object keys in the request or not, the entire
401
+ # Multi-Object Delete request will fail. For information about MFA
402
+ # Delete, see [ MFA Delete][1] in the *Amazon S3 User Guide*.
403
+ #
404
+ # <note markdown="1"> This functionality is not supported for directory buckets.
405
+ #
406
+ # </note>
407
+ #
408
+ #
409
+ #
410
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete
292
411
  # @option options [String] :request_payer
293
412
  # Confirms that the requester knows that they will be charged for the
294
413
  # request. Bucket owners need not specify this parameter in their
295
- # requests. For information about downloading objects from requester
296
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
297
- # in the *Amazon S3 Developer Guide*.
414
+ # requests. If either the source or destination S3 bucket has Requester
415
+ # Pays enabled, the requester will pay for corresponding charges to copy
416
+ # the object. For information about downloading objects from Requester
417
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
418
+ # in the *Amazon S3 User Guide*.
419
+ #
420
+ # <note markdown="1"> This functionality is not supported for directory buckets.
421
+ #
422
+ # </note>
298
423
  #
299
424
  #
300
425
  #
301
426
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
302
427
  # @option options [Boolean] :bypass_governance_retention
303
428
  # Specifies whether you want to delete this object even if it has a
304
- # Governance-type Object Lock in place. You must have sufficient
305
- # permissions to perform this operation.
429
+ # Governance-type Object Lock in place. To use this header, you must
430
+ # have the `s3:BypassGovernanceRetention` permission.
431
+ #
432
+ # <note markdown="1"> This functionality is not supported for directory buckets.
433
+ #
434
+ # </note>
435
+ # @option options [String] :expected_bucket_owner
436
+ # The account ID of the expected bucket owner. If the account ID that
437
+ # you provide does not match the actual owner of the bucket, the request
438
+ # fails with the HTTP status code `403 Forbidden` (access denied).
439
+ # @option options [String] :checksum_algorithm
440
+ # Indicates the algorithm used to create the checksum for the object
441
+ # when you use the SDK. This header will not provide any additional
442
+ # functionality if you don't use the SDK. When you send this header,
443
+ # there must be a corresponding `x-amz-checksum-algorithm ` or
444
+ # `x-amz-trailer` header sent. Otherwise, Amazon S3 fails the request
445
+ # with the HTTP status code `400 Bad Request`.
446
+ #
447
+ # For the `x-amz-checksum-algorithm ` header, replace ` algorithm ` with
448
+ # the supported algorithm from the following list:
449
+ #
450
+ # * CRC32
451
+ #
452
+ # * CRC32C
453
+ #
454
+ # * SHA1
455
+ #
456
+ # * SHA256
457
+ #
458
+ # For more information, see [Checking object integrity][1] in the
459
+ # *Amazon S3 User Guide*.
460
+ #
461
+ # If the individual checksum value you provide through
462
+ # `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
463
+ # set through `x-amz-sdk-checksum-algorithm`, Amazon S3 ignores any
464
+ # provided `ChecksumAlgorithm` parameter and uses the checksum algorithm
465
+ # that matches the provided value in `x-amz-checksum-algorithm `.
466
+ #
467
+ # If you provide an individual checksum, Amazon S3 ignores any provided
468
+ # `ChecksumAlgorithm` parameter.
469
+ #
470
+ #
471
+ #
472
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
306
473
  # @return [Types::DeleteObjectsOutput]
307
474
  def delete_objects(options = {})
308
475
  options = options.merge(bucket: @name)
309
- resp = @client.delete_objects(options)
476
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
477
+ @client.delete_objects(options)
478
+ end
310
479
  resp.data
311
480
  end
312
481
 
@@ -322,7 +491,13 @@ module Aws::S3
322
491
  # content_length: 1,
323
492
  # content_md5: "ContentMD5",
324
493
  # content_type: "ContentType",
494
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
495
+ # checksum_crc32: "ChecksumCRC32",
496
+ # checksum_crc32c: "ChecksumCRC32C",
497
+ # checksum_sha1: "ChecksumSHA1",
498
+ # checksum_sha256: "ChecksumSHA256",
325
499
  # expires: Time.now,
500
+ # if_none_match: "IfNoneMatch",
326
501
  # grant_full_control: "GrantFullControl",
327
502
  # grant_read: "GrantRead",
328
503
  # grant_read_acp: "GrantReadACP",
@@ -331,29 +506,61 @@ module Aws::S3
331
506
  # metadata: {
332
507
  # "MetadataKey" => "MetadataValue",
333
508
  # },
334
- # server_side_encryption: "AES256", # accepts AES256, aws:kms
335
- # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE
509
+ # server_side_encryption: "AES256", # accepts AES256, aws:kms, aws:kms:dsse
510
+ # storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE, OUTPOSTS, GLACIER_IR, SNOW, EXPRESS_ONEZONE
336
511
  # website_redirect_location: "WebsiteRedirectLocation",
337
512
  # sse_customer_algorithm: "SSECustomerAlgorithm",
338
513
  # sse_customer_key: "SSECustomerKey",
339
514
  # sse_customer_key_md5: "SSECustomerKeyMD5",
340
515
  # ssekms_key_id: "SSEKMSKeyId",
341
516
  # ssekms_encryption_context: "SSEKMSEncryptionContext",
517
+ # bucket_key_enabled: false,
342
518
  # request_payer: "requester", # accepts requester
343
519
  # tagging: "TaggingHeader",
344
520
  # object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE
345
521
  # object_lock_retain_until_date: Time.now,
346
522
  # object_lock_legal_hold_status: "ON", # accepts ON, OFF
523
+ # expected_bucket_owner: "AccountId",
347
524
  # })
348
525
  # @param [Hash] options ({})
349
526
  # @option options [String] :acl
350
527
  # The canned ACL to apply to the object. For more information, see
351
- # [Canned ACL][1].
528
+ # [Canned ACL][1] in the *Amazon S3 User Guide*.
529
+ #
530
+ # When adding a new object, you can use headers to grant ACL-based
531
+ # permissions to individual Amazon Web Services accounts or to
532
+ # predefined groups defined by Amazon S3. These permissions are then
533
+ # added to the ACL on the object. By default, all objects are private.
534
+ # Only the owner has full access control. For more information, see
535
+ # [Access Control List (ACL) Overview][2] and [Managing ACLs Using the
536
+ # REST API][3] in the *Amazon S3 User Guide*.
537
+ #
538
+ # If the bucket that you're uploading objects to uses the bucket owner
539
+ # enforced setting for S3 Object Ownership, ACLs are disabled and no
540
+ # longer affect permissions. Buckets that use this setting only accept
541
+ # PUT requests that don't specify an ACL or PUT requests that specify
542
+ # bucket owner full control ACLs, such as the
543
+ # `bucket-owner-full-control` canned ACL or an equivalent form of this
544
+ # ACL expressed in the XML format. PUT requests that contain other ACLs
545
+ # (for example, custom grants to certain Amazon Web Services accounts)
546
+ # fail and return a `400` error with the error code
547
+ # `AccessControlListNotSupported`. For more information, see [
548
+ # Controlling ownership of objects and disabling ACLs][4] in the *Amazon
549
+ # S3 User Guide*.
550
+ #
551
+ # <note markdown="1"> * This functionality is not supported for directory buckets.
552
+ #
553
+ # * This functionality is not supported for Amazon S3 on Outposts.
554
+ #
555
+ # </note>
352
556
  #
353
557
  #
354
558
  #
355
559
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL
356
- # @option options [String, IO] :body
560
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html
561
+ # [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html
562
+ # [4]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html
563
+ # @option options [String, StringIO, File] :body
357
564
  # Object data.
358
565
  # @option options [String] :cache_control
359
566
  # Can be used to specify caching behavior along the request/reply chain.
@@ -366,30 +573,30 @@ module Aws::S3
366
573
  # @option options [String] :content_disposition
367
574
  # Specifies presentational information for the object. For more
368
575
  # information, see
369
- # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1][1].
576
+ # [https://www.rfc-editor.org/rfc/rfc6266#section-4][1].
370
577
  #
371
578
  #
372
579
  #
373
- # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
580
+ # [1]: https://www.rfc-editor.org/rfc/rfc6266#section-4
374
581
  # @option options [String] :content_encoding
375
582
  # Specifies what content encodings have been applied to the object and
376
583
  # thus what decoding mechanisms must be applied to obtain the media-type
377
584
  # referenced by the Content-Type header field. For more information, see
378
- # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11][1].
585
+ # [https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding][1].
379
586
  #
380
587
  #
381
588
  #
382
- # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
589
+ # [1]: https://www.rfc-editor.org/rfc/rfc9110.html#field.content-encoding
383
590
  # @option options [String] :content_language
384
591
  # The language the content is in.
385
592
  # @option options [Integer] :content_length
386
593
  # Size of the body in bytes. This parameter is useful when the size of
387
594
  # the body cannot be determined automatically. For more information, see
388
- # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13][1].
595
+ # [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length][1].
389
596
  #
390
597
  #
391
598
  #
392
- # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
599
+ # [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length
393
600
  # @option options [String] :content_md5
394
601
  # The base64-encoded 128-bit MD5 digest of the message (without the
395
602
  # headers) according to RFC 1864. This header can be used as a message
@@ -399,49 +606,255 @@ module Aws::S3
399
606
  # information about REST request authentication, see [REST
400
607
  # Authentication][1].
401
608
  #
609
+ # <note markdown="1"> The `Content-MD5` header is required for any request to upload an
610
+ # object with a retention period configured using Amazon S3 Object Lock.
611
+ # For more information about Amazon S3 Object Lock, see [Amazon S3
612
+ # Object Lock Overview][2] in the *Amazon S3 User Guide*.
613
+ #
614
+ # </note>
615
+ #
616
+ # <note markdown="1"> This functionality is not supported for directory buckets.
617
+ #
618
+ # </note>
619
+ #
402
620
  #
403
621
  #
404
622
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
623
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html
405
624
  # @option options [String] :content_type
406
625
  # A standard MIME type describing the format of the contents. For more
407
626
  # information, see
408
- # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17][1].
627
+ # [https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type][1].
628
+ #
629
+ #
630
+ #
631
+ # [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type
632
+ # @option options [String] :checksum_algorithm
633
+ # Indicates the algorithm used to create the checksum for the object
634
+ # when you use the SDK. This header will not provide any additional
635
+ # functionality if you don't use the SDK. When you send this header,
636
+ # there must be a corresponding `x-amz-checksum-algorithm ` or
637
+ # `x-amz-trailer` header sent. Otherwise, Amazon S3 fails the request
638
+ # with the HTTP status code `400 Bad Request`.
639
+ #
640
+ # For the `x-amz-checksum-algorithm ` header, replace ` algorithm ` with
641
+ # the supported algorithm from the following list:
642
+ #
643
+ # * CRC32
644
+ #
645
+ # * CRC32C
646
+ #
647
+ # * SHA1
648
+ #
649
+ # * SHA256
650
+ #
651
+ # For more information, see [Checking object integrity][1] in the
652
+ # *Amazon S3 User Guide*.
653
+ #
654
+ # If the individual checksum value you provide through
655
+ # `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
656
+ # set through `x-amz-sdk-checksum-algorithm`, Amazon S3 ignores any
657
+ # provided `ChecksumAlgorithm` parameter and uses the checksum algorithm
658
+ # that matches the provided value in `x-amz-checksum-algorithm `.
659
+ #
660
+ # <note markdown="1"> For directory buckets, when you use Amazon Web Services SDKs, `CRC32`
661
+ # is the default checksum algorithm that's used for performance.
662
+ #
663
+ # </note>
664
+ #
409
665
  #
410
666
  #
667
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
668
+ # @option options [String] :checksum_crc32
669
+ # This header can be used as a data integrity check to verify that the
670
+ # data received is the same data that was originally sent. This header
671
+ # specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
672
+ # more information, see [Checking object integrity][1] in the *Amazon S3
673
+ # User Guide*.
411
674
  #
412
- # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
675
+ #
676
+ #
677
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
678
+ # @option options [String] :checksum_crc32c
679
+ # This header can be used as a data integrity check to verify that the
680
+ # data received is the same data that was originally sent. This header
681
+ # specifies the base64-encoded, 32-bit CRC32C checksum of the object.
682
+ # For more information, see [Checking object integrity][1] in the
683
+ # *Amazon S3 User Guide*.
684
+ #
685
+ #
686
+ #
687
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
688
+ # @option options [String] :checksum_sha1
689
+ # This header can be used as a data integrity check to verify that the
690
+ # data received is the same data that was originally sent. This header
691
+ # specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
692
+ # more information, see [Checking object integrity][1] in the *Amazon S3
693
+ # User Guide*.
694
+ #
695
+ #
696
+ #
697
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
698
+ # @option options [String] :checksum_sha256
699
+ # This header can be used as a data integrity check to verify that the
700
+ # data received is the same data that was originally sent. This header
701
+ # specifies the base64-encoded, 256-bit SHA-256 digest of the object.
702
+ # For more information, see [Checking object integrity][1] in the
703
+ # *Amazon S3 User Guide*.
704
+ #
705
+ #
706
+ #
707
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
413
708
  # @option options [Time,DateTime,Date,Integer,String] :expires
414
709
  # The date and time at which the object is no longer cacheable. For more
415
710
  # information, see
416
- # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21][1].
711
+ # [https://www.rfc-editor.org/rfc/rfc7234#section-5.3][1].
712
+ #
713
+ #
417
714
  #
715
+ # [1]: https://www.rfc-editor.org/rfc/rfc7234#section-5.3
716
+ # @option options [String] :if_none_match
717
+ # Uploads the object only if the object key name does not already exist
718
+ # in the bucket specified. Otherwise, Amazon S3 returns a `412
719
+ # Precondition Failed` error.
418
720
  #
721
+ # If a conflicting operation occurs during the upload S3 returns a `409
722
+ # ConditionalRequestConflict` response. On a 409 failure you should
723
+ # retry the upload.
419
724
  #
420
- # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21
725
+ # Expects the '*' (asterisk) character.
726
+ #
727
+ # For more information about conditional requests, see [RFC 7232][1], or
728
+ # [Conditional requests][2] in the *Amazon S3 User Guide*.
729
+ #
730
+ #
731
+ #
732
+ # [1]: https://tools.ietf.org/html/rfc7232
733
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html
421
734
  # @option options [String] :grant_full_control
422
735
  # Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
423
736
  # object.
737
+ #
738
+ # <note markdown="1"> * This functionality is not supported for directory buckets.
739
+ #
740
+ # * This functionality is not supported for Amazon S3 on Outposts.
741
+ #
742
+ # </note>
424
743
  # @option options [String] :grant_read
425
744
  # Allows grantee to read the object data and its metadata.
745
+ #
746
+ # <note markdown="1"> * This functionality is not supported for directory buckets.
747
+ #
748
+ # * This functionality is not supported for Amazon S3 on Outposts.
749
+ #
750
+ # </note>
426
751
  # @option options [String] :grant_read_acp
427
752
  # Allows grantee to read the object ACL.
753
+ #
754
+ # <note markdown="1"> * This functionality is not supported for directory buckets.
755
+ #
756
+ # * This functionality is not supported for Amazon S3 on Outposts.
757
+ #
758
+ # </note>
428
759
  # @option options [String] :grant_write_acp
429
760
  # Allows grantee to write the ACL for the applicable object.
761
+ #
762
+ # <note markdown="1"> * This functionality is not supported for directory buckets.
763
+ #
764
+ # * This functionality is not supported for Amazon S3 on Outposts.
765
+ #
766
+ # </note>
430
767
  # @option options [required, String] :key
431
- # Object key for which the PUT operation was initiated.
768
+ # Object key for which the PUT action was initiated.
432
769
  # @option options [Hash<String,String>] :metadata
433
770
  # A map of metadata to store with the object in S3.
434
771
  # @option options [String] :server_side_encryption
435
- # The server-side encryption algorithm used when storing this object in
436
- # Amazon S3 (for example, AES256, aws:kms).
772
+ # The server-side encryption algorithm that was used when you store this
773
+ # object in Amazon S3 (for example, `AES256`, `aws:kms`,
774
+ # `aws:kms:dsse`).
775
+ #
776
+ # * <b>General purpose buckets </b> - You have four mutually exclusive
777
+ # options to protect data using server-side encryption in Amazon S3,
778
+ # depending on how you choose to manage the encryption keys.
779
+ # Specifically, the encryption key options are Amazon S3 managed keys
780
+ # (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and
781
+ # customer-provided keys (SSE-C). Amazon S3 encrypts data with
782
+ # server-side encryption by using Amazon S3 managed keys (SSE-S3) by
783
+ # default. You can optionally tell Amazon S3 to encrypt data at rest
784
+ # by using server-side encryption with other key options. For more
785
+ # information, see [Using Server-Side Encryption][1] in the *Amazon S3
786
+ # User Guide*.
787
+ #
788
+ # * <b>Directory buckets </b> - For directory buckets, there are only
789
+ # two supported options for server-side encryption: server-side
790
+ # encryption with Amazon S3 managed keys (SSE-S3) (`AES256`) and
791
+ # server-side encryption with KMS keys (SSE-KMS) (`aws:kms`). We
792
+ # recommend that the bucket's default encryption uses the desired
793
+ # encryption configuration and you don't override the bucket default
794
+ # encryption in your `CreateSession` requests or `PUT` object
795
+ # requests. Then, new objects are automatically encrypted with the
796
+ # desired encryption settings. For more information, see [Protecting
797
+ # data with server-side encryption][2] in the *Amazon S3 User Guide*.
798
+ # For more information about the encryption overriding behaviors in
799
+ # directory buckets, see [Specifying server-side encryption with KMS
800
+ # for new object uploads][3].
801
+ #
802
+ # In the Zonal endpoint API calls (except [CopyObject][4] and
803
+ # [UploadPartCopy][5]) using the REST API, the encryption request
804
+ # headers must match the encryption settings that are specified in the
805
+ # `CreateSession` request. You can't override the values of the
806
+ # encryption settings (`x-amz-server-side-encryption`,
807
+ # `x-amz-server-side-encryption-aws-kms-key-id`,
808
+ # `x-amz-server-side-encryption-context`, and
809
+ # `x-amz-server-side-encryption-bucket-key-enabled`) that are
810
+ # specified in the `CreateSession` request. You don't need to
811
+ # explicitly specify these encryption settings values in Zonal
812
+ # endpoint API calls, and Amazon S3 will use the encryption settings
813
+ # values from the `CreateSession` request to protect new objects in
814
+ # the directory bucket.
815
+ #
816
+ # <note markdown="1"> When you use the CLI or the Amazon Web Services SDKs, for
817
+ # `CreateSession`, the session token refreshes automatically to avoid
818
+ # service interruptions when a session expires. The CLI or the Amazon
819
+ # Web Services SDKs use the bucket's default encryption configuration
820
+ # for the `CreateSession` request. It's not supported to override the
821
+ # encryption settings values in the `CreateSession` request. So in the
822
+ # Zonal endpoint API calls (except [CopyObject][4] and
823
+ # [UploadPartCopy][5]), the encryption request headers must match the
824
+ # default encryption configuration of the directory bucket.
825
+ #
826
+ # </note>
827
+ #
828
+ #
829
+ #
830
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html
831
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html
832
+ # [3]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html
833
+ # [4]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html
834
+ # [5]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html
437
835
  # @option options [String] :storage_class
438
- # If you don't specify, Standard is the default storage class. Amazon
439
- # S3 supports other storage classes.
836
+ # By default, Amazon S3 uses the STANDARD Storage Class to store newly
837
+ # created objects. The STANDARD storage class provides high durability
838
+ # and high availability. Depending on performance needs, you can specify
839
+ # a different Storage Class. For more information, see [Storage
840
+ # Classes][1] in the *Amazon S3 User Guide*.
841
+ #
842
+ # <note markdown="1"> * For directory buckets, only the S3 Express One Zone storage class is
843
+ # supported to store newly created objects.
844
+ #
845
+ # * Amazon S3 on Outposts only uses the OUTPOSTS Storage Class.
846
+ #
847
+ # </note>
848
+ #
849
+ #
850
+ #
851
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html
440
852
  # @option options [String] :website_redirect_location
441
853
  # If the bucket is configured as a website, redirects requests for this
442
854
  # object to another object in the same bucket or to an external URL.
443
855
  # Amazon S3 stores the value of this header in the object metadata. For
444
- # information about object metadata, see [Object Key and Metadata][1].
856
+ # information about object metadata, see [Object Key and Metadata][1] in
857
+ # the *Amazon S3 User Guide*.
445
858
  #
446
859
  # In the following example, the request header sets the redirect to an
447
860
  # object (anotherPage.html) in the same bucket:
@@ -455,7 +868,11 @@ module Aws::S3
455
868
  #
456
869
  # For more information about website hosting in Amazon S3, see [Hosting
457
870
  # Websites on Amazon S3][2] and [How to Configure Website Page
458
- # Redirects][3].
871
+ # Redirects][3] in the *Amazon S3 User Guide*.
872
+ #
873
+ # <note markdown="1"> This functionality is not supported for directory buckets.
874
+ #
875
+ # </note>
459
876
  #
460
877
  #
461
878
  #
@@ -463,40 +880,118 @@ module Aws::S3
463
880
  # [2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
464
881
  # [3]: https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html
465
882
  # @option options [String] :sse_customer_algorithm
466
- # Specifies the algorithm to use to when encrypting the object (for
467
- # example, AES256).
883
+ # Specifies the algorithm to use when encrypting the object (for
884
+ # example, `AES256`).
885
+ #
886
+ # <note markdown="1"> This functionality is not supported for directory buckets.
887
+ #
888
+ # </note>
468
889
  # @option options [String] :sse_customer_key
469
890
  # Specifies the customer-provided encryption key for Amazon S3 to use in
470
891
  # encrypting data. This value is used to store the object and then it is
471
892
  # discarded; Amazon S3 does not store the encryption key. The key must
472
893
  # be appropriate for use with the algorithm specified in the
473
- # `x-amz-server-side​-encryption​-customer-algorithm` header.
894
+ # `x-amz-server-side-encryption-customer-algorithm` header.
895
+ #
896
+ # <note markdown="1"> This functionality is not supported for directory buckets.
897
+ #
898
+ # </note>
474
899
  # @option options [String] :sse_customer_key_md5
475
900
  # Specifies the 128-bit MD5 digest of the encryption key according to
476
901
  # RFC 1321. Amazon S3 uses this header for a message integrity check to
477
902
  # ensure that the encryption key was transmitted without error.
903
+ #
904
+ # <note markdown="1"> This functionality is not supported for directory buckets.
905
+ #
906
+ # </note>
478
907
  # @option options [String] :ssekms_key_id
479
- # If `x-amz-server-side-encryption` is present and has the value of
480
- # `aws:kms`, this header specifies the ID of the AWS Key Management
481
- # Service (AWS KMS) symmetrical customer managed customer master key
482
- # (CMK) that was used for the object.
483
- #
484
- # If the value of `x-amz-server-side-encryption` is `aws:kms`, this
485
- # header specifies the ID of the symmetric customer managed AWS KMS CMK
486
- # that will be used for the object. If you specify
487
- # `x-amz-server-side-encryption:aws:kms`, but do not provide`
488
- # x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the AWS
489
- # managed CMK in AWS to protect the data.
908
+ # Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for
909
+ # object encryption. If the KMS key doesn't exist in the same account
910
+ # that's issuing the command, you must use the full Key ARN not the Key
911
+ # ID.
912
+ #
913
+ # **General purpose buckets** - If you specify
914
+ # `x-amz-server-side-encryption` with `aws:kms` or `aws:kms:dsse`, this
915
+ # header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key
916
+ # to use. If you specify `x-amz-server-side-encryption:aws:kms` or
917
+ # `x-amz-server-side-encryption:aws:kms:dsse`, but do not provide
918
+ # `x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the
919
+ # Amazon Web Services managed key (`aws/s3`) to protect the data.
920
+ #
921
+ # **Directory buckets** - If you specify `x-amz-server-side-encryption`
922
+ # with `aws:kms`, you must specify the `
923
+ # x-amz-server-side-encryption-aws-kms-key-id` header with the ID (Key
924
+ # ID or Key ARN) of the KMS symmetric encryption customer managed key to
925
+ # use. Otherwise, you get an HTTP `400 Bad Request` error. Only use the
926
+ # key ID or key ARN. The key alias format of the KMS key isn't
927
+ # supported. Your SSE-KMS configuration can only support 1 [customer
928
+ # managed key][1] per directory bucket for the lifetime of the bucket.
929
+ # [Amazon Web Services managed key][2] (`aws/s3`) isn't supported.
930
+ #
931
+ #
932
+ #
933
+ # [1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
934
+ # [2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
490
935
  # @option options [String] :ssekms_encryption_context
491
- # Specifies the AWS KMS Encryption Context to use for object encryption.
492
- # The value of this header is a base64-encoded UTF-8 string holding JSON
493
- # with the encryption context key-value pairs.
936
+ # Specifies the Amazon Web Services KMS Encryption Context as an
937
+ # additional encryption context to use for object encryption. The value
938
+ # of this header is a Base64-encoded string of a UTF-8 encoded JSON,
939
+ # which contains the encryption context as key-value pairs. This value
940
+ # is stored as object metadata and automatically gets passed on to
941
+ # Amazon Web Services KMS for future `GetObject` operations on this
942
+ # object.
943
+ #
944
+ # **General purpose buckets** - This value must be explicitly added
945
+ # during `CopyObject` operations if you want an additional encryption
946
+ # context for your object. For more information, see [Encryption
947
+ # context][1] in the *Amazon S3 User Guide*.
948
+ #
949
+ # **Directory buckets** - You can optionally provide an explicit
950
+ # encryption context value. The value must match the default encryption
951
+ # context - the bucket Amazon Resource Name (ARN). An additional
952
+ # encryption context value is not supported.
953
+ #
954
+ #
955
+ #
956
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#encryption-context
957
+ # @option options [Boolean] :bucket_key_enabled
958
+ # Specifies whether Amazon S3 should use an S3 Bucket Key for object
959
+ # encryption with server-side encryption using Key Management Service
960
+ # (KMS) keys (SSE-KMS).
961
+ #
962
+ # **General purpose buckets** - Setting this header to `true` causes
963
+ # Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.
964
+ # Also, specifying this header with a PUT action doesn't affect
965
+ # bucket-level settings for S3 Bucket Key.
966
+ #
967
+ # **Directory buckets** - S3 Bucket Keys are always enabled for `GET`
968
+ # and `PUT` operations in a directory bucket and can’t be disabled. S3
969
+ # Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects
970
+ # from general purpose buckets to directory buckets, from directory
971
+ # buckets to general purpose buckets, or between directory buckets,
972
+ # through [CopyObject][1], [UploadPartCopy][2], [the Copy operation in
973
+ # Batch Operations][3], or [the import jobs][4]. In this case, Amazon S3
974
+ # makes a call to KMS every time a copy request is made for a
975
+ # KMS-encrypted object.
976
+ #
977
+ #
978
+ #
979
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html
980
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html
981
+ # [3]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-Batch-Ops
982
+ # [4]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-import-job
494
983
  # @option options [String] :request_payer
495
984
  # Confirms that the requester knows that they will be charged for the
496
985
  # request. Bucket owners need not specify this parameter in their
497
- # requests. For information about downloading objects from requester
498
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
499
- # in the *Amazon S3 Developer Guide*.
986
+ # requests. If either the source or destination S3 bucket has Requester
987
+ # Pays enabled, the requester will pay for corresponding charges to copy
988
+ # the object. For information about downloading objects from Requester
989
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
990
+ # in the *Amazon S3 User Guide*.
991
+ #
992
+ # <note markdown="1"> This functionality is not supported for directory buckets.
993
+ #
994
+ # </note>
500
995
  #
501
996
  #
502
997
  #
@@ -504,21 +999,45 @@ module Aws::S3
504
999
  # @option options [String] :tagging
505
1000
  # The tag-set for the object. The tag-set must be encoded as URL Query
506
1001
  # parameters. (For example, "Key1=Value1")
1002
+ #
1003
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1004
+ #
1005
+ # </note>
507
1006
  # @option options [String] :object_lock_mode
508
1007
  # The Object Lock mode that you want to apply to this object.
1008
+ #
1009
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1010
+ #
1011
+ # </note>
509
1012
  # @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date
510
1013
  # The date and time when you want this object's Object Lock to expire.
1014
+ # Must be formatted as a timestamp parameter.
1015
+ #
1016
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1017
+ #
1018
+ # </note>
511
1019
  # @option options [String] :object_lock_legal_hold_status
512
1020
  # Specifies whether a legal hold will be applied to this object. For
513
- # more information about S3 Object Lock, see [Object Lock][1].
1021
+ # more information about S3 Object Lock, see [Object Lock][1] in the
1022
+ # *Amazon S3 User Guide*.
1023
+ #
1024
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1025
+ #
1026
+ # </note>
514
1027
  #
515
1028
  #
516
1029
  #
517
1030
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html
1031
+ # @option options [String] :expected_bucket_owner
1032
+ # The account ID of the expected bucket owner. If the account ID that
1033
+ # you provide does not match the actual owner of the bucket, the request
1034
+ # fails with the HTTP status code `403 Forbidden` (access denied).
518
1035
  # @return [Object]
519
1036
  def put_object(options = {})
520
1037
  options = options.merge(bucket: @name)
521
- resp = @client.put_object(options)
1038
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1039
+ @client.put_object(options)
1040
+ end
522
1041
  Object.new(
523
1042
  bucket_name: @name,
524
1043
  key: options[:key],
@@ -576,6 +1095,8 @@ module Aws::S3
576
1095
  # key_marker: "KeyMarker",
577
1096
  # prefix: "Prefix",
578
1097
  # upload_id_marker: "UploadIdMarker",
1098
+ # expected_bucket_owner: "AccountId",
1099
+ # request_payer: "requester", # accepts requester
579
1100
  # })
580
1101
  # @param [Hash] options ({})
581
1102
  # @option options [String] :delimiter
@@ -587,30 +1108,70 @@ module Aws::S3
587
1108
  # don't specify the prefix parameter, then the substring starts at the
588
1109
  # beginning of the key. The keys that are grouped under `CommonPrefixes`
589
1110
  # result element are not returned elsewhere in the response.
1111
+ #
1112
+ # <note markdown="1"> **Directory buckets** - For directory buckets, `/` is the only
1113
+ # supported delimiter.
1114
+ #
1115
+ # </note>
590
1116
  # @option options [String] :encoding_type
591
- # Requests Amazon S3 to encode the object keys in the response and
592
- # specifies the encoding method to use. An object key may contain any
593
- # Unicode character; however, XML 1.0 parser cannot parse some
594
- # characters, such as characters with an ASCII value from 0 to 10. For
595
- # characters that are not supported in XML 1.0, you can add this
596
- # parameter to request that Amazon S3 encode the keys in the response.
1117
+ # Encoding type used by Amazon S3 to encode the [object keys][1] in the
1118
+ # response. Responses are encoded only in UTF-8. An object key can
1119
+ # contain any Unicode character. However, the XML 1.0 parser can't
1120
+ # parse certain characters, such as characters with an ASCII value from
1121
+ # 0 to 10. For characters that aren't supported in XML 1.0, you can add
1122
+ # this parameter to request that Amazon S3 encode the keys in the
1123
+ # response. For more information about characters to avoid in object key
1124
+ # names, see [Object key naming guidelines][2].
1125
+ #
1126
+ # <note markdown="1"> When using the URL encoding type, non-ASCII characters that are used
1127
+ # in an object's key name will be percent-encoded according to UTF-8
1128
+ # code values. For example, the object `test_file(3).png` will appear as
1129
+ # `test_file%283%29.png`.
1130
+ #
1131
+ # </note>
1132
+ #
1133
+ #
1134
+ #
1135
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
1136
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines
597
1137
  # @option options [String] :key_marker
598
- # Together with upload-id-marker, this parameter specifies the multipart
599
- # upload after which listing should begin.
1138
+ # Specifies the multipart upload after which listing should begin.
600
1139
  #
601
- # If `upload-id-marker` is not specified, only the keys
602
- # lexicographically greater than the specified `key-marker` will be
603
- # included in the list.
1140
+ # <note markdown="1"> * **General purpose buckets** - For general purpose buckets,
1141
+ # `key-marker` is an object key. Together with `upload-id-marker`,
1142
+ # this parameter specifies the multipart upload after which listing
1143
+ # should begin.
604
1144
  #
605
- # If `upload-id-marker` is specified, any multipart uploads for a key
606
- # equal to the `key-marker` might also be included, provided those
607
- # multipart uploads have upload IDs lexicographically greater than the
608
- # specified `upload-id-marker`.
1145
+ # If `upload-id-marker` is not specified, only the keys
1146
+ # lexicographically greater than the specified `key-marker` will be
1147
+ # included in the list.
1148
+ #
1149
+ # If `upload-id-marker` is specified, any multipart uploads for a key
1150
+ # equal to the `key-marker` might also be included, provided those
1151
+ # multipart uploads have upload IDs lexicographically greater than the
1152
+ # specified `upload-id-marker`.
1153
+ #
1154
+ # * **Directory buckets** - For directory buckets, `key-marker` is
1155
+ # obfuscated and isn't a real object key. The `upload-id-marker`
1156
+ # parameter isn't supported by directory buckets. To list the
1157
+ # additional multipart uploads, you only need to set the value of
1158
+ # `key-marker` to the `NextKeyMarker` value from the previous
1159
+ # response.
1160
+ #
1161
+ # In the `ListMultipartUploads` response, the multipart uploads
1162
+ # aren't sorted lexicographically based on the object keys.
1163
+ #
1164
+ # </note>
609
1165
  # @option options [String] :prefix
610
1166
  # Lists in-progress uploads only for those keys that begin with the
611
1167
  # specified prefix. You can use prefixes to separate a bucket into
612
- # different grouping of keys. (You can think of using prefix to make
613
- # groups in the same way you'd use a folder in a file system.)
1168
+ # different grouping of keys. (You can think of using `prefix` to make
1169
+ # groups in the same way that you'd use a folder in a file system.)
1170
+ #
1171
+ # <note markdown="1"> **Directory buckets** - For directory buckets, only prefixes that end
1172
+ # in a delimiter (`/`) are supported.
1173
+ #
1174
+ # </note>
614
1175
  # @option options [String] :upload_id_marker
615
1176
  # Together with key-marker, specifies the multipart upload after which
616
1177
  # listing should begin. If key-marker is not specified, the
@@ -618,11 +1179,37 @@ module Aws::S3
618
1179
  # uploads for a key equal to the key-marker might be included in the
619
1180
  # list only if they have an upload ID lexicographically greater than the
620
1181
  # specified `upload-id-marker`.
1182
+ #
1183
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1184
+ #
1185
+ # </note>
1186
+ # @option options [String] :expected_bucket_owner
1187
+ # The account ID of the expected bucket owner. If the account ID that
1188
+ # you provide does not match the actual owner of the bucket, the request
1189
+ # fails with the HTTP status code `403 Forbidden` (access denied).
1190
+ # @option options [String] :request_payer
1191
+ # Confirms that the requester knows that they will be charged for the
1192
+ # request. Bucket owners need not specify this parameter in their
1193
+ # requests. If either the source or destination S3 bucket has Requester
1194
+ # Pays enabled, the requester will pay for corresponding charges to copy
1195
+ # the object. For information about downloading objects from Requester
1196
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
1197
+ # in the *Amazon S3 User Guide*.
1198
+ #
1199
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1200
+ #
1201
+ # </note>
1202
+ #
1203
+ #
1204
+ #
1205
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
621
1206
  # @return [MultipartUpload::Collection]
622
1207
  def multipart_uploads(options = {})
623
1208
  batches = Enumerator.new do |y|
624
1209
  options = options.merge(bucket: @name)
625
- resp = @client.list_multipart_uploads(options)
1210
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1211
+ @client.list_multipart_uploads(options)
1212
+ end
626
1213
  resp.each_page do |page|
627
1214
  batch = []
628
1215
  page.data.uploads.each do |u|
@@ -666,38 +1253,80 @@ module Aws::S3
666
1253
  # key_marker: "KeyMarker",
667
1254
  # prefix: "Prefix",
668
1255
  # version_id_marker: "VersionIdMarker",
1256
+ # expected_bucket_owner: "AccountId",
1257
+ # request_payer: "requester", # accepts requester
1258
+ # optional_object_attributes: ["RestoreStatus"], # accepts RestoreStatus
669
1259
  # })
670
1260
  # @param [Hash] options ({})
671
1261
  # @option options [String] :delimiter
672
1262
  # A delimiter is a character that you specify to group keys. All keys
673
1263
  # that contain the same string between the `prefix` and the first
674
1264
  # occurrence of the delimiter are grouped under a single result element
675
- # in CommonPrefixes. These groups are counted as one result against the
676
- # max-keys limitation. These keys are not returned elsewhere in the
677
- # response.
1265
+ # in `CommonPrefixes`. These groups are counted as one result against
1266
+ # the `max-keys` limitation. These keys are not returned elsewhere in
1267
+ # the response.
678
1268
  # @option options [String] :encoding_type
679
- # Requests Amazon S3 to encode the object keys in the response and
680
- # specifies the encoding method to use. An object key may contain any
681
- # Unicode character; however, XML 1.0 parser cannot parse some
682
- # characters, such as characters with an ASCII value from 0 to 10. For
683
- # characters that are not supported in XML 1.0, you can add this
684
- # parameter to request that Amazon S3 encode the keys in the response.
1269
+ # Encoding type used by Amazon S3 to encode the [object keys][1] in the
1270
+ # response. Responses are encoded only in UTF-8. An object key can
1271
+ # contain any Unicode character. However, the XML 1.0 parser can't
1272
+ # parse certain characters, such as characters with an ASCII value from
1273
+ # 0 to 10. For characters that aren't supported in XML 1.0, you can add
1274
+ # this parameter to request that Amazon S3 encode the keys in the
1275
+ # response. For more information about characters to avoid in object key
1276
+ # names, see [Object key naming guidelines][2].
1277
+ #
1278
+ # <note markdown="1"> When using the URL encoding type, non-ASCII characters that are used
1279
+ # in an object's key name will be percent-encoded according to UTF-8
1280
+ # code values. For example, the object `test_file(3).png` will appear as
1281
+ # `test_file%283%29.png`.
1282
+ #
1283
+ # </note>
1284
+ #
1285
+ #
1286
+ #
1287
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
1288
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines
685
1289
  # @option options [String] :key_marker
686
1290
  # Specifies the key to start with when listing objects in a bucket.
687
1291
  # @option options [String] :prefix
688
1292
  # Use this parameter to select only those keys that begin with the
689
1293
  # specified prefix. You can use prefixes to separate a bucket into
690
- # different groupings of keys. (You can think of using prefix to make
691
- # groups in the same way you'd use a folder in a file system.) You can
692
- # use prefix with delimiter to roll up numerous objects into a single
693
- # result under CommonPrefixes.
1294
+ # different groupings of keys. (You can think of using `prefix` to make
1295
+ # groups in the same way that you'd use a folder in a file system.) You
1296
+ # can use `prefix` with `delimiter` to roll up numerous objects into a
1297
+ # single result under `CommonPrefixes`.
694
1298
  # @option options [String] :version_id_marker
695
1299
  # Specifies the object version you want to start listing from.
1300
+ # @option options [String] :expected_bucket_owner
1301
+ # The account ID of the expected bucket owner. If the account ID that
1302
+ # you provide does not match the actual owner of the bucket, the request
1303
+ # fails with the HTTP status code `403 Forbidden` (access denied).
1304
+ # @option options [String] :request_payer
1305
+ # Confirms that the requester knows that they will be charged for the
1306
+ # request. Bucket owners need not specify this parameter in their
1307
+ # requests. If either the source or destination S3 bucket has Requester
1308
+ # Pays enabled, the requester will pay for corresponding charges to copy
1309
+ # the object. For information about downloading objects from Requester
1310
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
1311
+ # in the *Amazon S3 User Guide*.
1312
+ #
1313
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1314
+ #
1315
+ # </note>
1316
+ #
1317
+ #
1318
+ #
1319
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
1320
+ # @option options [Array<String>] :optional_object_attributes
1321
+ # Specifies the optional fields that you want returned in the response.
1322
+ # Fields that you do not specify are not returned.
696
1323
  # @return [ObjectVersion::Collection]
697
1324
  def object_versions(options = {})
698
1325
  batches = Enumerator.new do |y|
699
1326
  options = options.merge(bucket: @name)
700
- resp = @client.list_object_versions(options)
1327
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1328
+ @client.list_object_versions(options)
1329
+ end
701
1330
  resp.each_page do |page|
702
1331
  batch = []
703
1332
  page.data.versions_delete_markers.each do |v|
@@ -724,31 +1353,99 @@ module Aws::S3
724
1353
  # fetch_owner: false,
725
1354
  # start_after: "StartAfter",
726
1355
  # request_payer: "requester", # accepts requester
1356
+ # expected_bucket_owner: "AccountId",
1357
+ # optional_object_attributes: ["RestoreStatus"], # accepts RestoreStatus
727
1358
  # })
728
1359
  # @param [Hash] options ({})
729
1360
  # @option options [String] :delimiter
730
- # A delimiter is a character you use to group keys.
1361
+ # A delimiter is a character that you use to group keys.
1362
+ #
1363
+ # <note markdown="1"> * **Directory buckets** - For directory buckets, `/` is the only
1364
+ # supported delimiter.
1365
+ #
1366
+ # * <b>Directory buckets </b> - When you query `ListObjectsV2` with a
1367
+ # delimiter during in-progress multipart uploads, the `CommonPrefixes`
1368
+ # response parameter contains the prefixes that are associated with
1369
+ # the in-progress multipart uploads. For more information about
1370
+ # multipart uploads, see [Multipart Upload Overview][1] in the *Amazon
1371
+ # S3 User Guide*.
1372
+ #
1373
+ # </note>
1374
+ #
1375
+ #
1376
+ #
1377
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html
731
1378
  # @option options [String] :encoding_type
732
- # Encoding type used by Amazon S3 to encode object keys in the response.
1379
+ # Encoding type used by Amazon S3 to encode the [object keys][1] in the
1380
+ # response. Responses are encoded only in UTF-8. An object key can
1381
+ # contain any Unicode character. However, the XML 1.0 parser can't
1382
+ # parse certain characters, such as characters with an ASCII value from
1383
+ # 0 to 10. For characters that aren't supported in XML 1.0, you can add
1384
+ # this parameter to request that Amazon S3 encode the keys in the
1385
+ # response. For more information about characters to avoid in object key
1386
+ # names, see [Object key naming guidelines][2].
1387
+ #
1388
+ # <note markdown="1"> When using the URL encoding type, non-ASCII characters that are used
1389
+ # in an object's key name will be percent-encoded according to UTF-8
1390
+ # code values. For example, the object `test_file(3).png` will appear as
1391
+ # `test_file%283%29.png`.
1392
+ #
1393
+ # </note>
1394
+ #
1395
+ #
1396
+ #
1397
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
1398
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-guidelines
733
1399
  # @option options [String] :prefix
734
1400
  # Limits the response to keys that begin with the specified prefix.
1401
+ #
1402
+ # <note markdown="1"> **Directory buckets** - For directory buckets, only prefixes that end
1403
+ # in a delimiter (`/`) are supported.
1404
+ #
1405
+ # </note>
735
1406
  # @option options [Boolean] :fetch_owner
736
- # The owner field is not present in listV2 by default, if you want to
737
- # return owner field with each key in the result then set the fetch
738
- # owner field to true.
1407
+ # The owner field is not present in `ListObjectsV2` by default. If you
1408
+ # want to return the owner field with each key in the result, then set
1409
+ # the `FetchOwner` field to `true`.
1410
+ #
1411
+ # <note markdown="1"> **Directory buckets** - For directory buckets, the bucket owner is
1412
+ # returned as the object owner for all objects.
1413
+ #
1414
+ # </note>
739
1415
  # @option options [String] :start_after
740
1416
  # StartAfter is where you want Amazon S3 to start listing from. Amazon
741
1417
  # S3 starts listing after this specified key. StartAfter can be any key
742
1418
  # in the bucket.
1419
+ #
1420
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1421
+ #
1422
+ # </note>
743
1423
  # @option options [String] :request_payer
744
1424
  # Confirms that the requester knows that she or he will be charged for
745
1425
  # the list objects request in V2 style. Bucket owners need not specify
746
1426
  # this parameter in their requests.
1427
+ #
1428
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1429
+ #
1430
+ # </note>
1431
+ # @option options [String] :expected_bucket_owner
1432
+ # The account ID of the expected bucket owner. If the account ID that
1433
+ # you provide does not match the actual owner of the bucket, the request
1434
+ # fails with the HTTP status code `403 Forbidden` (access denied).
1435
+ # @option options [Array<String>] :optional_object_attributes
1436
+ # Specifies the optional fields that you want returned in the response.
1437
+ # Fields that you do not specify are not returned.
1438
+ #
1439
+ # <note markdown="1"> This functionality is not supported for directory buckets.
1440
+ #
1441
+ # </note>
747
1442
  # @return [ObjectSummary::Collection]
748
1443
  def objects(options = {})
749
1444
  batches = Enumerator.new do |y|
750
1445
  options = options.merge(bucket: @name)
751
- resp = @client.list_objects_v2(options)
1446
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1447
+ @client.list_objects_v2(options)
1448
+ end
752
1449
  resp.each_page do |page|
753
1450
  batch = []
754
1451
  page.data.contents.each do |c|
@@ -827,8 +1524,8 @@ module Aws::S3
827
1524
 
828
1525
  def yield_waiter_and_warn(waiter, &block)
829
1526
  if !@waiter_block_warned
830
- msg = "pass options to configure the waiter; "
831
- msg << "yielding the waiter is deprecated"
1527
+ msg = "pass options to configure the waiter; "\
1528
+ "yielding the waiter is deprecated"
832
1529
  warn(msg)
833
1530
  @waiter_block_warned = true
834
1531
  end
@@ -836,7 +1533,9 @@ module Aws::S3
836
1533
  end
837
1534
 
838
1535
  def separate_params_and_options(options)
839
- opts = Set.new([:client, :max_attempts, :delay, :before_attempt, :before_wait])
1536
+ opts = Set.new(
1537
+ [:client, :max_attempts, :delay, :before_attempt, :before_wait]
1538
+ )
840
1539
  waiter_opts = {}
841
1540
  waiter_params = {}
842
1541
  options.each_pair do |key, value|
@@ -853,3 +1552,6 @@ module Aws::S3
853
1552
  class Collection < Aws::Resources::Collection; end
854
1553
  end
855
1554
  end
1555
+
1556
+ # Load customizations if they exist
1557
+ require 'aws-sdk-s3/customizations/bucket'