aws-sdk-s3 1.129.0 → 1.130.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 578e27a27f5e9dbd010d0ebd8c5d0fb08a044ad00030fe0aa5bffdf06b3fefcb
4
- data.tar.gz: ba2d207e8dcde9882c68df896273de191c2f73f96474fdc15edd1f05340c7549
3
+ metadata.gz: 9170ab560df5828b8608754ee83facb83ccd4f09b425661c2f81bef05d45085c
4
+ data.tar.gz: 70f914ab9977fac81df71f9dd5ba0509a0d598f72cf1f988c491e37aa9db000c
5
5
  SHA512:
6
- metadata.gz: 46454fc534e68df2f8c885243e622298b3a044d3102e9682055bf9cad711474ddf6a26676b8a1d1a94d8680efc590fb9f9fab36071e3e26cba126354209f3954
7
- data.tar.gz: ce7cbb366e60f0d68fd0fcaed9210a4e4ed2ae03c45c81fda0ae310a4cd12291480214c7478ab28257c7b9bd0c7981898f009c57aa7ae6a83e9e875479e41bc3
6
+ metadata.gz: ece1dd86bf6963b66f243289c3ca2d9e77ddee8f745dd9ea166464c96250de2377a8a2b7ce38e3d38bb66b02bc292884f9293b4aaa9d6b9a267b81b1b1fa2e06
7
+ data.tar.gz: e9cca71b4d710aad1af40c1dea6f06955480d6a8db748a61c66e8f41d49fb271def041fffce98c81f47fa5100c2375caa8492684ab7601d8fe45f712f07061f4
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.130.0 (2023-07-13)
5
+ ------------------
6
+
7
+ * Feature - S3 Inventory now supports Object Access Control List and Object Owner as available object metadata fields in inventory reports.
8
+
9
+ * Feature - Allow Object multipart copy API to work when requiring a checksum algorithm.
10
+ * Feature - Allow Object multipart copy API to optionally copy parts as they exist on the source object if it has parts, instead of generating new part ranges, when specifying `use_source_parts: true`.
11
+
4
12
  1.129.0 (2023-07-11)
5
13
  ------------------
6
14
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.129.0
1
+ 1.130.0
@@ -229,7 +229,7 @@ module Aws::S3
229
229
  # bucket.create({
230
230
  # acl: "private", # accepts private, public-read, public-read-write, authenticated-read
231
231
  # create_bucket_configuration: {
232
- # location_constraint: "af-south-1", # accepts af-south-1, ap-east-1, ap-northeast-1, ap-northeast-2, ap-northeast-3, ap-south-1, ap-southeast-1, ap-southeast-2, ap-southeast-3, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-north-1, eu-south-1, eu-west-1, eu-west-2, eu-west-3, me-south-1, sa-east-1, us-east-2, us-gov-east-1, us-gov-west-1, us-west-1, us-west-2
232
+ # location_constraint: "af-south-1", # accepts af-south-1, ap-east-1, ap-northeast-1, ap-northeast-2, ap-northeast-3, ap-south-1, ap-southeast-1, ap-southeast-2, ap-southeast-3, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-north-1, eu-south-1, eu-west-1, eu-west-2, eu-west-3, me-south-1, sa-east-1, us-east-2, us-gov-east-1, us-gov-west-1, us-west-1, us-west-2, ap-south-2, eu-south-2
233
233
  # },
234
234
  # grant_full_control: "GrantFullControl",
235
235
  # grant_read: "GrantRead",
@@ -968,8 +968,10 @@ module Aws::S3
968
968
  # </note>
969
969
  #
970
970
  # The copy request charge is based on the storage class and Region that
971
- # you specify for the destination object. For pricing information, see
972
- # [Amazon S3 pricing][3].
971
+ # you specify for the destination object. The request can also result in
972
+ # a data retrieval charge for the source if the source storage class
973
+ # bills for data retrieval. For pricing information, see [Amazon S3
974
+ # pricing][3].
973
975
  #
