aws-sdk-s3 1.112.0 → 1.113.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -72,6 +72,12 @@ module Aws::S3
72
72
  data[:etag]
73
73
  end
74
74
 
75
+ # The algorithm that was used to create a checksum of the object.
76
+ # @return [Array<String>]
77
+ def checksum_algorithm
78
+ data[:checksum_algorithm]
79
+ end
80
+
75
81
  # Size in bytes of the object
76
82
  # @return [Integer]
77
83
  def size
@@ -276,6 +282,7 @@ module Aws::S3
276
282
  # object_summary.copy_from({
277
283
  # acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
278
284
  # cache_control: "CacheControl",
285
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
279
286
  # content_disposition: "ContentDisposition",
280
287
  # content_encoding: "ContentEncoding",
281
288
  # content_language: "ContentLanguage",
@@ -322,6 +329,14 @@ module Aws::S3
322
329
  # This action is not supported by Amazon S3 on Outposts.
323
330
  # @option options [String] :cache_control
324
331
  # Specifies caching behavior along the request/reply chain.
332
+ # @option options [String] :checksum_algorithm
333
+ # Indicates the algorithm you want Amazon S3 to use to create the
334
+ # checksum for the object. For more information, see [Checking object
335
+ # integrity][1] in the *Amazon S3 User Guide*.
336
+ #
337
+ #
338
+ #
339
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
325
340
  # @option options [String] :content_disposition
326
341
  # Specifies presentational information for the object.
327
342
  # @option options [String] :content_encoding
@@ -341,8 +356,8 @@ module Aws::S3
341
356
  # of the source bucket and the key of the source object, separated by
342
357
  # a slash (/). For example, to copy the object `reports/january.pdf`
343
358
  # from the bucket `awsexamplebucket`, use
344
- # `awsexamplebucket/reports/january.pdf`. The value must be URL
345
- # encoded.
359
+ # `awsexamplebucket/reports/january.pdf`. The value must be
360
+ # URL-encoded.
346
361
  #
347
362
  # * For objects accessed through access points, specify the Amazon
348
363
  # Resource Name (ARN) of the object as accessed through the access
@@ -367,7 +382,7 @@ module Aws::S3
367
382
  # outpost `my-outpost` owned by account `123456789012` in Region
368
383
  # `us-west-2`, use the URL encoding of
369
384
  # `arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf`.
370
- # The value must be URL encoded.
385
+ # The value must be URL-encoded.
371
386
  #
372
387
  # To copy a specific version of an object, append
373
388
  # `?versionId=<version-id>` to the value (for example,
@@ -484,8 +499,8 @@ module Aws::S3
484
499
  # @option options [String] :request_payer
485
500
  # Confirms that the requester knows that they will be charged for the
486
501
  # request. Bucket owners need not specify this parameter in their
487
- # requests. For information about downloading objects from requester
488
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
502
+ # requests. For information about downloading objects from Requester
503
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
489
504
  # in the *Amazon S3 User Guide*.
490
505
  #
491
506
  #
@@ -501,15 +516,15 @@ module Aws::S3
501
516
  # The date and time when you want the copied object's Object Lock to
502
517
  # expire.
503
518
  # @option options [String] :object_lock_legal_hold_status
504
- # Specifies whether you want to apply a Legal Hold to the copied object.
519
+ # Specifies whether you want to apply a legal hold to the copied object.
505
520
  # @option options [String] :expected_bucket_owner
506
521
  # The account ID of the expected destination bucket owner. If the
507
- # destination bucket is owned by a different account, the request will
508
- # fail with an HTTP `403 (Access Denied)` error.
522
+ # destination bucket is owned by a different account, the request fails
523
+ # with the HTTP status code `403 Forbidden` (access denied).
509
524
  # @option options [String] :expected_source_bucket_owner
510
525
  # The account ID of the expected source bucket owner. If the source
511
- # bucket is owned by a different account, the request will fail with an
512
- # HTTP `403 (Access Denied)` error.
526
+ # bucket is owned by a different account, the request fails with the
527
+ # HTTP status code `403 Forbidden` (access denied).
513
528
  # @return [Types::CopyObjectOutput]
514
529
  def copy_from(options = {})
