aws-sdk-s3 1.103.0 → 1.202.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 (109) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +664 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-sdk-s3/access_grants_credentials.rb +57 -0
  5. data/lib/aws-sdk-s3/access_grants_credentials_provider.rb +250 -0
  6. data/lib/aws-sdk-s3/bucket.rb +858 -116
  7. data/lib/aws-sdk-s3/bucket_acl.rb +32 -9
  8. data/lib/aws-sdk-s3/bucket_cors.rb +38 -13
  9. data/lib/aws-sdk-s3/bucket_lifecycle.rb +43 -12
  10. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +100 -13
  11. data/lib/aws-sdk-s3/bucket_logging.rb +35 -6
  12. data/lib/aws-sdk-s3/bucket_notification.rb +27 -9
  13. data/lib/aws-sdk-s3/bucket_policy.rb +79 -10
  14. data/lib/aws-sdk-s3/bucket_region_cache.rb +9 -5
  15. data/lib/aws-sdk-s3/bucket_request_payment.rb +29 -7
  16. data/lib/aws-sdk-s3/bucket_tagging.rb +35 -11
  17. data/lib/aws-sdk-s3/bucket_versioning.rb +108 -17
  18. data/lib/aws-sdk-s3/bucket_website.rb +35 -11
  19. data/lib/aws-sdk-s3/client.rb +11799 -3636
  20. data/lib/aws-sdk-s3/client_api.rb +1201 -276
  21. data/lib/aws-sdk-s3/customizations/bucket.rb +23 -47
  22. data/lib/aws-sdk-s3/customizations/errors.rb +40 -0
  23. data/lib/aws-sdk-s3/customizations/object.rb +216 -70
  24. data/lib/aws-sdk-s3/customizations/object_summary.rb +5 -0
  25. data/lib/aws-sdk-s3/customizations/object_version.rb +13 -0
  26. data/lib/aws-sdk-s3/customizations/types/permanent_redirect.rb +26 -0
  27. data/lib/aws-sdk-s3/customizations.rb +27 -29
  28. data/lib/aws-sdk-s3/default_executor.rb +103 -0
  29. data/lib/aws-sdk-s3/encryption/client.rb +6 -2
  30. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +13 -9
  31. data/lib/aws-sdk-s3/encryptionV2/client.rb +6 -2
  32. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +1 -0
  33. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +10 -6
  34. data/lib/aws-sdk-s3/endpoint_parameters.rb +181 -0
  35. data/lib/aws-sdk-s3/endpoint_provider.rb +716 -0
  36. data/lib/aws-sdk-s3/endpoints.rb +1518 -0
  37. data/lib/aws-sdk-s3/errors.rb +58 -0
  38. data/lib/aws-sdk-s3/express_credentials.rb +55 -0
  39. data/lib/aws-sdk-s3/express_credentials_provider.rb +59 -0
  40. data/lib/aws-sdk-s3/file_downloader.rb +241 -87
  41. data/lib/aws-sdk-s3/file_uploader.rb +16 -13
  42. data/lib/aws-sdk-s3/legacy_signer.rb +2 -1
  43. data/lib/aws-sdk-s3/multipart_download_error.rb +8 -0
  44. data/lib/aws-sdk-s3/multipart_file_uploader.rb +108 -86
  45. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +110 -92
  46. data/lib/aws-sdk-s3/multipart_upload.rb +294 -19
  47. data/lib/aws-sdk-s3/multipart_upload_error.rb +3 -4
  48. data/lib/aws-sdk-s3/multipart_upload_part.rb +297 -31
  49. data/lib/aws-sdk-s3/object.rb +2224 -269
  50. data/lib/aws-sdk-s3/object_acl.rb +59 -17
  51. data/lib/aws-sdk-s3/object_copier.rb +7 -5
  52. data/lib/aws-sdk-s3/object_multipart_copier.rb +48 -23
  53. data/lib/aws-sdk-s3/object_summary.rb +1915 -220
  54. data/lib/aws-sdk-s3/object_version.rb +450 -58
  55. data/lib/aws-sdk-s3/plugins/accelerate.rb +3 -44
  56. data/lib/aws-sdk-s3/plugins/access_grants.rb +178 -0
  57. data/lib/aws-sdk-s3/plugins/arn.rb +0 -197
  58. data/lib/aws-sdk-s3/plugins/bucket_dns.rb +3 -39
  59. data/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb +1 -6
  60. data/lib/aws-sdk-s3/plugins/checksum_algorithm.rb +31 -0
  61. data/lib/aws-sdk-s3/plugins/dualstack.rb +1 -55
  62. data/lib/aws-sdk-s3/plugins/endpoints.rb +86 -0
  63. data/lib/aws-sdk-s3/plugins/expect_100_continue.rb +2 -1
  64. data/lib/aws-sdk-s3/plugins/express_session_auth.rb +88 -0
  65. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +55 -18
  66. data/lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb +6 -29
  67. data/lib/aws-sdk-s3/plugins/location_constraint.rb +3 -1
  68. data/lib/aws-sdk-s3/plugins/md5s.rb +10 -68
  69. data/lib/aws-sdk-s3/plugins/s3_signer.rb +42 -111
  70. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +28 -9
  71. data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -1
  72. data/lib/aws-sdk-s3/presigned_post.rb +99 -78
  73. data/lib/aws-sdk-s3/presigner.rb +32 -41
  74. data/lib/aws-sdk-s3/resource.rb +139 -12
  75. data/lib/aws-sdk-s3/transfer_manager.rb +304 -0
  76. data/lib/aws-sdk-s3/types.rb +10204 -5378
  77. data/lib/aws-sdk-s3.rb +35 -27
  78. data/sig/bucket.rbs +231 -0
  79. data/sig/bucket_acl.rbs +78 -0
  80. data/sig/bucket_cors.rbs +69 -0
  81. data/sig/bucket_lifecycle.rbs +88 -0
  82. data/sig/bucket_lifecycle_configuration.rbs +115 -0
  83. data/sig/bucket_logging.rbs +76 -0
  84. data/sig/bucket_notification.rbs +114 -0
  85. data/sig/bucket_policy.rbs +59 -0
  86. data/sig/bucket_request_payment.rbs +54 -0
  87. data/sig/bucket_tagging.rbs +65 -0
  88. data/sig/bucket_versioning.rbs +77 -0
  89. data/sig/bucket_website.rbs +93 -0
  90. data/sig/client.rbs +2586 -0
  91. data/sig/customizations/bucket.rbs +19 -0
  92. data/sig/customizations/object.rbs +38 -0
  93. data/sig/customizations/object_summary.rbs +35 -0
  94. data/sig/errors.rbs +44 -0
  95. data/sig/multipart_upload.rbs +120 -0
  96. data/sig/multipart_upload_part.rbs +109 -0
  97. data/sig/object.rbs +464 -0
  98. data/sig/object_acl.rbs +86 -0
  99. data/sig/object_summary.rbs +347 -0
  100. data/sig/object_version.rbs +143 -0
  101. data/sig/resource.rbs +141 -0
  102. data/sig/types.rbs +2868 -0
  103. data/sig/waiters.rbs +95 -0
  104. metadata +51 -16
  105. data/lib/aws-sdk-s3/arn/access_point_arn.rb +0 -69
  106. data/lib/aws-sdk-s3/arn/multi_region_access_point_arn.rb +0 -69
  107. data/lib/aws-sdk-s3/arn/object_lambda_arn.rb +0 -69
  108. data/lib/aws-sdk-s3/arn/outpost_access_point_arn.rb +0 -73
  109. data/lib/aws-sdk-s3/plugins/object_lambda_endpoint.rb +0 -25