974
976
  # Amazon S3 transfer acceleration does not support cross-Region copies.
975
977
  # If you request a cross-Region copy using a transfer acceleration
@@ -1695,33 +1697,33 @@ module Aws::S3
1695
1697
  # * {Types::CreateBucketOutput#location #location} => String
1696
1698
  #
1697
1699
  #
1698
- # @example Example: To create a bucket
1700
+ # @example Example: To create a bucket in a specific region
1699
1701
  #
1700
- # # The following example creates a bucket.
1702
+ # # The following example creates a bucket. The request specifies an AWS region where to create the bucket.
1701
1703
  #
1702
1704
  # resp = client.create_bucket({
1703
1705
  # bucket: "examplebucket",
1706
+ # create_bucket_configuration: {
1707
+ # location_constraint: "eu-west-1",
1708
+ # },
1704
1709
  # })
1705
1710
  #
1706
1711
  # resp.to_h outputs the following:
1707
1712
  # {
1708
- # location: "/examplebucket",
1713
+ # location: "http://examplebucket.<Region>.s3.amazonaws.com/",
1709
1714
  # }
1710
1715
  #
1711
- # @example Example: To create a bucket in a specific region
1716
+ # @example Example: To create a bucket
1712
1717
  #
1713
- # # The following example creates a bucket. The request specifies an AWS region where to create the bucket.
1718
+ # # The following example creates a bucket.
1714
1719
  #
1715
1720
  # resp = client.create_bucket({
1716
1721
  # bucket: "examplebucket",
1717
- # create_bucket_configuration: {
1718
- # location_constraint: "eu-west-1",
1719
- # },
1720
1722
  # })
1721
1723
  #
1722
1724
  # resp.to_h outputs the following:
1723
1725
  # {
1724
- # location: "http://examplebucket.<Region>.s3.amazonaws.com/",
1726
+ # location: "/examplebucket",
1725
1727
  # }
1726
1728
  #
1727
1729
  # @example Request syntax with placeholder values
@@ -1730,7 +1732,7 @@ module Aws::S3
1730
1732
  # acl: "private", # accepts private, public-read, public-read-write, authenticated-read
1731
1733
  # bucket: "BucketName", # required
1732
1734
  # create_bucket_configuration: {
1733
- # location_constraint: "af-south-1", # accepts af-south-1, ap-east-1, ap-northeast-1, ap-northeast-2, ap-northeast-3, ap-south-1, ap-southeast-1, ap-southeast-2, ap-southeast-3, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-north-1, eu-south-1, eu-west-1, eu-west-2, eu-west-3, me-south-1, sa-east-1, us-east-2, us-gov-east-1, us-gov-west-1, us-west-1, us-west-2
1735
+ # location_constraint: "af-south-1", # accepts af-south-1, ap-east-1, ap-northeast-1, ap-northeast-2, ap-northeast-3, ap-south-1, ap-southeast-1, ap-southeast-2, ap-southeast-3, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-north-1, eu-south-1, eu-west-1, eu-west-2, eu-west-3, me-south-1, sa-east-1, us-east-2, us-gov-east-1, us-gov-west-1, us-west-1, us-west-2, ap-south-2, eu-south-2
1734
1736
  # },
1735
1737
  # grant_full_control: "GrantFullControl",
1736
1738
  # grant_read: "GrantRead",
@@ -3173,6 +3175,15 @@ module Aws::S3
3173
3175
  # * {Types::DeleteObjectOutput#request_charged #request_charged} => String
3174
3176
  #
3175
3177
  #
3178
+ # @example Example: To delete an object (from a non-versioned bucket)
3179
+ #
3180
+ # # The following example deletes an object from a non-versioned bucket.
3181
+ #
3182
+ # resp = client.delete_object({
3183
+ # bucket: "ExampleBucket",
3184
+ # key: "HappyFace.jpg",
3185
+ # })
3186
+ #
3176
3187
  # @example Example: To delete an object