515
530
  options = options.merge(
@@ -540,8 +555,8 @@ module Aws::S3
540
555
  # @option options [String] :request_payer
541
556
  # Confirms that the requester knows that they will be charged for the
542
557
  # request. Bucket owners need not specify this parameter in their
543
- # requests. For information about downloading objects from requester
544
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
558
+ # requests. For information about downloading objects from Requester
559
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
545
560
  # in the *Amazon S3 User Guide*.
546
561
  #
547
562
  #
@@ -550,11 +565,11 @@ module Aws::S3
550
565
  # @option options [Boolean] :bypass_governance_retention
551
566
  # Indicates whether S3 Object Lock should bypass Governance-mode
552
567
  # restrictions to process this operation. To use this header, you must
553
- # have the `s3:PutBucketPublicAccessBlock` permission.
568
+ # have the `s3:BypassGovernanceRetention` permission.
554
569
  # @option options [String] :expected_bucket_owner
555
570
  # The account ID of the expected bucket owner. If the bucket is owned by
556
- # a different account, the request will fail with an HTTP `403 (Access
557
- # Denied)` error.
571
+ # a different account, the request fails with the HTTP status code `403
572
+ # Forbidden` (access denied).
558
573
  # @return [Types::DeleteObjectOutput]
559
574
  def delete(options = {})
560
575
  options = options.merge(
@@ -586,20 +601,21 @@ module Aws::S3
586
601
  # request_payer: "requester", # accepts requester
587
602
  # part_number: 1,
588
603
  # expected_bucket_owner: "AccountId",
604
+ # checksum_mode: "ENABLED", # accepts ENABLED
589
605
  # })
590
606
  # @param [Hash] options ({})
591
607
  # @option options [String] :if_match
592
608
  # Return the object only if its entity tag (ETag) is the same as the one
593
- # specified, otherwise return a 412 (precondition failed).
609
+ # specified; otherwise, return a 412 (precondition failed) error.
594
610
  # @option options [Time,DateTime,Date,Integer,String] :if_modified_since
595
611
  # Return the object only if it has been modified since the specified
596
- # time, otherwise return a 304 (not modified).
612
+ # time; otherwise, return a 304 (not modified) error.
597
613
  # @option options [String] :if_none_match
598
614
  # Return the object only if its entity tag (ETag) is different from the
599
- # one specified, otherwise return a 304 (not modified).
615
+ # one specified; otherwise, return a 304 (not modified) error.
600
616
  # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
601
617
  # Return the object only if it has not been modified since the specified
602
- # time, otherwise return a 412 (precondition failed).
618
+ # time; otherwise, return a 412 (precondition failed) error.
603
619
  # @option options [String] :range
604
620
  # Downloads the specified range bytes of an object. For more information
605
621
  # about the HTTP Range header, see
@@ -643,8 +659,8 @@ module Aws::S3
643
659
  # @option options [String] :request_payer
644
660
  # Confirms that the requester knows that they will be charged for the
645
661
  # request. Bucket owners need not specify this parameter in their
646
- # requests. For information about downloading objects from requester
647
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
662
+ # requests. For information about downloading objects from Requester
663
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
648
664
  # in the *Amazon S3 User Guide*.
649
665
  #
650
666
  #
@@ -657,8 +673,10 @@ module Aws::S3
657
673
  # object.
658
674
  # @option options [String] :expected_bucket_owner
659
675
  # The account ID of the expected bucket owner. If the bucket is owned by
660
- # a different account, the request will fail with an HTTP `403 (Access
661
- # Denied)` error.
676
+ # a different account, the request fails with the HTTP status code `403
677
+ # Forbidden` (access denied).
678
+ # @option options [String] :checksum_mode
679
+ # To retrieve the checksum, this mode must be enabled.
662
680
  # @return [Types::GetObjectOutput]
663
681
  def get(options = {}, &block)
664
682
  options = options.merge(
@@ -701,6 +719,7 @@ module Aws::S3
701
719
  # object_lock_retain_until_date: Time.now,
702
720
  # object_lock_legal_hold_status: "ON", # accepts ON, OFF
703
721
  # expected_bucket_owner: "AccountId",
722
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
704
723
  # })
705
724
  # @param [Hash] options ({})
706
725
  # @option options [String] :acl
@@ -798,8 +817,8 @@ module Aws::S3
798
817
  # @option options [String] :request_payer
799
818
  # Confirms that the requester knows that they will be charged for the
800
819
  # request. Bucket owners need not specify this parameter in their
801
- # requests. For information about downloading objects from requester
802
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
820
+ # requests. For information about downloading objects from Requester
821
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
803
822
  # in the *Amazon S3 User Guide*.
804
823
  #
805
824
  #
@@ -814,12 +833,20 @@ module Aws::S3
814
833
  # @option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date
815
834
  # Specifies the date and time when you want the Object Lock to expire.
816
835
  # @option options [String] :object_lock_legal_hold_status
817
- # Specifies whether you want to apply a Legal Hold to the uploaded
836
+ # Specifies whether you want to apply a legal hold to the uploaded
818
837
  # object.
819
838
  # @option options [String] :expected_bucket_owner
820
839
  # The account ID of the expected bucket owner. If the bucket is owned by
821
- # a different account, the request will fail with an HTTP `403 (Access
822
- # Denied)` error.
840
+ # a different account, the request fails with the HTTP status code `403
841
+ # Forbidden` (access denied).
842
+ # @option options [String] :checksum_algorithm
843
+ # Indicates the algorithm you want Amazon S3 to use to create the
844
+ # checksum for the object. For more information, see [Checking object
845
+ # integrity][1] in the *Amazon S3 User Guide*.
846
+ #
847
+ #
848
+ #
849
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
823
850
  # @return [MultipartUpload]
824
851
  def initiate_multipart_upload(options = {})
825
852
  options = options.merge(
@@ -847,6 +874,11 @@ module Aws::S3
847
874
  # content_length: 1,
848
875
  # content_md5: "ContentMD5",
849
876
  # content_type: "ContentType",
877
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
878
+ # checksum_crc32: "ChecksumCRC32",
879
+ # checksum_crc32c: "ChecksumCRC32C",
880
+ # checksum_sha1: "ChecksumSHA1",
881
+ # checksum_sha256: "ChecksumSHA256",
850
882
  # expires: Time.now,
851
883
  # grant_full_control: "GrantFullControl",
852
884
  # grant_read: "GrantRead",
@@ -938,6 +970,61 @@ module Aws::S3
938
970
  #
939
971
  #
940
972
  # [1]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
973
+ # @option options [String] :checksum_algorithm
974
+ # Indicates the algorithm used to create the checksum for the object
975
+ # when using the SDK. This header will not provide any additional
976
+ # functionality if not using the SDK. When sending this header, there
977
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
978
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
979
+ # `400 Bad Request`. For more information, see [Checking object
980
+ # integrity][1] in the *Amazon S3 User Guide*.
981
+ #
982
+ # If you provide an individual checksum, Amazon S3 ignores any provided
983
+ # `ChecksumAlgorithm` parameter.
984
+ #
985
+ #
986
+ #
987
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
988
+ # @option options [String] :checksum_crc32
989
+ # This header can be used as a data integrity check to verify that the
990
+ # data received is the same data that was originally sent. This header
991
+ # specifies the base64-encoded, 32-bit CRC32 checksum of the object. For
992
+ # more information, see [Checking object integrity][1] in the *Amazon S3
993
+ # User Guide*.
994
+ #
995
+ #
996
+ #
997
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
998
+ # @option options [String] :checksum_crc32c
999
+ # This header can be used as a data integrity check to verify that the
1000
+ # data received is the same data that was originally sent. This header
1001
+ # specifies the base64-encoded, 32-bit CRC32C checksum of the object.
1002
+ # For more information, see [Checking object integrity][1] in the
1003
+ # *Amazon S3 User Guide*.
1004
+ #
1005
+ #
1006
+ #
1007
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
1008
+ # @option options [String] :checksum_sha1
1009
+ # This header can be used as a data integrity check to verify that the
1010
+ # data received is the same data that was originally sent. This header
1011
+ # specifies the base64-encoded, 160-bit SHA-1 digest of the object. For
1012
+ # more information, see [Checking object integrity][1] in the *Amazon S3
1013
+ # User Guide*.
1014
+ #
1015
+ #
1016
+ #
1017
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
1018
+ # @option options [String] :checksum_sha256
1019
+ # This header can be used as a data integrity check to verify that the
1020
+ # data received is the same data that was originally sent. This header
1021
+ # specifies the base64-encoded, 256-bit SHA-256 digest of the object.
1022
+ # For more information, see [Checking object integrity][1] in the
1023
+ # *Amazon S3 User Guide*.
1024
+ #
1025
+ #
1026
+ #
1027
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
941
1028
  # @option options [Time,DateTime,Date,Integer,String] :expires
942
1029
  # The date and time at which the object is no longer cacheable. For more
943
1030
  # information, see
@@ -1042,8 +1129,8 @@ module Aws::S3
1042
1129
  # @option options [String] :request_payer
1043
1130
  # Confirms that the requester knows that they will be charged for the
1044
1131
  # request. Bucket owners need not specify this parameter in their
1045
- # requests. For information about downloading objects from requester
1046
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
1132
+ # requests. For information about downloading objects from Requester
1133
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
1047
1134
  # in the *Amazon S3 User Guide*.
1048
1135
  #
1049
1136
  #
@@ -1066,8 +1153,8 @@ module Aws::S3
1066
1153
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html
1067
1154
  # @option options [String] :expected_bucket_owner
1068
1155
  # The account ID of the expected bucket owner. If the bucket is owned by
1069
- # a different account, the request will fail with an HTTP `403 (Access
1070
- # Denied)` error.
1156
+ # a different account, the request fails with the HTTP status code `403
1157
+ # Forbidden` (access denied).
1071
1158
  # @return [Types::PutObjectOutput]
1072
1159
  def put(options = {})
1073
1160
  options = options.merge(
@@ -1164,6 +1251,7 @@ module Aws::S3
1164
1251
  # },
1165
1252
  # },
1166
1253
  # request_payer: "requester", # accepts requester
1254
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
1167
1255
  # expected_bucket_owner: "AccountId",
1168
1256
  # })
1169
1257
  # @param [Hash] options ({})
@@ -1174,17 +1262,32 @@ module Aws::S3
1174
1262
  # @option options [String] :request_payer
1175
1263
  # Confirms that the requester knows that they will be charged for the
1176
1264
  # request. Bucket owners need not specify this parameter in their
1177
- # requests. For information about downloading objects from requester
1178
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
1265
+ # requests. For information about downloading objects from Requester
1266
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
1179
1267
  # in the *Amazon S3 User Guide*.
1180
1268
  #
1181
1269
  #
1182
1270
  #
1183
1271
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
1272
+ # @option options [String] :checksum_algorithm
1273
+ # Indicates the algorithm used to create the checksum for the object
1274
+ # when using the SDK. This header will not provide any additional
1275
+ # functionality if not using the SDK. When sending this header, there
1276
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
1277
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
1278
+ # `400 Bad Request`. For more information, see [Checking object
1279
+ # integrity][1] in the *Amazon S3 User Guide*.
1280
+ #
1281
+ # If you provide an individual checksum, Amazon S3 ignores any provided
1282
+ # `ChecksumAlgorithm` parameter.
1283
+ #
1284
+ #
1285
+ #
1286
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
1184
1287
  # @option options [String] :expected_bucket_owner
1185
1288
  # The account ID of the expected bucket owner. If the bucket is owned by
1186
- # a different account, the request will fail with an HTTP `403 (Access
1187
- # Denied)` error.
1289
+ # a different account, the request fails with the HTTP status code `403
1290
+ # Forbidden` (access denied).
1188
1291
  # @return [Types::RestoreObjectOutput]
1189
1292
  def restore_object(options = {})
1190
1293
  options = options.merge(
@@ -1317,6 +1420,7 @@ module Aws::S3
1317
1420
  # request_payer: "requester", # accepts requester
1318
1421
  # bypass_governance_retention: false,
1319
1422
  # expected_bucket_owner: "AccountId",
1423
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
1320
1424
  # })
1321
1425
  # @param options ({})
1322
1426
  # @option options [String] :mfa
@@ -1327,8 +1431,8 @@ module Aws::S3
1327
1431
  # @option options [String] :request_payer
1328
1432
  # Confirms that the requester knows that they will be charged for the
1329
1433
  # request. Bucket owners need not specify this parameter in their
1330
- # requests. For information about downloading objects from requester
1331
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
1434
+ # requests. For information about downloading objects from Requester
1435
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
1332
1436
  # in the *Amazon S3 User Guide*.
1333
1437
  #
1334
1438
  #
@@ -1337,11 +1441,29 @@ module Aws::S3
1337
1441
  # @option options [Boolean] :bypass_governance_retention
1338
1442
  # Specifies whether you want to delete this object even if it has a
1339
1443
  # Governance-type Object Lock in place. To use this header, you must
1340
- # have the `s3:PutBucketPublicAccessBlock` permission.
1444
+ # have the `s3:BypassGovernanceRetention` permission.
1341
1445
  # @option options [String] :expected_bucket_owner
1342
1446
  # The account ID of the expected bucket owner. If the bucket is owned by
1343
- # a different account, the request will fail with an HTTP `403 (Access
1344
- # Denied)` error.
1447
+ # a different account, the request fails with the HTTP status code `403
1448
+ # Forbidden` (access denied).
1449
+ # @option options [String] :checksum_algorithm
1450
+ # Indicates the algorithm used to create the checksum for the object
1451
+ # when using the SDK. This header will not provide any additional
1452
+ # functionality if not using the SDK. When sending this header, there
1453
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
1454
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
1455
+ # `400 Bad Request`. For more information, see [Checking object
1456
+ # integrity][1] in the *Amazon S3 User Guide*.
1457
+ #
1458
+ # If you provide an individual checksum, Amazon S3 ignores any provided
1459
+ # `ChecksumAlgorithm` parameter.
1460
+ #
1461
+ # This checksum algorithm must be the same for all parts and it match
1462
+ # the checksum value supplied in the `CreateMultipartUpload` request.
1463
+ #
1464
+ #
1465
+ #
1466
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
1345
1467
  # @return [void]
1346
1468
  def batch_delete!(options = {})
1347
1469
  batch_enum.each do |batch|
@@ -56,6 +56,12 @@ 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
+
59
65
  # Size in bytes of the object.
60
66
  # @return [Integer]
61
67
  def size
@@ -245,8 +251,8 @@ module Aws::S3
245
251
  # @option options [String] :request_payer
246
252
  # Confirms that the requester knows that they will be charged for the
247
253
  # 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]
254
+ # requests. For information about downloading objects from Requester
255
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
250
256
  # in the *Amazon S3 User Guide*.
251
257
  #
252
258
  #
@@ -255,11 +261,11 @@ module Aws::S3
255
261
  # @option options [Boolean] :bypass_governance_retention
256
262
  # Indicates whether S3 Object Lock should bypass Governance-mode
257
263
  # restrictions to process this operation. To use this header, you must
258
- # have the `s3:PutBucketPublicAccessBlock` permission.
264
+ # have the `s3:BypassGovernanceRetention` permission.
259
265
  # @option options [String] :expected_bucket_owner
260
266
  # 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.
267
+ # a different account, the request fails with the HTTP status code `403
268
+ # Forbidden` (access denied).
263
269
  # @return [Types::DeleteObjectOutput]
264
270
  def delete(options = {})
265
271
  options = options.merge(
@@ -291,20 +297,21 @@ module Aws::S3
291
297
  # request_payer: "requester", # accepts requester
292
298
  # part_number: 1,
293
299
  # expected_bucket_owner: "AccountId",
300
+ # checksum_mode: "ENABLED", # accepts ENABLED
294
301
  # })
295
302
  # @param [Hash] options ({})
296
303
  # @option options [String] :if_match
297
304
  # Return the object only if its entity tag (ETag) is the same as the one
298
- # specified, otherwise return a 412 (precondition failed).
305
+ # specified; otherwise, return a 412 (precondition failed) error.
299
306
  # @option options [Time,DateTime,Date,Integer,String] :if_modified_since
300
307
  # Return the object only if it has been modified since the specified
301
- # time, otherwise return a 304 (not modified).
308
+ # time; otherwise, return a 304 (not modified) error.
302
309
  # @option options [String] :if_none_match
303
310
  # Return the object only if its entity tag (ETag) is different from the
304
- # one specified, otherwise return a 304 (not modified).
311
+ # one specified; otherwise, return a 304 (not modified) error.
305
312
  # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
306
313
  # Return the object only if it has not been modified since the specified
307
- # time, otherwise return a 412 (precondition failed).
314
+ # time; otherwise, return a 412 (precondition failed) error.
308
315
  # @option options [String] :range
309
316
  # Downloads the specified range bytes of an object. For more information
310
317
  # about the HTTP Range header, see
@@ -346,8 +353,8 @@ module Aws::S3
346
353
  # @option options [String] :request_payer
347
354
  # Confirms that the requester knows that they will be charged for the
348
355
  # 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]
356
+ # requests. For information about downloading objects from Requester
357
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
351
358
  # in the *Amazon S3 User Guide*.
352
359
  #
353
360
  #
@@ -360,8 +367,10 @@ module Aws::S3
360
367
  # object.
361
368
  # @option options [String] :expected_bucket_owner
362
369
  # 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.
370
+ # a different account, the request fails with the HTTP status code `403
371
+ # Forbidden` (access denied).
372
+ # @option options [String] :checksum_mode
373
+ # To retrieve the checksum, this mode must be enabled.
365
374
  # @return [Types::GetObjectOutput]
366
375
  def get(options = {}, &block)
367
376
  options = options.merge(
@@ -387,20 +396,21 @@ module Aws::S3
387
396
  # request_payer: "requester", # accepts requester
388
397
  # part_number: 1,
389
398
  # expected_bucket_owner: "AccountId",
399
+ # checksum_mode: "ENABLED", # accepts ENABLED
390
400
  # })
391
401
  # @param [Hash] options ({})
392
402
  # @option options [String] :if_match
393
403
  # Return the object only if its entity tag (ETag) is the same as the one
394
- # specified, otherwise return a 412 (precondition failed).
404
+ # specified; otherwise, return a 412 (precondition failed) error.
395
405
  # @option options [Time,DateTime,Date,Integer,String] :if_modified_since
396
406
  # Return the object only if it has been modified since the specified
397
- # time, otherwise return a 304 (not modified).
407
+ # time; otherwise, return a 304 (not modified) error.
398
408
  # @option options [String] :if_none_match
399
409
  # Return the object only if its entity tag (ETag) is different from the
400
- # one specified, otherwise return a 304 (not modified).
410
+ # one specified; otherwise, return a 304 (not modified) error.
401
411
  # @option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
402
412
  # Return the object only if it has not been modified since the specified
403
- # time, otherwise return a 412 (precondition failed).
413
+ # time; otherwise, return a 412 (precondition failed) error.
404
414
  # @option options [String] :range
405
415
  # Because `HeadObject` returns only the metadata for an object, this
406
416
  # parameter has no effect.
@@ -420,8 +430,8 @@ module Aws::S3
420
430
  # @option options [String] :request_payer
421
431
  # Confirms that the requester knows that they will be charged for the
422
432
  # request. Bucket owners need not specify this parameter in their
423
- # requests. For information about downloading objects from requester
424
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
433
+ # requests. For information about downloading objects from Requester
434
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
425
435
  # in the *Amazon S3 User Guide*.
426
436
  #
427
437
  #
@@ -434,8 +444,15 @@ module Aws::S3
434
444
  # the number of parts in this object.
435
445
  # @option options [String] :expected_bucket_owner
436
446
  # The account ID of the expected bucket owner. If the bucket is owned by
437
- # a different account, the request will fail with an HTTP `403 (Access
438
- # Denied)` error.
447
+ # a different account, the request fails with the HTTP status code `403
448
+ # Forbidden` (access denied).
449
+ # @option options [String] :checksum_mode
450
+ # To retrieve the checksum, this parameter must be enabled.
451
+ #
452
+ # In addition, if you enable `ChecksumMode` and the object is encrypted
453
+ # with Amazon Web Services Key Management Service (Amazon Web Services
454
+ # KMS), you must have permission to use the `kms:Decrypt` action for the
455
+ # request to succeed.
439
456
  # @return [Types::HeadObjectOutput]
440
457
  def head(options = {})
441
458
  options = options.merge(
@@ -515,6 +532,7 @@ module Aws::S3
515
532
  # request_payer: "requester", # accepts requester
516
533
  # bypass_governance_retention: false,
517
534
  # expected_bucket_owner: "AccountId",
535
+ # checksum_algorithm: "CRC32", # accepts CRC32, CRC32C, SHA1, SHA256
518
536
  # })
519
537
  # @param options ({})
520
538
  # @option options [String] :mfa
@@ -525,8 +543,8 @@ module Aws::S3
525
543
  # @option options [String] :request_payer
526
544
  # Confirms that the requester knows that they will be charged for the
527
545
  # request. Bucket owners need not specify this parameter in their
528
- # requests. For information about downloading objects from requester
529
- # pays buckets, see [Downloading Objects in Requestor Pays Buckets][1]
546
+ # requests. For information about downloading objects from Requester
547
+ # Pays buckets, see [Downloading Objects in Requester Pays Buckets][1]
530
548
  # in the *Amazon S3 User Guide*.
531
549
  #
532
550
  #
@@ -535,11 +553,29 @@ module Aws::S3
535
553
  # @option options [Boolean] :bypass_governance_retention
536
554
  # Specifies whether you want to delete this object even if it has a
537
555
  # Governance-type Object Lock in place. To use this header, you must
538
- # have the `s3:PutBucketPublicAccessBlock` permission.
556
+ # have the `s3:BypassGovernanceRetention` permission.
539
557
  # @option options [String] :expected_bucket_owner
540
558
  # The account ID of the expected bucket owner. If the bucket is owned by
541
- # a different account, the request will fail with an HTTP `403 (Access
542
- # Denied)` error.
559
+ # a different account, the request fails with the HTTP status code `403
560
+ # Forbidden` (access denied).
561
+ # @option options [String] :checksum_algorithm
562
+ # Indicates the algorithm used to create the checksum for the object
563
+ # when using the SDK. This header will not provide any additional
564
+ # functionality if not using the SDK. When sending this header, there
565
+ # must be a corresponding `x-amz-checksum` or `x-amz-trailer` header
566
+ # sent. Otherwise, Amazon S3 fails the request with the HTTP status code
567
+ # `400 Bad Request`. For more information, see [Checking object
568
+ # integrity][1] in the *Amazon S3 User Guide*.
569
+ #
570
+ # If you provide an individual checksum, Amazon S3 ignores any provided
571
+ # `ChecksumAlgorithm` parameter.
572
+ #
573
+ # This checksum algorithm must be the same for all parts and it match
574
+ # the checksum value supplied in the `CreateMultipartUpload` request.
575
+ #
576
+ #
577
+ #
578
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
543
579
  # @return [void]
544
580
  def batch_delete!(options = {})
545
581
  batch_enum.each do |batch|
@@ -22,9 +22,11 @@ module Aws
22
22
  CHUNK_SIZE = 1 * 1024 * 1024 # one MB
23
23
 
24
24
  def call(context)
25
- body = context.http_request.body
26
- if body.respond_to?(:size) && body.size > 0
27
- context.http_request.headers['Content-Md5'] ||= md5(body)
25
+ if !context[:checksum_algorithms] # skip in favor of flexible checksum
26
+ body = context.http_request.body
27
+ if body.respond_to?(:size) && body.size > 0
28
+ context.http_request.headers['Content-Md5'] ||= md5(body)
29
+ end
28
30
  end
29
31
  @handler.call(context)
30
32
  end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aws
4
+ module S3
5
+ module Plugins
6
+
7
+ # S3 GetObject results for whole Multipart Objects contain a checksum
8
+ # that cannot be validated. These should be skipped by the
9
+ # ChecksumAlgorithm plugin.
10
+ class SkipWholeMultipartGetChecksums < Seahorse::Client::Plugin
11
+
12
+ class Handler < Seahorse::Client::Handler
13
+
14
+ def call(context)
15
+ context[:http_checksum] ||= {}
16
+ context[:http_checksum][:skip_on_suffix] = true
17
+
18
+ @handler.call(context)
19
+ end
20
+
21
+ end
22
+
23
+ handler(
24
+ Handler,
25
+ step: :initialize,
26
+ operations: [:get_object]
27
+ )
28
+ end
29
+ end
30
+ end
31
+ end