@@ -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
@@ -235,6 +269,9 @@ module Aws::S3
235
269
  # request_payer: "requester", # accepts requester
236
270
  # bypass_governance_retention: false,
237
271
  # expected_bucket_owner: "AccountId",
272
+ # if_match: "IfMatch",
273
+ # if_match_last_modified_time: Time.now,
274
+ # if_match_size: 1,
238
275
  # })
239
276
  # @param [Hash] options ({})
240
277
  # @option options [String] :mfa
@@ -242,24 +279,76 @@ module Aws::S3
242
279
  # space, and the value that is displayed on your authentication device.
243
280
  # Required to permanently delete a versioned object if versioning is
244
281
  # configured with MFA delete enabled.
282
+ #
283
+ # <note markdown="1"> This functionality is not supported for directory buckets.
284
+ #
285
+ # </note>
245
286
  # @option options [String] :request_payer
246
287
  # Confirms that the requester knows that they will be charged for the
247
288
  # request. Bucket owners need not specify this parameter in their
248
- # requests. For information about downloading objects from requester
249
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
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]
250
293
  # in the *Amazon S3 User Guide*.
251
294
  #
295
+ # <note markdown="1"> This functionality is not supported for directory buckets.
296
+ #
297
+ # </note>
298
+ #
252
299
  #