3177
3188
  #
3178
3189
  # # The following example deletes an object from an S3 bucket.
@@ -3186,15 +3197,6 @@ module Aws::S3
3186
3197
  # {
3187
3198
  # }
3188
3199
  #
3189
- # @example Example: To delete an object (from a non-versioned bucket)
3190
- #
3191
- # # The following example deletes an object from a non-versioned bucket.
3192
- #
3193
- # resp = client.delete_object({
3194
- # bucket: "ExampleBucket",
3195
- # key: "HappyFace.jpg",
3196
- # })
3197
- #
3198
3200
  # @example Request syntax with placeholder values
3199
3201
  #
3200
3202
  # resp = client.delete_object({
@@ -3286,35 +3288,35 @@ module Aws::S3
3286
3288
  # * {Types::DeleteObjectTaggingOutput#version_id #version_id} => String
3287
3289
  #
3288
3290
  #
3289
- # @example Example: To remove tag set from an object version
3291
+ # @example Example: To remove tag set from an object
3290
3292
  #
3291
- # # The following example removes tag set associated with the specified object version. The request specifies both the
3292
- # # object key and object version.
3293
+ # # The following example removes tag set associated with the specified object. If the bucket is versioning enabled, the
3294
+ # # operation removes tag set from the latest object version.
3293
3295
  #
3294
3296
  # resp = client.delete_object_tagging({
3295
3297
  # bucket: "examplebucket",
3296
3298
  # key: "HappyFace.jpg",
3297
- # version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
3298
3299
  # })
3299
3300
  #
3300
3301
  # resp.to_h outputs the following:
3301
3302
  # {
3302
- # version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
3303
+ # version_id: "null",
3303
3304
  # }
3304
3305
  #
3305
- # @example Example: To remove tag set from an object
3306
+ # @example Example: To remove tag set from an object version
3306
3307
  #
3307
- # # The following example removes tag set associated with the specified object. If the bucket is versioning enabled, the
3308
- # # operation removes tag set from the latest object version.
3308
+ # # The following example removes tag set associated with the specified object version. The request specifies both the
3309
+ # # object key and object version.
3309
3310
  #
3310
3311
  # resp = client.delete_object_tagging({
3311
3312
  # bucket: "examplebucket",
3312
3313
  # key: "HappyFace.jpg",
3314
+ # version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
3313
3315
  # })
3314
3316
  #
3315
3317
  # resp.to_h outputs the following:
3316
3318
  # {
3317
- # version_id: "null",
3319
+ # version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
3318
3320
  # }
3319
3321
  #
3320
3322
  # @example Request syntax with placeholder values
@@ -4227,7 +4229,7 @@ module Aws::S3
4227
4229
  # resp.inventory_configuration.id #=> String
4228
4230
  # resp.inventory_configuration.included_object_versions #=> String, one of "All", "Current"
4229
4231
  # resp.inventory_configuration.optional_fields #=> Array
4230
- # resp.inventory_configuration.optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus", "IntelligentTieringAccessTier", "BucketKeyStatus", "ChecksumAlgorithm"
4232
+ # resp.inventory_configuration.optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus", "IntelligentTieringAccessTier", "BucketKeyStatus", "ChecksumAlgorithm", "ObjectAccessControlList", "ObjectOwner"
4231
4233
  # resp.inventory_configuration.schedule.frequency #=> String, one of "Daily", "Weekly"
4232
4234
  #
4233
4235
  # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfiguration AWS API Documentation
@@ -4571,7 +4573,7 @@ module Aws::S3
4571
4573
  #
4572
4574
  # @example Response structure
4573
4575
  #
