aws-sdk-s3 1.79.1 → 1.212.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 (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1548 -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 +900 -98
  8. data/lib/aws-sdk-s3/bucket_acl.rb +44 -10
  9. data/lib/aws-sdk-s3/bucket_cors.rb +51 -11
  10. data/lib/aws-sdk-s3/bucket_lifecycle.rb +53 -8
  11. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +107 -9
  12. data/lib/aws-sdk-s3/bucket_logging.rb +43 -6
  13. data/lib/aws-sdk-s3/bucket_notification.rb +32 -9
  14. data/lib/aws-sdk-s3/bucket_policy.rb +90 -6
  15. data/lib/aws-sdk-s3/bucket_region_cache.rb +9 -5
  16. data/lib/aws-sdk-s3/bucket_request_payment.rb +38 -8
  17. data/lib/aws-sdk-s3/bucket_tagging.rb +46 -7
  18. data/lib/aws-sdk-s3/bucket_versioning.rb +127 -9
  19. data/lib/aws-sdk-s3/bucket_website.rb +46 -7
  20. data/lib/aws-sdk-s3/client.rb +13729 -3146
  21. data/lib/aws-sdk-s3/client_api.rb +1604 -277
  22. data/lib/aws-sdk-s3/customizations/bucket.rb +31 -47
  23. data/lib/aws-sdk-s3/customizations/errors.rb +40 -0
  24. data/lib/aws-sdk-s3/customizations/object.rb +253 -82
  25. data/lib/aws-sdk-s3/customizations/object_summary.rb +5 -0
  26. data/lib/aws-sdk-s3/customizations/object_version.rb +13 -0
  27. data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
  28. data/lib/aws-sdk-s3/customizations.rb +28 -29
  29. data/lib/aws-sdk-s3/default_executor.rb +103 -0
  30. data/lib/aws-sdk-s3/encryption/client.rb +9 -5
  31. data/lib/aws-sdk-s3/encryption/decrypt_handler.rb +0 -4
  32. data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +2 -0
  33. data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +2 -0
  34. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +15 -9
  35. data/lib/aws-sdk-s3/encryptionV2/client.rb +105 -26
  36. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +7 -165
  37. data/lib/aws-sdk-s3/encryptionV2/decryption.rb +205 -0
  38. data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +20 -3
  39. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +2 -4
  40. data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +2 -0
  41. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +18 -6
  42. data/lib/aws-sdk-s3/encryptionV2/utils.rb +5 -0
  43. data/lib/aws-sdk-s3/encryptionV3/client.rb +885 -0
  44. data/lib/aws-sdk-s3/encryptionV3/decrypt_handler.rb +98 -0
  45. data/lib/aws-sdk-s3/encryptionV3/decryption.rb +244 -0
  46. data/lib/aws-sdk-s3/encryptionV3/default_cipher_provider.rb +159 -0
  47. data/lib/aws-sdk-s3/encryptionV3/default_key_provider.rb +35 -0
  48. data/lib/aws-sdk-s3/encryptionV3/encrypt_handler.rb +98 -0
  49. data/lib/aws-sdk-s3/encryptionV3/errors.rb +47 -0
  50. data/lib/aws-sdk-s3/encryptionV3/io_auth_decrypter.rb +60 -0
  51. data/lib/aws-sdk-s3/encryptionV3/io_decrypter.rb +35 -0
  52. data/lib/aws-sdk-s3/encryptionV3/io_encrypter.rb +84 -0
  53. data/lib/aws-sdk-s3/encryptionV3/key_provider.rb +28 -0
  54. data/lib/aws-sdk-s3/encryptionV3/kms_cipher_provider.rb +159 -0
  55. data/lib/aws-sdk-s3/encryptionV3/materials.rb +58 -0
  56. data/lib/aws-sdk-s3/encryptionV3/utils.rb +321 -0
  57. data/lib/aws-sdk-s3/encryption_v2.rb +1 -0
  58. data/lib/aws-sdk-s3/encryption_v3.rb +24 -0
  59. data/lib/aws-sdk-s3/endpoint_parameters.rb +181 -0
  60. data/lib/aws-sdk-s3/endpoint_provider.rb +889 -0
  61. data/lib/aws-sdk-s3/endpoints.rb +1544 -0
  62. data/lib/aws-sdk-s3/errors.rb +80 -1
  63. data/lib/aws-sdk-s3/event_streams.rb +1 -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 +258 -82
  67. data/lib/aws-sdk-s3/file_uploader.rb +25 -14
  68. data/lib/aws-sdk-s3/legacy_signer.rb +17 -26
  69. data/lib/aws-sdk-s3/multipart_download_error.rb +8 -0
  70. data/lib/aws-sdk-s3/multipart_file_uploader.rb +111 -86
  71. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +110 -92
  72. data/lib/aws-sdk-s3/multipart_upload.rb +304 -14
  73. data/lib/aws-sdk-s3/multipart_upload_error.rb +3 -4
  74. data/lib/aws-sdk-s3/multipart_upload_part.rb +344 -20
  75. data/lib/aws-sdk-s3/object.rb +2457 -225
  76. data/lib/aws-sdk-s3/object_acl.rb +76 -15
  77. data/lib/aws-sdk-s3/object_copier.rb +7 -5
  78. data/lib/aws-sdk-s3/object_multipart_copier.rb +48 -23
  79. data/lib/aws-sdk-s3/object_summary.rb +2033 -169
  80. data/lib/aws-sdk-s3/object_version.rb +470 -53
  81. data/lib/aws-sdk-s3/plugins/accelerate.rb +1 -39
  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 +3 -41
  85. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +1 -6
  86. data/lib/aws-sdk-s3/plugins/checksum_algorithm.rb +44 -0
  87. data/lib/aws-sdk-s3/plugins/dualstack.rb +2 -49
  88. data/lib/aws-sdk-s3/plugins/endpoints.rb +86 -0
  89. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +3 -1
  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 +1 -1
  92. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +87 -26
  93. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +8 -26
  94. data/lib/aws-sdk-s3/plugins/location_constraint.rb +3 -1
  95. data/lib/aws-sdk-s3/plugins/md5s.rb +10 -68
  96. data/lib/aws-sdk-s3/plugins/s3_signer.rb +48 -88
  97. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +28 -9
  98. data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -1
  99. data/lib/aws-sdk-s3/presigned_post.rb +99 -78
  100. data/lib/aws-sdk-s3/presigner.rb +50 -42
  101. data/lib/aws-sdk-s3/resource.rb +144 -15
  102. data/lib/aws-sdk-s3/transfer_manager.rb +321 -0
  103. data/lib/aws-sdk-s3/types.rb +12223 -4723
  104. data/lib/aws-sdk-s3/waiters.rb +1 -1
  105. data/lib/aws-sdk-s3.rb +37 -28
  106. data/sig/bucket.rbs +231 -0
  107. data/sig/bucket_acl.rbs +78 -0
  108. data/sig/bucket_cors.rbs +69 -0
  109. data/sig/bucket_lifecycle.rbs +88 -0
  110. data/sig/bucket_lifecycle_configuration.rbs +115 -0
  111. data/sig/bucket_logging.rbs +76 -0
  112. data/sig/bucket_notification.rbs +114 -0
  113. data/sig/bucket_policy.rbs +59 -0
  114. data/sig/bucket_request_payment.rbs +54 -0
  115. data/sig/bucket_tagging.rbs +65 -0
  116. data/sig/bucket_versioning.rbs +77 -0
  117. data/sig/bucket_website.rbs +93 -0
  118. data/sig/client.rbs +2612 -0
  119. data/sig/customizations/bucket.rbs +19 -0
  120. data/sig/customizations/object.rbs +38 -0
  121. data/sig/customizations/object_summary.rbs +35 -0
  122. data/sig/errors.rbs +44 -0
  123. data/sig/multipart_upload.rbs +120 -0
  124. data/sig/multipart_upload_part.rbs +109 -0
  125. data/sig/object.rbs +464 -0
  126. data/sig/object_acl.rbs +86 -0
  127. data/sig/object_summary.rbs +347 -0
  128. data/sig/object_version.rbs +143 -0
  129. data/sig/resource.rbs +141 -0
  130. data/sig/types.rbs +2899 -0
  131. data/sig/waiters.rbs +95 -0
  132. metadata +74 -16
  133. data/lib/aws-sdk-s3/plugins/bucket_arn.rb +0 -212
@@ -3,7 +3,7 @@
3
3
  # WARNING ABOUT GENERATED CODE
4
4
  #
5
5
  # This file is generated. See the contributing guide for more information:
6
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
7
  #
8
8
  # WARNING ABOUT GENERATED CODE
9
9
 
@@ -56,6 +56,24 @@ module Aws::S3
56
56
  data[:etag]
57
57
  end
58
58
 
59
+ # The algorithm that was used to create a checksum of the object.
60
+ # @return [Array<String>]
61
+ def checksum_algorithm
62
+ data[:checksum_algorithm]
63
+ end
64
+
65
+ # The checksum type that is used to calculate the object’s checksum
66
+ # value. For more information, see [Checking object integrity][1] in the
67
+ # *Amazon S3 User Guide*.
68
+ #
69
+ #
70
+ #
71
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
72
+ # @return [String]
73
+ def checksum_type
74
+ data[:checksum_type]
75
+ end
76
+
59
77
  # Size in bytes of the object.
60
78
  # @return [Integer]
61
79
  def size
@@ -87,7 +105,7 @@ module Aws::S3
87
105
  data[:is_latest]
88
106
  end
89
107
 
90
- # Date and time the object was last modified.
108
+ # Date and time when the object was last modified.
91
109
  # @return [Time]
92
110
  def last_modified
93
111
  data[:last_modified]
@@ -99,6 +117,20 @@ module Aws::S3
99
117
  data[:owner]
100
118
  end
101
119
 
120
+ # Specifies the restoration status of an object. Objects in certain
121
+ # storage classes must be restored before they can be retrieved. For
122
+ # more information about these storage classes and how to work with
123
+ # archived objects, see [ Working with archived objects][1] in the
124
+ # *Amazon S3 User Guide*.
125
+ #
126
+ #
127
+ #
128
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html
129
+ # @return [Types::RestoreStatus]
130
+ def restore_status
131
+ data[:restore_status]
132
+ end
133
+
102
134
  # @!endgroup
103
135
 
104
136
  # @return [Client]
@@ -223,7 +255,9 @@ module Aws::S3
223
255
  :retry
224
256
  end
225
257
  end
226
- Aws::Waiters::Waiter.new(options).wait({})
258
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
259
+ Aws::Waiters::Waiter.new(options).wait({})
260
+ end
227
261
  end
228
262
 
229
263
  # @!group Actions
@@ -234,6 +268,10 @@ module Aws::S3
234
268
  # mfa: "MFA",
235
269
  # request_payer: "requester", # accepts requester
236
270
  # bypass_governance_retention: false,
271
+ # expected_bucket_owner: "AccountId",
272
+ # if_match: "IfMatch",
273
+ # if_match_last_modified_time: Time.now,
274
+ # if_match_size: 1,
237
275
  # })
238
276
  # @param [Hash] options ({})
239
277
  # @option options [String] :mfa
@@ -241,19 +279,76 @@ module Aws::S3
241
279
  # space, and the value that is displayed on your authentication device.
242
280
  # Required to permanently delete a versioned object if versioning is
243
281
  # configured with MFA delete enabled.
282
+ #
283
+ # <note markdown="1"> This functionality is not supported for directory buckets.
284
+ #
285
+ # </note>
244
286
  # @option options [String] :request_payer
245
287
  # Confirms that the requester knows that they will be charged for the
246
288
  # request. Bucket owners need not specify this parameter in their
247
- # requests. For information about downloading objects from requester
248
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
249
- # in the *Amazon S3 Developer Guide*.
289
+ # requests. If either the source or destination S3 bucket has Requester
290
+ # Pays enabled, the requester will pay for corresponding charges to copy
291
+ # the object. For information about downloading objects from Requester
292
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
293
+ # in the *Amazon S3 User Guide*.
294
+ #
295
+ # <note markdown="1"> This functionality is not supported for directory buckets.
296
+ #
297
+ # </note>
250
298
  #
251
299
  #
252
300
  #
253
301
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
254
302
  # @option options [Boolean] :bypass_governance_retention
255
303
  # Indicates whether S3 Object Lock should bypass Governance-mode
256
- # restrictions to process this operation.
304
+ # restrictions to process this operation. To use this header, you must
305
+ # have the `s3:BypassGovernanceRetention` permission.
306
+ #
307
+ # <note markdown="1"> This functionality is not supported for directory buckets.
308
+ #
309
+ # </note>
310
+ # @option options [String] :expected_bucket_owner
311
+ # The account ID of the expected bucket owner. If the account ID that
312
+ # you provide does not match the actual owner of the bucket, the request
313
+ # fails with the HTTP status code `403 Forbidden` (access denied).
314
+ # @option options [String] :if_match
315
+ # Deletes the object if the ETag (entity tag) value provided during the
316
+ # delete operation matches the ETag of the object in S3. If the ETag
317
+ # values do not match, the operation returns a `412 Precondition Failed`
318
+ # error.
319
+ #
320
+ # Expects the ETag value as a string. `If-Match` does accept a string
321
+ # value of an '*' (asterisk) character to denote a match of any ETag.
322
+ #
323
+ # For more information about conditional requests, see [RFC 7232][1].
324
+ #
325
+ #
326
+ #
327
+ # [1]: https://tools.ietf.org/html/rfc7232
328
+ # @option options [Time,DateTime,Date,Integer,String] :if_match_last_modified_time
329
+ # If present, the object is deleted only if its modification times
330
+ # matches the provided `Timestamp`. If the `Timestamp` values do not
331
+ # match, the operation returns a `412 Precondition Failed` error. If the
332
+ # `Timestamp` matches or if the object doesn’t exist, the operation
333
+ # returns a `204 Success (No Content)` response.
334
+ #
335
+ # <note markdown="1"> This functionality is only supported for directory buckets.
336
+ #
337
+ # </note>
338
+ # @option options [Integer] :if_match_size
339
+ # If present, the object is deleted only if its size matches the
340
+ # provided size in bytes. If the `Size` value does not match, the
341
+ # operation returns a `412 Precondition Failed` error. If the `Size`
342
+ # matches or if the object doesn’t exist, the operation returns a `204
343
+ # Success (No Content)` response.
344
+ #
345
+ # <note markdown="1"> This functionality is only supported for directory buckets.
346
+ #
347
+ # </note>
348
+ #
349
+ # You can use the `If-Match`, `x-amz-if-match-last-modified-time` and
350
+ # `x-amz-if-match-size` conditional headers in conjunction with
351
+ # each-other or individually.
257
352
  # @return [Types::DeleteObjectOutput]
258
353
  def delete(options = {})
259
354
  options = options.merge(
@@ -261,7 +356,9 @@ module Aws::S3
261
356
  key: @object_key,
262
357
  version_id: @id
263
358
  )
264
- resp = @client.delete_object(options)
359
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
360
+ @client.delete_object(options)
361
+ end
265
362
  resp.data
266
363
  end
267
364
 
@@ -284,24 +381,72 @@ module Aws::S3
284
381
  # sse_customer_key_md5: "SSECustomerKeyMD5",
285
382
  # request_payer: "requester", # accepts requester
286
383
  # part_number: 1,
384
+ # expected_bucket_owner: "AccountId",
385
+ # checksum_mode: "ENABLED", # accepts ENABLED
287
386
  # })
288
387
  # @param [Hash] options ({})
289
388
  # @option options [String] :if_match
290
389
  # Return the object only if its entity tag (ETag) is the same as the one
291
- # specified, otherwise return a 412 (precondition failed).
390
+ # specified in this header; otherwise, return a `412 Precondition
391
+ # Failed` error.
392
+ #
393
+ # If both of the `If-Match` and `If-Unmodified-Since` headers are
394
+ # present in the request as follows: `If-Match` condition evaluates to
395
+ # `true`, and; `If-Unmodified-Since` condition evaluates to `false`;
396
+ # then, S3 returns `200 OK` and the data requested.
397
+ #
398
+ # For more information about conditional requests, see [RFC 7232][1].
399
+ #
400
+ #
401
+ #
402
+ # [1]: https://tools.ietf.org/html/rfc7232
292
403
  # @option options [Time,DateTime,Date,Integer,String] :if_modified_since
293
404
  # Return the object only if it has been modified since the specified
294
- # time, otherwise return a 304 (not modified).
405
+ # time; otherwise, return a `304 Not Modified` error.
406
+ #
407
+ # If both of the `If-None-Match` and `If-Modified-Since` headers are
408
+ # present in the request as follows:` If-None-Match` condition evaluates
409
+ # to `false`, and; `If-Modified-Since` condition evaluates to `true`;
410
+ # then, S3 returns `304 Not Modified` status code.
411
+ #
412
+ # For more information about conditional requests, see [RFC 7232][1].
413
+ #
414
+ #
415
+ #
416
+ # [1]: https://tools.ietf.org/html/rfc7232
295
417
  # @option options [String] :if_none_match
296
418
  # Return the object only if its entity tag (ETag) is different from the
297
- # one specified, otherwise return a 304 (not modified).
419
+ # one specified in this header; otherwise, return a `304 Not Modified`
420
+ # error.
421
+ #
422
+ # If both of the `If-None-Match` and `If-Modified-Since` headers are
423
+ # present in the request as follows:` If-None-Match` condition evaluates
424
+ # to `false`, and; `If-Modified-Since` condition evaluates to `true`;
425
+ # then, S3 returns `304 Not Modified` HTTP status code.
426
+ #
427
+ # For more information about conditional requests, see [RFC 7232][1].
428
+ #
429
+ #
430
+ #
431
+ # [1]: https://tools.ietf.org/html/rfc7232
298
432
  # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
299
433
  # Return the object only if it has not been modified since the specified
300
- # time, otherwise return a 412 (precondition failed).
434
+ # time; otherwise, return a `412 Precondition Failed` error.
435
+ #
436
+ # If both of the `If-Match` and `If-Unmodified-Since` headers are
437
+ # present in the request as follows: `If-Match` condition evaluates to
438
+ # `true`, and; `If-Unmodified-Since` condition evaluates to `false`;
439
+ # then, S3 returns `200 OK` and the data requested.
440
+ #
441
+ # For more information about conditional requests, see [RFC 7232][1].
442
+ #
443
+ #
444
+ #
445
+ # [1]: https://tools.ietf.org/html/rfc7232
301
446
  # @option options [String] :range
302
- # Downloads the specified range bytes of an object. For more information
447
+ # Downloads the specified byte range of an object. For more information
303
448
  # about the HTTP Range header, see
304
- # [https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35][1].
449
+ # [https://www.rfc-editor.org/rfc/rfc9110.html#name-range][1].
305
450
  #
306
451
  # <note markdown="1"> Amazon S3 doesn't support retrieving multiple ranges of data per
307
452
  # `GET` request.
@@ -310,11 +455,11 @@ module Aws::S3
310
455
  #
311
456
  #
312
457
  #
313
- # [1]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35
458
+ # [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-range
314
459
  # @option options [String] :response_cache_control
315
460
  # Sets the `Cache-Control` header of the response.
316
461
  # @option options [String] :response_content_disposition
317
- # Sets the `Content-Disposition` header of the response
462
+ # Sets the `Content-Disposition` header of the response.
318
463
  # @option options [String] :response_content_encoding
319
464
  # Sets the `Content-Encoding` header of the response.
320
465
  # @option options [String] :response_content_language
@@ -324,24 +469,98 @@ module Aws::S3
324
469
  # @option options [Time,DateTime,Date,Integer,String] :response_expires
325
470
  # Sets the `Expires` header of the response.
326
471
  # @option options [String] :sse_customer_algorithm
327
- # Specifies the algorithm to use to when encrypting the object (for
328
- # example, AES256).
472
+ # Specifies the algorithm to use when decrypting the object (for
473
+ # example, `AES256`).
474
+ #
475
+ # If you encrypt an object by using server-side encryption with
476
+ # customer-provided encryption keys (SSE-C) when you store the object in
477
+ # Amazon S3, then when you GET the object, you must use the following
478
+ # headers:
479
+ #
480
+ # * `x-amz-server-side-encryption-customer-algorithm`
481
+ #
482
+ # * `x-amz-server-side-encryption-customer-key`
483
+ #
484
+ # * `x-amz-server-side-encryption-customer-key-MD5`
485
+ #
486
+ # For more information about SSE-C, see [Server-Side Encryption (Using
487
+ # Customer-Provided Encryption Keys)][1] in the *Amazon S3 User Guide*.
488
+ #
489
+ # <note markdown="1"> This functionality is not supported for directory buckets.
490
+ #
491
+ # </note>
492
+ #
493
+ #
494
+ #
495
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
329
496
  # @option options [String] :sse_customer_key
330
- # Specifies the customer-provided encryption key for Amazon S3 to use in
331
- # encrypting data. This value is used to store the object and then it is
332
- # discarded; Amazon S3 does not store the encryption key. The key must
333
- # be appropriate for use with the algorithm specified in the
334
- # `x-amz-server-side​-encryption​-customer-algorithm` header.
497
+ # Specifies the customer-provided encryption key that you originally
498
+ # provided for Amazon S3 to encrypt the data before storing it. This
499
+ # value is used to decrypt the object when recovering it and must match
500
+ # the one used when storing the data. The key must be appropriate for
501
+ # use with the algorithm specified in the
502
+ # `x-amz-server-side-encryption-customer-algorithm` header.
503
+ #
504
+ # If you encrypt an object by using server-side encryption with
505
+ # customer-provided encryption keys (SSE-C) when you store the object in
506
+ # Amazon S3, then when you GET the object, you must use the following
507
+ # headers:
508
+ #
509
+ # * `x-amz-server-side-encryption-customer-algorithm`
510
+ #
511
+ # * `x-amz-server-side-encryption-customer-key`
512
+ #
513
+ # * `x-amz-server-side-encryption-customer-key-MD5`
514
+ #
515
+ # For more information about SSE-C, see [Server-Side Encryption (Using
516
+ # Customer-Provided Encryption Keys)][1] in the *Amazon S3 User Guide*.
517
+ #
518
+ # <note markdown="1"> This functionality is not supported for directory buckets.
519
+ #
520
+ # </note>
521
+ #
522
+ #
523
+ #
524
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
335
525
  # @option options [String] :sse_customer_key_md5
336
- # Specifies the 128-bit MD5 digest of the encryption key according to
337
- # RFC 1321. Amazon S3 uses this header for a message integrity check to
338
- # ensure that the encryption key was transmitted without error.
526
+ # Specifies the 128-bit MD5 digest of the customer-provided encryption
527
+ # key according to RFC 1321. Amazon S3 uses this header for a message
528
+ # integrity check to ensure that the encryption key was transmitted
529
+ # without error.
530
+ #
531
+ # If you encrypt an object by using server-side encryption with
532
+ # customer-provided encryption keys (SSE-C) when you store the object in
533
+ # Amazon S3, then when you GET the object, you must use the following
534
+ # headers:
535
+ #
536
+ # * `x-amz-server-side-encryption-customer-algorithm`
537
+ #
538
+ # * `x-amz-server-side-encryption-customer-key`
539
+ #
540
+ # * `x-amz-server-side-encryption-customer-key-MD5`
541
+ #
542
+ # For more information about SSE-C, see [Server-Side Encryption (Using
543
+ # Customer-Provided Encryption Keys)][1] in the *Amazon S3 User Guide*.
544
+ #
545
+ # <note markdown="1"> This functionality is not supported for directory buckets.
546
+ #
547
+ # </note>
548
+ #
549
+ #
550
+ #
551
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html
339
552
  # @option options [String] :request_payer
340
553
  # Confirms that the requester knows that they will be charged for the
341
554
  # request. Bucket owners need not specify this parameter in their
342
- # requests. For information about downloading objects from requester
343
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
344
- # in the *Amazon S3 Developer Guide*.
555
+ # requests. If either the source or destination S3 bucket has Requester
556
+ # Pays enabled, the requester will pay for corresponding charges to copy
557
+ # the object. For information about downloading objects from Requester
558
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
559
+ # in the *Amazon S3 User Guide*.
560
+ #
561
+ # <note markdown="1"> This functionality is not supported for directory buckets.
562
+ #
563
+ # </note>
345
564
  #
346
565
  #
347
566
  #
@@ -351,6 +570,12 @@ module Aws::S3
351
570
  # between 1 and 10,000. Effectively performs a 'ranged' GET request
352
571
  # for the part specified. Useful for downloading just a part of an
353
572
  # object.
573
+ # @option options [String] :expected_bucket_owner
574
+ # The account ID of the expected bucket owner. If the account ID that
575
+ # you provide does not match the actual owner of the bucket, the request
576
+ # fails with the HTTP status code `403 Forbidden` (access denied).
577
+ # @option options [String] :checksum_mode
578
+ # To retrieve the checksum, this mode must be enabled.
354
579
  # @return [Types::GetObjectOutput]
355
580
  def get(options = {}, &block)
356
581
  options = options.merge(
@@ -358,7 +583,9 @@ module Aws::S3
358
583
  key: @object_key,
359
584
  version_id: @id
360
585
  )
361
- resp = @client.get_object(options, &block)
586
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
587
+ @client.get_object(options, &block)
588
+ end
362
589
  resp.data
363
590
  end
364
591
 
@@ -370,53 +597,147 @@ module Aws::S3
370
597
  # if_none_match: "IfNoneMatch",
371
598
  # if_unmodified_since: Time.now,
372
599
  # range: "Range",
600
+ # response_cache_control: "ResponseCacheControl",
601
+ # response_content_disposition: "ResponseContentDisposition",
602
+ # response_content_encoding: "ResponseContentEncoding",
603
+ # response_content_language: "ResponseContentLanguage",
604
+ # response_content_type: "ResponseContentType",
605
+ # response_expires: Time.now,
373
606
  # sse_customer_algorithm: "SSECustomerAlgorithm",
374
607
  # sse_customer_key: "SSECustomerKey",
375
608
  # sse_customer_key_md5: "SSECustomerKeyMD5",
376
609
  # request_payer: "requester", # accepts requester
377
610
  # part_number: 1,
611
+ # expected_bucket_owner: "AccountId",
612
+ # checksum_mode: "ENABLED", # accepts ENABLED
378
613
  # })
379
614
  # @param [Hash] options ({})
380
615
  # @option options [String] :if_match
381
616
  # Return the object only if its entity tag (ETag) is the same as the one
382
- # specified, otherwise return a 412 (precondition failed).
617
+ # specified; otherwise, return a 412 (precondition failed) error.
618
+ #
619
+ # If both of the `If-Match` and `If-Unmodified-Since` headers are
620
+ # present in the request as follows:
621
+ #
622
+ # * `If-Match` condition evaluates to `true`, and;
623
+ #
624
+ # * `If-Unmodified-Since` condition evaluates to `false`;
625
+ #
626
+ # Then Amazon S3 returns `200 OK` and the data requested.
627
+ #
628
+ # For more information about conditional requests, see [RFC 7232][1].
629
+ #
630
+ #
631
+ #
632
+ # [1]: https://tools.ietf.org/html/rfc7232
383
633
  # @option options [Time,DateTime,Date,Integer,String] :if_modified_since
384
634
  # Return the object only if it has been modified since the specified
385
- # time, otherwise return a 304 (not modified).
635
+ # time; otherwise, return a 304 (not modified) error.
636
+ #
637
+ # If both of the `If-None-Match` and `If-Modified-Since` headers are
638
+ # present in the request as follows:
639
+ #
640
+ # * `If-None-Match` condition evaluates to `false`, and;
641
+ #
642
+ # * `If-Modified-Since` condition evaluates to `true`;
643
+ #
644
+ # Then Amazon S3 returns the `304 Not Modified` response code.
645
+ #
646
+ # For more information about conditional requests, see [RFC 7232][1].
647
+ #
648
+ #
649
+ #
650
+ # [1]: https://tools.ietf.org/html/rfc7232
386
651
  # @option options [String] :if_none_match
387
652
  # Return the object only if its entity tag (ETag) is different from the
388
- # one specified, otherwise return a 304 (not modified).
653
+ # one specified; otherwise, return a 304 (not modified) error.
654
+ #
655
+ # If both of the `If-None-Match` and `If-Modified-Since` headers are
656
+ # present in the request as follows:
657
+ #
658
+ # * `If-None-Match` condition evaluates to `false`, and;
659
+ #
660
+ # * `If-Modified-Since` condition evaluates to `true`;
661
+ #
662
+ # Then Amazon S3 returns the `304 Not Modified` response code.
663
+ #
664
+ # For more information about conditional requests, see [RFC 7232][1].
665
+ #
666
+ #
667
+ #
668
+ # [1]: https://tools.ietf.org/html/rfc7232
389
669
  # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
390
670
  # Return the object only if it has not been modified since the specified
391
- # time, otherwise return a 412 (precondition failed).
392
- # @option options [String] :range
393
- # Downloads the specified range bytes of an object. For more information
394
- # about the HTTP Range header, see
395
- # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35]().
671
+ # time; otherwise, return a 412 (precondition failed) error.
396
672
  #
397
- # <note markdown="1"> Amazon S3 doesn't support retrieving multiple ranges of data per
398
- # `GET` request.
673
+ # If both of the `If-Match` and `If-Unmodified-Since` headers are
674
+ # present in the request as follows:
399
675
  #
400
- # </note>
676
+ # * `If-Match` condition evaluates to `true`, and;
677
+ #
678
+ # * `If-Unmodified-Since` condition evaluates to `false`;
679
+ #
680
+ # Then Amazon S3 returns `200 OK` and the data requested.
681
+ #
682
+ # For more information about conditional requests, see [RFC 7232][1].
683
+ #
684
+ #
685
+ #
686
+ # [1]: https://tools.ietf.org/html/rfc7232
687
+ # @option options [String] :range
688
+ # HeadObject returns only the metadata for an object. If the Range is
689
+ # satisfiable, only the `ContentLength` is affected in the response. If
690
+ # the Range is not satisfiable, S3 returns a `416 - Requested Range Not
691
+ # Satisfiable` error.
692
+ # @option options [String] :response_cache_control
693
+ # Sets the `Cache-Control` header of the response.
694
+ # @option options [String] :response_content_disposition
695
+ # Sets the `Content-Disposition` header of the response.
696
+ # @option options [String] :response_content_encoding
697
+ # Sets the `Content-Encoding` header of the response.
698
+ # @option options [String] :response_content_language
699
+ # Sets the `Content-Language` header of the response.
700
+ # @option options [String] :response_content_type
701
+ # Sets the `Content-Type` header of the response.
702
+ # @option options [Time,DateTime,Date,Integer,String] :response_expires
703
+ # Sets the `Expires` header of the response.
401
704
  # @option options [String] :sse_customer_algorithm
402
- # Specifies the algorithm to use to when encrypting the object (for
705
+ # Specifies the algorithm to use when encrypting the object (for
403
706
  # example, AES256).
707
+ #
708
+ # <note markdown="1"> This functionality is not supported for directory buckets.
709
+ #
710
+ # </note>
404
711
  # @option options [String] :sse_customer_key
405
712
  # Specifies the customer-provided encryption key for Amazon S3 to use in
406
713
  # encrypting data. This value is used to store the object and then it is
407
714
  # discarded; Amazon S3 does not store the encryption key. The key must
408
715
  # be appropriate for use with the algorithm specified in the
409
- # `x-amz-server-side​-encryption​-customer-algorithm` header.
716
+ # `x-amz-server-side-encryption-customer-algorithm` header.
717
+ #
718
+ # <note markdown="1"> This functionality is not supported for directory buckets.
719
+ #
720
+ # </note>
410
721
  # @option options [String] :sse_customer_key_md5
411
722
  # Specifies the 128-bit MD5 digest of the encryption key according to
412
723
  # RFC 1321. Amazon S3 uses this header for a message integrity check to
413
724
  # ensure that the encryption key was transmitted without error.
725
+ #
726
+ # <note markdown="1"> This functionality is not supported for directory buckets.
727
+ #
728
+ # </note>
414
729
  # @option options [String] :request_payer
415
730
  # Confirms that the requester knows that they will be charged for the
416
731
  # request. Bucket owners need not specify this parameter in their
417
- # requests. For information about downloading objects from requester
418
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
419
- # in the *Amazon S3 Developer Guide*.
732
+ # requests. If either the source or destination S3 bucket has Requester
733
+ # Pays enabled, the requester will pay for corresponding charges to copy
734
+ # the object. For information about downloading objects from Requester
735
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
736
+ # in the *Amazon S3 User Guide*.
737
+ #
738
+ # <note markdown="1"> This functionality is not supported for directory buckets.
739
+ #
740
+ # </note>
420
741
  #
421
742
  #
422
743
  #
@@ -426,6 +747,27 @@ module Aws::S3
426
747
  # between 1 and 10,000. Effectively performs a 'ranged' HEAD request
427
748
  # for the part specified. Useful querying about the size of the part and
428
749
  # the number of parts in this object.
750
+ # @option options [String] :expected_bucket_owner
751
+ # The account ID of the expected bucket owner. If the account ID that
752
+ # you provide does not match the actual owner of the bucket, the request
753
+ # fails with the HTTP status code `403 Forbidden` (access denied).
754
+ # @option options [String] :checksum_mode
755
+ # To retrieve the checksum, this parameter must be enabled.
756
+ #
757
+ # **General purpose buckets** - If you enable checksum mode and the
758
+ # object is uploaded with a [checksum][1] and encrypted with an Key
759
+ # Management Service (KMS) key, you must have permission to use the
760
+ # `kms:Decrypt` action to retrieve the checksum.
761
+ #
762
+ # **Directory buckets** - If you enable `ChecksumMode` and the object is
763
+ # encrypted with Amazon Web Services Key Management Service (Amazon Web
764
+ # Services KMS), you must also have the `kms:GenerateDataKey` and
765
+ # `kms:Decrypt` permissions in IAM identity-based policies and KMS key
766
+ # policies for the KMS key to retrieve the checksum of the object.
767
+ #
768
+ #
769
+ #
770
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html
429
771
  # @return [Types::HeadObjectOutput]
430
772
  def head(options = {})
431
773
  options = options.merge(
@@ -433,7 +775,9 @@ module Aws::S3
433
775
  key: @object_key,
434
776
  version_id: @id
435
777
  )
436
- resp = @client.head_object(options)
778
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
779
+ @client.head_object(options)
780
+ end
437
781
  resp.data
438
782
  end
439
783
 
@@ -504,6 +848,8 @@ module Aws::S3
504
848
  # mfa: "MFA",
505
849
  # request_payer: "requester", # accepts requester
506
850
  # bypass_governance_retention: false,
851
+ # expected_bucket_owner: "AccountId",
852
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
507
853
  # })
508
854
  # @param options ({})
509
855
  # @option options [String] :mfa
@@ -511,20 +857,86 @@ module Aws::S3
511
857
  # space, and the value that is displayed on your authentication device.
512
858
  # Required to permanently delete a versioned object if versioning is
513
859
  # configured with MFA delete enabled.
860
+ #
861
+ # When performing the `DeleteObjects` operation on an MFA delete enabled
862
+ # bucket, which attempts to delete the specified versioned objects, you
863
+ # must include an MFA token. If you don't provide an MFA token, the
864
+ # entire request will fail, even if there are non-versioned objects that
865
+ # you are trying to delete. If you provide an invalid token, whether
866
+ # there are versioned object keys in the request or not, the entire
867
+ # Multi-Object Delete request will fail. For information about MFA
868
+ # Delete, see [ MFA Delete][1] in the *Amazon S3 User Guide*.
869
+ #
870
+ # <note markdown="1"> This functionality is not supported for directory buckets.
871
+ #
872
+ # </note>
873
+ #
874
+ #
875
+ #
876
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete
514
877
  # @option options [String] :request_payer
515
878
  # Confirms that the requester knows that they will be charged for the
516
879
  # request. Bucket owners need not specify this parameter in their
517
- # requests. For information about downloading objects from requester
518
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
519
- # in the *Amazon S3 Developer Guide*.
880
+ # requests. If either the source or destination S3 bucket has Requester
881
+ # Pays enabled, the requester will pay for corresponding charges to copy
882
+ # the object. For information about downloading objects from Requester
883
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
884
+ # in the *Amazon S3 User Guide*.
885
+ #
886
+ # <note markdown="1"> This functionality is not supported for directory buckets.
887
+ #
888
+ # </note>
520
889
  #
521
890
  #
522
891
  #
523
892
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
524
893
  # @option options [Boolean] :bypass_governance_retention
525
894
  # Specifies whether you want to delete this object even if it has a
526
- # Governance-type Object Lock in place. You must have sufficient
527
- # permissions to perform this operation.
895
+ # Governance-type Object Lock in place. To use this header, you must
896
+ # have the `s3:BypassGovernanceRetention` permission.
897
+ #
898
+ # <note markdown="1"> This functionality is not supported for directory buckets.
899
+ #
900
+ # </note>
901
+ # @option options [String] :expected_bucket_owner
902
+ # The account ID of the expected bucket owner. If the account ID that
903
+ # you provide does not match the actual owner of the bucket, the request
904
+ # fails with the HTTP status code `403 Forbidden` (access denied).
905
+ # @option options [String] :checksum_algorithm
906
+ # Indicates the algorithm used to create the checksum for the object
907
+ # when you use the SDK. This header will not provide any additional
908
+ # functionality if you don't use the SDK. When you send this header,
909
+ # there must be a corresponding `x-amz-checksum-algorithm ` or
910
+ # `x-amz-trailer` header sent. Otherwise, Amazon S3 fails the request
911
+ # with the HTTP status code `400 Bad Request`.
912
+ #
913
+ # For the `x-amz-checksum-algorithm ` header, replace ` algorithm ` with
914
+ # the supported algorithm from the following list:
915
+ #
916
+ # * `CRC32`
917
+ #
918
+ # * `CRC32C`
919
+ #
920
+ # * `CRC64NVME`
921
+ #
922
+ # * `SHA1`
923
+ #
924
+ # * `SHA256`
925
+ #
926
+ # For more information, see [Checking object integrity][1] in the
927
+ # *Amazon S3 User Guide*.
928
+ #
929
+ # If the individual checksum value you provide through
930
+ # `x-amz-checksum-algorithm ` doesn't match the checksum algorithm you
931
+ # set through `x-amz-sdk-checksum-algorithm`, Amazon S3 fails the
932
+ # request with a `BadDigest` error.
933
+ #
934
+ # If you provide an individual checksum, Amazon S3 ignores any provided
935
+ # `ChecksumAlgorithm` parameter.
936
+ #
937
+ #
938
+ #
939
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
528
940
  # @return [void]
529
941
  def batch_delete!(options = {})
530
942
  batch_enum.each do |batch|
@@ -538,7 +950,9 @@ module Aws::S3
538
950
  version_id: item.id
539
951
  }
540
952
  end
541
- batch[0].client.delete_objects(params)
953
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
954
+ batch[0].client.delete_objects(params)
955
+ end
542
956
  end
543
957
  nil
544
958
  end
@@ -548,3 +962,6 @@ module Aws::S3
548
962
  end
549
963
  end
550
964
  end
965
+
966
+ # Load customizations if they exist
967
+ require 'aws-sdk-s3/customizations/object_version'