253
300
  #
254
301
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
255
302
  # @option options [Boolean] :bypass_governance_retention
256
303
  # Indicates whether S3 Object Lock should bypass Governance-mode
257
304
  # restrictions to process this operation. To use this header, you must
258
- # have the `s3:PutBucketPublicAccessBlock` permission.
305
+ # have the `s3:BypassGovernanceRetention` permission.
306
+ #
307
+ # <note markdown="1"> This functionality is not supported for directory buckets.
308
+ #
309
+ # </note>
259
310
  # @option options [String] :expected_bucket_owner
260
- # The account ID of the expected bucket owner. If the bucket is owned by
261
- # a different account, the request will fail with an HTTP `403 (Access
262
- # Denied)` error.
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.
263
352
  # @return [Types::DeleteObjectOutput]
264
353
  def delete(options = {})
265
354
  options = options.merge(
@@ -267,7 +356,9 @@ module Aws::S3
267
356
  key: @object_key,
268
357
  version_id: @id
269
358
  )
270
- resp = @client.delete_object(options)
359
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
360
+ @client.delete_object(options)
361
+ end
271
362
  resp.data
272
363
  end
273
364
 
@@ -291,24 +382,71 @@ module Aws::S3
291
382
  # request_payer: "requester", # accepts requester
292
383
  # part_number: 1,
293
384
  # expected_bucket_owner: "AccountId",
385
+ # checksum_mode: "ENABLED", # accepts ENABLED
294
386
  # })
295
387
  # @param [Hash] options ({})
296
388
  # @option options [String] :if_match
297
389
  # Return the object only if its entity tag (ETag) is the same as the one
298
- # 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
299
403
  # @option options [Time,DateTime,Date,Integer,String] :if_modified_since
300
404
  # Return the object only if it has been modified since the specified
301
- # 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
302
417
  # @option options [String] :if_none_match
303
418
  # Return the object only if its entity tag (ETag) is different from the
304
- # 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
305
432
  # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
306
433
  # Return the object only if it has not been modified since the specified
307
- # 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
308
446
  # @option options [String] :range
309
- # Downloads the specified range bytes of an object. For more information
447
+ # Downloads the specified byte range of an object. For more information
310
448
  # about the HTTP Range header, see
311
- # [https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35][1].
449
+ # [https://www.rfc-editor.org/rfc/rfc9110.html#name-range][1].
312
450
  #
313
451
  # <note markdown="1"> Amazon S3 doesn't support retrieving multiple ranges of data per
314
452
  # `GET` request.
@@ -317,11 +455,11 @@ module Aws::S3
317
455
  #
318
456
  #
319
457
  #
320
- # [1]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35
458
+ # [1]: https://www.rfc-editor.org/rfc/rfc9110.html#name-range
321
459
  # @option options [String] :response_cache_control
322
460
  # Sets the `Cache-Control` header of the response.
323
461
  # @option options [String] :response_content_disposition
324
- # Sets the `Content-Disposition` header of the response
462
+ # Sets the `Content-Disposition` header of the response.
325
463
  # @option options [String] :response_content_encoding
326
464
  # Sets the `Content-Encoding` header of the response.
327
465
  # @option options [String] :response_content_language
@@ -331,25 +469,99 @@ module Aws::S3
331
469
  # @option options [Time,DateTime,Date,Integer,String] :response_expires
332
470
  # Sets the `Expires` header of the response.
333
471
  # @option options [String] :sse_customer_algorithm
334
- # Specifies the algorithm to use to when decrypting the object (for
335
- # 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
336
496
  # @option options [String] :sse_customer_key