4574
- # resp.location_constraint #=> String, one of "af-south-1", "ap-east-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ca-central-1", "cn-north-1", "cn-northwest-1", "EU", "eu-central-1", "eu-north-1", "eu-south-1", "eu-west-1", "eu-west-2", "eu-west-3", "me-south-1", "sa-east-1", "us-east-2", "us-gov-east-1", "us-gov-west-1", "us-west-1", "us-west-2"
4576
+ # resp.location_constraint #=> String, one of "af-south-1", "ap-east-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ca-central-1", "cn-north-1", "cn-northwest-1", "EU", "eu-central-1", "eu-north-1", "eu-south-1", "eu-west-1", "eu-west-2", "eu-west-3", "me-south-1", "sa-east-1", "us-east-2", "us-gov-east-1", "us-gov-west-1", "us-west-1", "us-west-2", "ap-south-2", "eu-south-2"
4575
4577
  #
4576
4578
  # @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocation AWS API Documentation
4577
4579
  #
@@ -7745,7 +7747,7 @@ module Aws::S3
7745
7747
  # resp.inventory_configuration_list[0].id #=> String
7746
7748
  # resp.inventory_configuration_list[0].included_object_versions #=> String, one of "All", "Current"
7747
7749
  # resp.inventory_configuration_list[0].optional_fields #=> Array
7748
- # resp.inventory_configuration_list[0].optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus", "IntelligentTieringAccessTier", "BucketKeyStatus", "ChecksumAlgorithm"
7750
+ # resp.inventory_configuration_list[0].optional_fields[0] #=> String, one of "Size", "LastModifiedDate", "StorageClass", "ETag", "IsMultipartUploaded", "ReplicationStatus", "EncryptionStatus", "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus", "IntelligentTieringAccessTier", "BucketKeyStatus", "ChecksumAlgorithm", "ObjectAccessControlList", "ObjectOwner"
7749
7751
  # resp.inventory_configuration_list[0].schedule.frequency #=> String, one of "Daily", "Weekly"
7750
7752
  # resp.is_truncated #=> Boolean
7751
7753
  # resp.next_continuation_token #=> String
@@ -10169,7 +10171,7 @@ module Aws::S3
10169
10171
  # },
10170
10172
  # id: "InventoryId", # required
10171
10173
  # included_object_versions: "All", # required, accepts All, Current
10172
- # optional_fields: ["Size"], # accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier, BucketKeyStatus, ChecksumAlgorithm
10174
+ # optional_fields: ["Size"], # accepts Size, LastModifiedDate, StorageClass, ETag, IsMultipartUploaded, ReplicationStatus, EncryptionStatus, ObjectLockRetainUntilDate, ObjectLockMode, ObjectLockLegalHoldStatus, IntelligentTieringAccessTier, BucketKeyStatus, ChecksumAlgorithm, ObjectAccessControlList, ObjectOwner
10173
10175
  # schedule: { # required
10174
10176
  # frequency: "Daily", # required, accepts Daily, Weekly
10175
10177
  # },
@@ -12493,61 +12495,58 @@ module Aws::S3
12493
12495
  # * {Types::PutObjectOutput#request_charged #request_charged} => String
12494
12496
  #
12495
12497
  #
12496
- # @example Example: To upload object and specify user-defined metadata
12498
+ # @example Example: To create an object.
12497
12499
  #
12498
- # # The following example creates an object. The request also specifies optional metadata. If the bucket is versioning
12499
- # # enabled, S3 returns version ID in response.
12500
+ # # The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
12500
12501
  #
12501
12502
  # resp = client.put_object({
12502
12503
  # body: "filetoupload",
12503
12504
  # bucket: "examplebucket",
12504
- # key: "exampleobject",
12505
- # metadata: {
12506
- # "metadata1" => "value1",
12507
- # "metadata2" => "value2",
12508
- # },
12505
+ # key: "objectkey",
12509
12506
  # })
12510
12507
  #
12511
12508
  # resp.to_h outputs the following:
12512
12509
  # {
12513
12510
  # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
12514
- # version_id: "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0",
12511
+ # version_id: "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ",
12515
12512
  # }
12516
12513
  #
12517
- # @example Example: To upload an object (specify optional headers)
12514
+ # @example Example: To upload object and specify user-defined metadata
12518
12515
  #
12519
- # # The following example uploads an object. The request specifies optional request headers to directs S3 to use specific
12520
- # # storage class and use server-side encryption.
12516
+ # # The following example creates an object. The request also specifies optional metadata. If the bucket is versioning
12517
+ # # enabled, S3 returns version ID in response.
12521
12518
  #
12522
12519
  # resp = client.put_object({
12523
- # body: "HappyFace.jpg",
12520
+ # body: "filetoupload",
12524
12521
  # bucket: "examplebucket",
12525
- # key: "HappyFace.jpg",
12526
- # server_side_encryption: "AES256",
12527
- # storage_class: "STANDARD_IA",
12522
+ # key: "exampleobject",
12523
+ # metadata: {
12524
+ # "metadata1" => "value1",
12525
+ # "metadata2" => "value2",
12526
+ # },
12528
12527
  # })
12529
12528
  #
12530
12529
  # resp.to_h outputs the following:
12531
12530
  # {
12532
12531
  # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
12533
- # server_side_encryption: "AES256",
12534
- # version_id: "CG612hodqujkf8FaaNfp8U..FIhLROcp",
12532
+ # version_id: "pSKidl4pHBiNwukdbcPXAIs.sshFFOc0",
12535
12533
  # }
12536
12534
  #
12537
- # @example Example: To create an object.
12535
+ # @example Example: To upload an object
12538
12536
  #
12539
- # # The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
12537
+ # # The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file
12538
+ # # syntax. S3 returns VersionId of the newly created object.
12540
12539
  #
12541
12540
  # resp = client.put_object({
12542
- # body: "filetoupload",
12541
+ # body: "HappyFace.jpg",
12543
12542
  # bucket: "examplebucket",
12544
- # key: "objectkey",
12543
+ # key: "HappyFace.jpg",
12545
12544
  # })
12546
12545
  #
12547
12546
  # resp.to_h outputs the following:
12548
12547
  # {
12549
12548
  # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
12550
- # version_id: "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ",
12549
+ # version_id: "tpf3zF08nBplQK1XLOefGskR7mGDwcDk",
12551
12550
  # }
12552
12551
  #
12553
12552
  # @example Example: To upload an object and specify canned ACL.
@@ -12568,59 +12567,62 @@ module Aws::S3
12568
12567
  # version_id: "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr",
12569
12568
  # }
12570
12569
  #
12571
- # @example Example: To upload an object
12570
+ # @example Example: To upload an object (specify optional headers)
12572
12571
  #
12573
- # # The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file
12574
- # # syntax. S3 returns VersionId of the newly created object.
12572
+ # # The following example uploads an object. The request specifies optional request headers to directs S3 to use specific
12573
+ # # storage class and use server-side encryption.
12575
12574
  #
12576
12575
  # resp = client.put_object({
12577
12576
  # body: "HappyFace.jpg",
12578
12577
  # bucket: "examplebucket",
12579
12578
  # key: "HappyFace.jpg",
12579
+ # server_side_encryption: "AES256",
12580
+ # storage_class: "STANDARD_IA",
12580
12581
  # })
12581
12582
  #
12582
12583
  # resp.to_h outputs the following:
12583
12584
  # {
12584
12585
  # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
12585
- # version_id: "tpf3zF08nBplQK1XLOefGskR7mGDwcDk",
12586
+ # server_side_encryption: "AES256",
12587
+ # version_id: "CG612hodqujkf8FaaNfp8U..FIhLROcp",
12586
12588
  # }
12587
12589
  #
12588
- # @example Example: To upload an object and specify server-side encryption and object tags
12590
+ # @example Example: To upload an object and specify optional tags
12589
12591
  #
12590
- # # The following example uploads an object. The request specifies the optional server-side encryption option. The request
12591
- # # also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
12592
+ # # The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore
12593
+ # # S3 returns version ID of the newly created object.
12592
12594
  #
12593
12595
  # resp = client.put_object({