337
- # Specifies the customer-provided encryption key for Amazon S3 used to
338
- # encrypt the data. This value is used to decrypt the object when
339
- # recovering it and must match the one used when storing the data. The
340
- # key must be appropriate for use with the algorithm specified in the
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
341
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
342
525
  # @option options [String] :sse_customer_key_md5
343
- # Specifies the 128-bit MD5 digest of the encryption key according to
344
- # RFC 1321. Amazon S3 uses this header for a message integrity check to
345
- # 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
346
552
  # @option options [String] :request_payer
347
553
  # Confirms that the requester knows that they will be charged for the
348
554
  # request. Bucket owners need not specify this parameter in their
349
- # requests. For information about downloading objects from requester
350
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
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]
351
559
  # in the *Amazon S3 User Guide*.
352
560
  #
561
+ # <note markdown="1"> This functionality is not supported for directory buckets.
562
+ #
563
+ # </note>
564
+ #
353
565
  #
354
566
  #
355
567
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
@@ -359,9 +571,11 @@ module Aws::S3
359
571
  # for the part specified. Useful for downloading just a part of an
360
572
  # object.
361
573
  # @option options [String] :expected_bucket_owner
362
- # The account ID of the expected bucket owner. If the bucket is owned by
363
- # a different account, the request will fail with an HTTP `403 (Access
364
- # Denied)` error.
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.
365
579
  # @return [Types::GetObjectOutput]
366
580
  def get(options = {}, &block)
367
581
  options = options.merge(
@@ -369,7 +583,9 @@ module Aws::S3
369
583
  key: @object_key,
370
584
  version_id: @id
371
585
  )
372
- resp = @client.get_object(options, &block)
586
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
587
+ @client.get_object(options, &block)
588
+ end
373
589
  resp.data
374
590
  end
375
591
 
@@ -381,59 +597,148 @@ module Aws::S3
381
597
  # if_none_match: "IfNoneMatch",
382
598
  # if_unmodified_since: Time.now,
383
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,
384
606
  # sse_customer_algorithm: "SSECustomerAlgorithm",
385
607
  # sse_customer_key: "SSECustomerKey",
386
608
  # sse_customer_key_md5: "SSECustomerKeyMD5",
387
609
  # request_payer: "requester", # accepts requester
388
610
  # part_number: 1,
389
611
  # expected_bucket_owner: "AccountId",
612
+ # checksum_mode: "ENABLED", # accepts ENABLED
390
613
  # })
391
614
  # @param [Hash] options ({})
392
615
  # @option options [String] :if_match
393
616
  # Return the object only if its entity tag (ETag) is the same as the one
394
- # 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
395
633
  # @option options [Time,DateTime,Date,Integer,String] :if_modified_since
396
634
  # Return the object only if it has been modified since the specified
397
- # 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
398
651
  # @option options [String] :if_none_match
399
652
  # Return the object only if its entity tag (ETag) is different from the
400
- # 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
401
669
  # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
402
670
  # Return the object only if it has not been modified since the specified
403
- # time, otherwise return a 412 (precondition failed).
404
- # @option options [String] :range
405
- # Downloads the specified range bytes of an object. For more information
406
- # about the HTTP Range header, see
407
- # [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35][1].
671
+ # time; otherwise, return a 412 (precondition failed) error.
408
672
  #
409
- # <note markdown="1"> Amazon S3 doesn't support retrieving multiple ranges of data per
410
- # `GET` request.
673
+ # If both of the `If-Match` and `If-Unmodified-Since` headers are
674
+ # present in the request as follows:
411
675
  #
412
- # </note>
676
+ # * `If-Match` condition evaluates to `true`, and;
677
+ #
678
+ # * `If-Unmodified-Since` condition evaluates to `false`;
413
679
  #
680
+ # Then Amazon S3 returns `200 OK` and the data requested.
414
681
  #
682
+ # For more information about conditional requests, see [RFC 7232][1].
415
683
  #
416
- # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35
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.
417
704
  # @option options [String] :sse_customer_algorithm
418
- # Specifies the algorithm to use to when encrypting the object (for
705
+ # Specifies the algorithm to use when encrypting the object (for
419
706
  # example, AES256).
707
+ #
708
+ # <note markdown="1"> This functionality is not supported for directory buckets.
709
+ #
710
+ # </note>
420
711
  # @option options [String] :sse_customer_key