12594
- # body: "filetoupload",
12596
+ # body: "c:\\HappyFace.jpg",
12595
12597
  # bucket: "examplebucket",
12596
- # key: "exampleobject",
12597
- # server_side_encryption: "AES256",
12598
+ # key: "HappyFace.jpg",
12598
12599
  # tagging: "key1=value1&key2=value2",
12599
12600
  # })
12600
12601
  #
12601
12602
  # resp.to_h outputs the following:
12602
12603
  # {
12603
12604
  # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
12604
- # server_side_encryption: "AES256",
12605
- # version_id: "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt",
12605
+ # version_id: "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a",
12606
12606
  # }
12607
12607
  #
12608
- # @example Example: To upload an object and specify optional tags
12608
+ # @example Example: To upload an object and specify server-side encryption and object tags
12609
12609
  #
12610
- # # The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore
12611
- # # S3 returns version ID of the newly created object.
12610
+ # # The following example uploads an object. The request specifies the optional server-side encryption option. The request
12611
+ # # also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
12612
12612
  #
12613
12613
  # resp = client.put_object({
12614
- # body: "c:\\HappyFace.jpg",
12614
+ # body: "filetoupload",
12615
12615
  # bucket: "examplebucket",
12616
- # key: "HappyFace.jpg",
12616
+ # key: "exampleobject",
12617
+ # server_side_encryption: "AES256",
12617
12618
  # tagging: "key1=value1&key2=value2",
12618
12619
  # })
12619
12620
  #
12620
12621
  # resp.to_h outputs the following:
12621
12622
  # {
12622
12623
  # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
12623
- # version_id: "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a",
12624
+ # server_side_encryption: "AES256",
12625
+ # version_id: "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt",
12624
12626
  # }
12625
12627
  #
12626
12628
  # @example Streaming a file from disk
@@ -15165,45 +15167,45 @@ module Aws::S3
15165
15167
  # * {Types::UploadPartCopyOutput#request_charged #request_charged} => String
15166
15168
  #
15167
15169
  #
15168
- # @example Example: To upload a part by copying data from an existing object as data source
15170
+ # @example Example: To upload a part by copying byte range from an existing object as data source
15169
15171
  #
15170
- # # The following example uploads a part of a multipart upload by copying data from an existing object as data source.
15172
+ # # The following example uploads a part of a multipart upload by copying a specified byte range from an existing object as
15173
+ # # data source.
15171
15174
  #
15172
15175
  # resp = client.upload_part_copy({
15173
15176
  # bucket: "examplebucket",
15174
15177
  # copy_source: "/bucketname/sourceobjectkey",
15178
+ # copy_source_range: "bytes=1-100000",
15175
15179
  # key: "examplelargeobject",
15176
- # part_number: 1,
15180
+ # part_number: 2,
15177
15181
  # upload_id: "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--",
15178
15182
  # })
15179
15183
  #
15180
15184
  # resp.to_h outputs the following:
15181
15185
  # {
15182
15186
  # copy_part_result: {
15183
- # etag: "\"b0c6f0e7e054ab8fa2536a2677f8734d\"",
15184
- # last_modified: Time.parse("2016-12-29T21:24:43.000Z"),
15187
+ # etag: "\"65d16d19e65a7508a51f043180edcc36\"",
15188
+ # last_modified: Time.parse("2016-12-29T21:44:28.000Z"),
15185
15189
  # },
15186
15190
  # }
15187
15191
  #
15188
- # @example Example: To upload a part by copying byte range from an existing object as data source
15192
+ # @example Example: To upload a part by copying data from an existing object as data source
15189
15193
  #
15190
- # # The following example uploads a part of a multipart upload by copying a specified byte range from an existing object as
15191
- # # data source.
15194
+ # # The following example uploads a part of a multipart upload by copying data from an existing object as data source.
15192
15195
  #
15193
15196
  # resp = client.upload_part_copy({
15194
15197
  # bucket: "examplebucket",
15195
15198
  # copy_source: "/bucketname/sourceobjectkey",
15196
- # copy_source_range: "bytes=1-100000",
15197
15199
  # key: "examplelargeobject",
15198
- # part_number: 2,
15200
+ # part_number: 1,
15199
15201
  # upload_id: "exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--",
15200
15202
  # })
15201
15203
  #
15202
15204
  # resp.to_h outputs the following:
15203
15205
  # {
15204
15206
  # copy_part_result: {
15205
- # etag: "\"65d16d19e65a7508a51f043180edcc36\"",
15206
- # last_modified: Time.parse("2016-12-29T21:44:28.000Z"),
15207
+ # etag: "\"b0c6f0e7e054ab8fa2536a2677f8734d\"",
15208
+ # last_modified: Time.parse("2016-12-29T21:24:43.000Z"),
15207
15209
  # },
15208
15210
  # }
15209
15211
  #
@@ -15651,7 +15653,7 @@ module Aws::S3
15651
15653
  params: params,
15652
15654
  config: config)
15653
15655
  context[:gem_name] = 'aws-sdk-s3'
15654
- context[:gem_version] = '1.129.0'
15656
+ context[:gem_version] = '1.130.0'
15655
15657
  Seahorse::Client::Request.new(handlers, context)
15656
15658
  end
15657
15659
 
@@ -46,6 +46,14 @@ module Aws
46
46
  # different region. You do not need to specify this option
47
47
  # if you have provided a `:source_client` or a `:content_length`.
48
48
  #
49
+ # @option options [Boolean] :use_source_parts (false) Only used when
50
+ # `:multipart_copy` is `true`. Use part sizes defined on the source
51
+ # object if any exist. If copying or moving an object that
52
+ # is already multipart, this does not re-part the object, instead
53
+ # re-using the part definitions on the original. That means the etag
54
+ # and any checksums will not change. This is especially useful if the
55
+ # source object has parts with varied sizes.
56
+ #
49
57
  # @example Basic object copy
50
58
  #
51
59
  # bucket = Aws::S3::Bucket.new('target-bucket')
@@ -15,18 +15,21 @@ module Aws
15
15
  MAX_PARTS = 10_000
16
16
 
17
17
  # @option options [Client] :client
18
- # @option [Integer] :min_part_size (52428800) Size of copied parts.
19
- # Defaults to 50MB.
20
- # will be constructed from the given `options' hash.
21
- # @option [Integer] :thread_count (10) Number of concurrent threads to
22
- # use for copying parts.
18
+ # @option options [Integer] :min_part_size (52428800)
19
+ # Size of copied parts. Defaults to 50MB.
20
+ # @option options [Integer] :thread_count (10) Number of concurrent
21
+ # threads to use for copying parts.
22
+ # @option options [Boolean] :use_source_parts (false) Use part sizes
23
+ # defined on the source object if any exist. If copying or moving an
24
+ # object that is already multipart, this does not re-part the object,
25
+ # instead re-using the part definitions on the original. That means
26
+ # the etag and any checksums will not change. This is especially
27
+ # useful if the source object has parts with varied sizes.
23
28
  def initialize(options = {})
29
+ @use_source_parts = options.delete(:use_source_parts) || false
24
30
  @thread_count = options.delete(:thread_count) || 10
25
31
  @min_part_size = options.delete(:min_part_size) || (FIVE_MB * 10)
26
32
  @client = options[:client] || Client.new
27
- if options[:checksum_algorithm]
28
- raise ArgumentError, 'Multipart Copy does not support setting :checksum_algorithm'
29
- end
30
33
  end
31
34
 
32
35
  # @return [Client]
@@ -78,10 +81,9 @@ module Aws
78
81
  end
79
82
 
80
83
  def copy_part(part)
81
- {
82
- etag: @client.upload_part_copy(part).copy_part_result.etag,
83
- part_number: part[:part_number],
84
- }
84
+ @client.upload_part_copy(part).copy_part_result.to_h.merge({
85
+ part_number: part[:part_number]
86
+ }).tap { |result| result.delete(:last_modified) }
85
87
  end