421
712
  # Specifies the customer-provided encryption key for Amazon S3 to use in
422
713
  # encrypting data. This value is used to store the object and then it is
423
714
  # discarded; Amazon S3 does not store the encryption key. The key must
424
715
  # be appropriate for use with the algorithm specified in the
425
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>
426
721
  # @option options [String] :sse_customer_key_md5
427
722
  # Specifies the 128-bit MD5 digest of the encryption key according to
428
723
  # RFC 1321. Amazon S3 uses this header for a message integrity check to
429
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>
430
729
  # @option options [String] :request_payer
431
730
  # Confirms that the requester knows that they will be charged for the
432
731
  # request. Bucket owners need not specify this parameter in their
433
- # requests. For information about downloading objects from requester
434
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
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]
435
736
  # in the *Amazon S3 User Guide*.
436
737
  #
738
+ # <note markdown="1"> This functionality is not supported for directory buckets.
739
+ #
740
+ # </note>
741
+ #
437
742
  #
438
743
  #
439
744
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
@@ -443,9 +748,26 @@ module Aws::S3
443
748
  # for the part specified. Useful querying about the size of the part and
444
749
  # the number of parts in this object.
445
750
  # @option options [String] :expected_bucket_owner
446
- # The account ID of the expected bucket owner. If the bucket is owned by
447
- # a different account, the request will fail with an HTTP `403 (Access
448
- # Denied)` error.
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
449
771
  # @return [Types::HeadObjectOutput]
450
772
  def head(options = {})
451
773
  options = options.merge(
@@ -453,7 +775,9 @@ module Aws::S3
453
775
  key: @object_key,
454
776
  version_id: @id
455
777
  )
456
- resp = @client.head_object(options)
778
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
779
+ @client.head_object(options)
780
+ end
457
781
  resp.data
458
782
  end
459
783
 
@@ -525,6 +849,7 @@ module Aws::S3
525
849
  # request_payer: "requester", # accepts requester
526
850
  # bypass_governance_retention: false,
527
851
  # expected_bucket_owner: "AccountId",
852
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256, CRC64NVME
528
853
  # })
529
854
  # @param options ({})
530
855
  # @option options [String] :mfa
@@ -532,24 +857,86 @@ module Aws::S3
532
857
  # space, and the value that is displayed on your authentication device.
533
858
  # Required to permanently delete a versioned object if versioning is
534
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
535
877
  # @option options [String] :request_payer
536
878
  # Confirms that the requester knows that they will be charged for the
537
879
  # request. Bucket owners need not specify this parameter in their
538
- # requests. For information about downloading objects from requester
539
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
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]
540
884
  # in the *Amazon S3 User Guide*.
541
885
  #
886
+ # <note markdown="1"> This functionality is not supported for directory buckets.
887
+ #
888
+ # </note>
889
+ #
542
890
  #
543
891
  #
544
892
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
545
893
  # @option options [Boolean] :bypass_governance_retention
546
894
  # Specifies whether you want to delete this object even if it has a
547
895
  # Governance-type Object Lock in place. To use this header, you must
548
- # have the `s3:PutBucketPublicAccessBlock` permission.
896
+ # have the `s3:BypassGovernanceRetention` permission.
897
+ #
898
+ # <note markdown="1"> This functionality is not supported for directory buckets.
899
+ #
900
+ # </note>
549
901
  # @option options [String] :expected_bucket_owner
550
- # The account ID of the expected bucket owner. If the bucket is owned by
551
- # a different account, the request will fail with an HTTP `403 (Access
552
- # Denied)` error.
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
553
940
  # @return [void]
554
941
  def batch_delete!(options = {})
555
942
  batch_enum.each do |batch|
@@ -563,7 +950,9 @@ module Aws::S3
563
950
  version_id: item.id
564
951
  }
565
952
  end
566
- batch[0].client.delete_objects(params)
953
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
954
+ batch[0].client.delete_objects(params)
955
+ end
567
956
  end
568
957
  nil
569
958
  end
@@ -573,3 +962,6 @@ module Aws::S3
573
962
  end
574
963
  end
575
964
  end
965
+
966
+ # Load customizations if they exist
967
+ require 'aws-sdk-s3/customizations/object_version'