86
88
 
87
89
  def complete_upload(parts, options)
@@ -104,24 +106,37 @@ module Aws
104
106
  parts = []
105
107
  options = options_for(:upload_part_copy, options)
106
108
  while offset < size
109
+ part_size = calculate_part_size(part_number, default_part_size, options)
107
110
  parts << options.merge({
108
111
  part_number: part_number,
109
- copy_source_range: byte_range(offset, default_part_size, size),
112
+ copy_source_range: byte_range(offset, part_size, size),
110
113
  })
111
114
  part_number += 1
112
- offset += default_part_size
115
+ offset += part_size
113
116
  end
114
117
  parts
115
118
  end
116
119
 
117
- def byte_range(offset, default_part_size, size)
118
- if offset + default_part_size < size
119
- "bytes=#{offset}-#{offset + default_part_size - 1}"
120
+ def byte_range(offset, part_size, size)
121
+ if offset + part_size < size
122
+ "bytes=#{offset}-#{offset + part_size - 1}"
120
123
  else
121
124
  "bytes=#{offset}-#{size - 1}"
122
125
  end
123
126
  end
124
127
 
128
+ def calculate_part_size(part_number, default_part_size, options)
129
+ if @use_source_parts && source_has_parts(options)
130
+ source_metadata(options.merge({ part_number: part_number }))[:content_length]
131
+ else
132
+ default_part_size
133
+ end
134
+ end
135
+
136
+ def source_has_parts(options)
137
+ @source_has_parts ||= source_metadata(options.merge({ part_number: 1 }))[:parts_count]
138
+ end
139
+
125
140
  def source_metadata(options)
126
141
  if options[:content_length]
127
142
  return { content_length: options.delete(:content_length) }
@@ -138,6 +153,7 @@ module Aws
138
153
  key = CGI.unescape(key)
139
154
  opts = { bucket: bucket, key: key }
140
155
  opts[:version_id] = version_id if version_id
156
+ opts[:part_number] = options[:part_number] if options[:part_number]
141
157
  client.head_object(opts).to_h
142
158
  end
143
159
 
@@ -41,7 +41,7 @@ module Aws::S3
41
41
  # acl: "private", # accepts private, public-read, public-read-write, authenticated-read
42
42
  # bucket: "BucketName", # required
43
43
  # create_bucket_configuration: {
44
- # location_constraint: "af-south-1", # accepts af-south-1, ap-east-1, ap-northeast-1, ap-northeast-2, ap-northeast-3, ap-south-1, ap-southeast-1, ap-southeast-2, ap-southeast-3, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-north-1, eu-south-1, eu-west-1, eu-west-2, eu-west-3, me-south-1, sa-east-1, us-east-2, us-gov-east-1, us-gov-west-1, us-west-1, us-west-2
44
+ # location_constraint: "af-south-1", # accepts af-south-1, ap-east-1, ap-northeast-1, ap-northeast-2, ap-northeast-3, ap-south-1, ap-southeast-1, ap-southeast-2, ap-southeast-3, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-north-1, eu-south-1, eu-west-1, eu-west-2, eu-west-3, me-south-1, sa-east-1, us-east-2, us-gov-east-1, us-gov-west-1, us-west-1, us-west-2, ap-south-2, eu-south-2
45
45
  # },
46
46
  # grant_full_control: "GrantFullControl",
47
47
  # grant_read: "GrantRead",
data/lib/aws-sdk-s3.rb CHANGED
@@ -73,6 +73,6 @@ require_relative 'aws-sdk-s3/event_streams'
73
73
  # @!group service
74
74
  module Aws::S3
75
75
 
76
- GEM_VERSION = '1.129.0'
76
+ GEM_VERSION = '1.130.0'
77
77
 
78
78
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.129.0
4
+ version: 1.130.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-11 00:00:00.000000000 Z
11
+ date: 2023-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-kms