aws-sdk-s3 1.157.0 → 1.159.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-s3/bucket.rb +79 -16
- data/lib/aws-sdk-s3/client.rb +541 -312
- data/lib/aws-sdk-s3/client_api.rb +16 -1
- data/lib/aws-sdk-s3/multipart_upload.rb +20 -0
- data/lib/aws-sdk-s3/object.rb +36 -4
- data/lib/aws-sdk-s3/object_summary.rb +28 -0
- data/lib/aws-sdk-s3/object_version.rb +17 -4
- data/lib/aws-sdk-s3/resource.rb +10 -8
- data/lib/aws-sdk-s3/types.rb +294 -47
- data/lib/aws-sdk-s3.rb +1 -1
- data/sig/bucket.rbs +1 -0
- data/sig/client.rbs +7 -1
- data/sig/multipart_upload.rbs +1 -0
- data/sig/object.rbs +1 -0
- data/sig/object_summary.rbs +1 -0
- data/sig/resource.rbs +2 -1
- data/sig/types.rbs +9 -0
- metadata +2 -2
@@ -334,6 +334,7 @@ module Aws::S3
|
|
334
334
|
ListBucketMetricsConfigurationsOutput = Shapes::StructureShape.new(name: 'ListBucketMetricsConfigurationsOutput')
|
335
335
|
ListBucketMetricsConfigurationsRequest = Shapes::StructureShape.new(name: 'ListBucketMetricsConfigurationsRequest')
|
336
336
|
ListBucketsOutput = Shapes::StructureShape.new(name: 'ListBucketsOutput')
|
337
|
+
ListBucketsRequest = Shapes::StructureShape.new(name: 'ListBucketsRequest')
|
337
338
|
ListDirectoryBucketsOutput = Shapes::StructureShape.new(name: 'ListDirectoryBucketsOutput')
|
338
339
|
ListDirectoryBucketsRequest = Shapes::StructureShape.new(name: 'ListDirectoryBucketsRequest')
|
339
340
|
ListMultipartUploadsOutput = Shapes::StructureShape.new(name: 'ListMultipartUploadsOutput')
|
@@ -357,6 +358,7 @@ module Aws::S3
|
|
357
358
|
MFADeleteStatus = Shapes::StringShape.new(name: 'MFADeleteStatus')
|
358
359
|
Marker = Shapes::StringShape.new(name: 'Marker')
|
359
360
|
MaxAgeSeconds = Shapes::IntegerShape.new(name: 'MaxAgeSeconds')
|
361
|
+
MaxBuckets = Shapes::IntegerShape.new(name: 'MaxBuckets')
|
360
362
|
MaxDirectoryBuckets = Shapes::IntegerShape.new(name: 'MaxDirectoryBuckets')
|
361
363
|
MaxKeys = Shapes::IntegerShape.new(name: 'MaxKeys')
|
362
364
|
MaxParts = Shapes::IntegerShape.new(name: 'MaxParts')
|
@@ -768,6 +770,7 @@ module Aws::S3
|
|
768
770
|
CompleteMultipartUploadRequest.add_member(:checksum_sha256, Shapes::ShapeRef.new(shape: ChecksumSHA256, location: "header", location_name: "x-amz-checksum-sha256"))
|
769
771
|
CompleteMultipartUploadRequest.add_member(:request_payer, Shapes::ShapeRef.new(shape: RequestPayer, location: "header", location_name: "x-amz-request-payer"))
|
770
772
|
CompleteMultipartUploadRequest.add_member(:expected_bucket_owner, Shapes::ShapeRef.new(shape: AccountId, location: "header", location_name: "x-amz-expected-bucket-owner"))
|
773
|
+
CompleteMultipartUploadRequest.add_member(:if_none_match, Shapes::ShapeRef.new(shape: IfNoneMatch, location: "header", location_name: "If-None-Match"))
|
771
774
|
CompleteMultipartUploadRequest.add_member(:sse_customer_algorithm, Shapes::ShapeRef.new(shape: SSECustomerAlgorithm, location: "header", location_name: "x-amz-server-side-encryption-customer-algorithm"))
|
772
775
|
CompleteMultipartUploadRequest.add_member(:sse_customer_key, Shapes::ShapeRef.new(shape: SSECustomerKey, location: "header", location_name: "x-amz-server-side-encryption-customer-key"))
|
773
776
|
CompleteMultipartUploadRequest.add_member(:sse_customer_key_md5, Shapes::ShapeRef.new(shape: SSECustomerKeyMD5, location: "header", location_name: "x-amz-server-side-encryption-customer-key-MD5"))
|
@@ -1707,8 +1710,13 @@ module Aws::S3
|
|
1707
1710
|
|
1708
1711
|
ListBucketsOutput.add_member(:buckets, Shapes::ShapeRef.new(shape: Buckets, location_name: "Buckets"))
|
1709
1712
|
ListBucketsOutput.add_member(:owner, Shapes::ShapeRef.new(shape: Owner, location_name: "Owner"))
|
1713
|
+
ListBucketsOutput.add_member(:continuation_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "ContinuationToken"))
|
1710
1714
|
ListBucketsOutput.struct_class = Types::ListBucketsOutput
|
1711
1715
|
|
1716
|
+
ListBucketsRequest.add_member(:max_buckets, Shapes::ShapeRef.new(shape: MaxBuckets, location: "querystring", location_name: "max-buckets"))
|
1717
|
+
ListBucketsRequest.add_member(:continuation_token, Shapes::ShapeRef.new(shape: Token, location: "querystring", location_name: "continuation-token"))
|
1718
|
+
ListBucketsRequest.struct_class = Types::ListBucketsRequest
|
1719
|
+
|
1712
1720
|
ListDirectoryBucketsOutput.add_member(:buckets, Shapes::ShapeRef.new(shape: Buckets, location_name: "Buckets"))
|
1713
1721
|
ListDirectoryBucketsOutput.add_member(:continuation_token, Shapes::ShapeRef.new(shape: DirectoryBucketToken, location_name: "ContinuationToken"))
|
1714
1722
|
ListDirectoryBucketsOutput.struct_class = Types::ListDirectoryBucketsOutput
|
@@ -2311,6 +2319,7 @@ module Aws::S3
|
|
2311
2319
|
PutObjectRequest.add_member(:checksum_sha1, Shapes::ShapeRef.new(shape: ChecksumSHA1, location: "header", location_name: "x-amz-checksum-sha1"))
|
2312
2320
|
PutObjectRequest.add_member(:checksum_sha256, Shapes::ShapeRef.new(shape: ChecksumSHA256, location: "header", location_name: "x-amz-checksum-sha256"))
|
2313
2321
|
PutObjectRequest.add_member(:expires, Shapes::ShapeRef.new(shape: Expires, location: "header", location_name: "Expires"))
|
2322
|
+
PutObjectRequest.add_member(:if_none_match, Shapes::ShapeRef.new(shape: IfNoneMatch, location: "header", location_name: "If-None-Match"))
|
2314
2323
|
PutObjectRequest.add_member(:grant_full_control, Shapes::ShapeRef.new(shape: GrantFullControl, location: "header", location_name: "x-amz-grant-full-control"))
|
2315
2324
|
PutObjectRequest.add_member(:grant_read, Shapes::ShapeRef.new(shape: GrantRead, location: "header", location_name: "x-amz-grant-read"))
|
2316
2325
|
PutObjectRequest.add_member(:grant_read_acp, Shapes::ShapeRef.new(shape: GrantReadACP, location: "header", location_name: "x-amz-grant-read-acp"))
|
@@ -3291,8 +3300,14 @@ module Aws::S3
|
|
3291
3300
|
o.name = "ListBuckets"
|
3292
3301
|
o.http_method = "GET"
|
3293
3302
|
o.http_request_uri = "/"
|
3294
|
-
o.input = Shapes::ShapeRef.new(shape:
|
3303
|
+
o.input = Shapes::ShapeRef.new(shape: ListBucketsRequest)
|
3295
3304
|
o.output = Shapes::ShapeRef.new(shape: ListBucketsOutput)
|
3305
|
+
o[:pager] = Aws::Pager.new(
|
3306
|
+
limit_key: "max_buckets",
|
3307
|
+
tokens: {
|
3308
|
+
"continuation_token" => "continuation_token"
|
3309
|
+
}
|
3310
|
+
)
|
3296
3311
|
end)
|
3297
3312
|
|
3298
3313
|
api.add_operation(:list_directory_buckets, Seahorse::Model::Operation.new.tap do |o|
|
@@ -295,6 +295,7 @@ module Aws::S3
|
|
295
295
|
# checksum_sha256: "ChecksumSHA256",
|
296
296
|
# request_payer: "requester", # accepts requester
|
297
297
|
# expected_bucket_owner: "AccountId",
|
298
|
+
# if_none_match: "IfNoneMatch",
|
298
299
|
# sse_customer_algorithm: "SSECustomerAlgorithm",
|
299
300
|
# sse_customer_key: "SSECustomerKey",
|
300
301
|
# sse_customer_key_md5: "SSECustomerKeyMD5",
|
@@ -362,6 +363,25 @@ module Aws::S3
|
|
362
363
|
# The account ID of the expected bucket owner. If the account ID that
|
363
364
|
# you provide does not match the actual owner of the bucket, the request
|
364
365
|
# fails with the HTTP status code `403 Forbidden` (access denied).
|
366
|
+
# @option options [String] :if_none_match
|
367
|
+
# Uploads the object only if the object key name does not already exist
|
368
|
+
# in the bucket specified. Otherwise, Amazon S3 returns a `412
|
369
|
+
# Precondition Failed` error.
|
370
|
+
#
|
371
|
+
# If a conflicting operation occurs during the upload S3 returns a `409
|
372
|
+
# ConditionalRequestConflict` response. On a 409 failure you should
|
373
|
+
# re-initiate the multipart upload with `CreateMultipartUpload` and
|
374
|
+
# re-upload each part.
|
375
|
+
#
|
376
|
+
# Expects the '*' (asterisk) character.
|
377
|
+
#
|
378
|
+
# For more information about conditional requests, see [RFC 7232][1], or
|
379
|
+
# [Conditional requests][2] in the *Amazon S3 User Guide*.
|
380
|
+
#
|
381
|
+
#
|
382
|
+
#
|
383
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
384
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html
|
365
385
|
# @option options [String] :sse_customer_algorithm
|
366
386
|
# The server-side encryption (SSE) algorithm used to encrypt the object.
|
367
387
|
# This parameter is required only when the object was created using a
|
data/lib/aws-sdk-s3/object.rb
CHANGED
@@ -1662,6 +1662,15 @@ module Aws::S3
|
|
1662
1662
|
# fails with the HTTP status code `403 Forbidden` (access denied).
|
1663
1663
|
# @option options [String] :checksum_mode
|
1664
1664
|
# To retrieve the checksum, this mode must be enabled.
|
1665
|
+
#
|
1666
|
+
# In addition, if you enable checksum mode and the object is uploaded
|
1667
|
+
# with a [checksum][1] and encrypted with an Key Management Service
|
1668
|
+
# (KMS) key, you must have permission to use the `kms:Decrypt` action to
|
1669
|
+
# retrieve the checksum.
|
1670
|
+
#
|
1671
|
+
#
|
1672
|
+
#
|
1673
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html
|
1665
1674
|
# @return [Types::GetObjectOutput]
|
1666
1675
|
def get(options = {}, &block)
|
1667
1676
|
options = options.merge(
|
@@ -2182,6 +2191,7 @@ module Aws::S3
|
|
2182
2191
|
# checksum_sha1: "ChecksumSHA1",
|
2183
2192
|
# checksum_sha256: "ChecksumSHA256",
|
2184
2193
|
# expires: Time.now,
|
2194
|
+
# if_none_match: "IfNoneMatch",
|
2185
2195
|
# grant_full_control: "GrantFullControl",
|
2186
2196
|
# grant_read: "GrantRead",
|
2187
2197
|
# grant_read_acp: "GrantReadACP",
|
@@ -2396,6 +2406,24 @@ module Aws::S3
|
|
2396
2406
|
#
|
2397
2407
|
#
|
2398
2408
|
# [1]: https://www.rfc-editor.org/rfc/rfc7234#section-5.3
|
2409
|
+
# @option options [String] :if_none_match
|
2410
|
+
# Uploads the object only if the object key name does not already exist
|
2411
|
+
# in the bucket specified. Otherwise, Amazon S3 returns a `412
|
2412
|
+
# Precondition Failed` error.
|
2413
|
+
#
|
2414
|
+
# If a conflicting operation occurs during the upload S3 returns a `409
|
2415
|
+
# ConditionalRequestConflict` response. On a 409 failure you should
|
2416
|
+
# retry the upload.
|
2417
|
+
#
|
2418
|
+
# Expects the '*' (asterisk) character.
|
2419
|
+
#
|
2420
|
+
# For more information about conditional requests, see [RFC 7232][1], or
|
2421
|
+
# [Conditional requests][2] in the *Amazon S3 User Guide*.
|
2422
|
+
#
|
2423
|
+
#
|
2424
|
+
#
|
2425
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
2426
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html
|
2399
2427
|
# @option options [String] :grant_full_control
|
2400
2428
|
# Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
|
2401
2429
|
# object.
|
@@ -2944,10 +2972,14 @@ module Aws::S3
|
|
2944
2972
|
# @option options [String] :checksum_mode
|
2945
2973
|
# To retrieve the checksum, this parameter must be enabled.
|
2946
2974
|
#
|
2947
|
-
# In addition, if you enable
|
2948
|
-
# with
|
2949
|
-
# KMS), you must have permission to use the `kms:Decrypt` action
|
2950
|
-
#
|
2975
|
+
# In addition, if you enable checksum mode and the object is uploaded
|
2976
|
+
# with a [checksum][1] and encrypted with an Key Management Service
|
2977
|
+
# (KMS) key, you must have permission to use the `kms:Decrypt` action to
|
2978
|
+
# retrieve the checksum.
|
2979
|
+
#
|
2980
|
+
#
|
2981
|
+
#
|
2982
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html
|
2951
2983
|
# @return [Types::HeadObjectOutput]
|
2952
2984
|
def head(options = {})
|
2953
2985
|
options = options.merge(
|
@@ -1298,6 +1298,15 @@ module Aws::S3
|
|
1298
1298
|
# fails with the HTTP status code `403 Forbidden` (access denied).
|
1299
1299
|
# @option options [String] :checksum_mode
|
1300
1300
|
# To retrieve the checksum, this mode must be enabled.
|
1301
|
+
#
|
1302
|
+
# In addition, if you enable checksum mode and the object is uploaded
|
1303
|
+
# with a [checksum][1] and encrypted with an Key Management Service
|
1304
|
+
# (KMS) key, you must have permission to use the `kms:Decrypt` action to
|
1305
|
+
# retrieve the checksum.
|
1306
|
+
#
|
1307
|
+
#
|
1308
|
+
#
|
1309
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html
|
1301
1310
|
# @return [Types::GetObjectOutput]
|
1302
1311
|
def get(options = {}, &block)
|
1303
1312
|
options = options.merge(
|
@@ -1818,6 +1827,7 @@ module Aws::S3
|
|
1818
1827
|
# checksum_sha1: "ChecksumSHA1",
|
1819
1828
|
# checksum_sha256: "ChecksumSHA256",
|
1820
1829
|
# expires: Time.now,
|
1830
|
+
# if_none_match: "IfNoneMatch",
|
1821
1831
|
# grant_full_control: "GrantFullControl",
|
1822
1832
|
# grant_read: "GrantRead",
|
1823
1833
|
# grant_read_acp: "GrantReadACP",
|
@@ -2032,6 +2042,24 @@ module Aws::S3
|
|
2032
2042
|
#
|
2033
2043
|
#
|
2034
2044
|
# [1]: https://www.rfc-editor.org/rfc/rfc7234#section-5.3
|
2045
|
+
# @option options [String] :if_none_match
|
2046
|
+
# Uploads the object only if the object key name does not already exist
|
2047
|
+
# in the bucket specified. Otherwise, Amazon S3 returns a `412
|
2048
|
+
# Precondition Failed` error.
|
2049
|
+
#
|
2050
|
+
# If a conflicting operation occurs during the upload S3 returns a `409
|
2051
|
+
# ConditionalRequestConflict` response. On a 409 failure you should
|
2052
|
+
# retry the upload.
|
2053
|
+
#
|
2054
|
+
# Expects the '*' (asterisk) character.
|
2055
|
+
#
|
2056
|
+
# For more information about conditional requests, see [RFC 7232][1], or
|
2057
|
+
# [Conditional requests][2] in the *Amazon S3 User Guide*.
|
2058
|
+
#
|
2059
|
+
#
|
2060
|
+
#
|
2061
|
+
# [1]: https://tools.ietf.org/html/rfc7232
|
2062
|
+
# [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/conditional-requests.html
|
2035
2063
|
# @option options [String] :grant_full_control
|
2036
2064
|
# Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
|
2037
2065
|
# object.
|
@@ -523,6 +523,15 @@ module Aws::S3
|
|
523
523
|
# fails with the HTTP status code `403 Forbidden` (access denied).
|
524
524
|
# @option options [String] :checksum_mode
|
525
525
|
# To retrieve the checksum, this mode must be enabled.
|
526
|
+
#
|
527
|
+
# In addition, if you enable checksum mode and the object is uploaded
|
528
|
+
# with a [checksum][1] and encrypted with an Key Management Service
|
529
|
+
# (KMS) key, you must have permission to use the `kms:Decrypt` action to
|
530
|
+
# retrieve the checksum.
|
531
|
+
#
|
532
|
+
#
|
533
|
+
#
|
534
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html
|
526
535
|
# @return [Types::GetObjectOutput]
|
527
536
|
def get(options = {}, &block)
|
528
537
|
options = options.merge(
|
@@ -701,10 +710,14 @@ module Aws::S3
|
|
701
710
|
# @option options [String] :checksum_mode
|
702
711
|
# To retrieve the checksum, this parameter must be enabled.
|
703
712
|
#
|
704
|
-
# In addition, if you enable
|
705
|
-
# with
|
706
|
-
# KMS), you must have permission to use the `kms:Decrypt` action
|
707
|
-
#
|
713
|
+
# In addition, if you enable checksum mode and the object is uploaded
|
714
|
+
# with a [checksum][1] and encrypted with an Key Management Service
|
715
|
+
# (KMS) key, you must have permission to use the `kms:Decrypt` action to
|
716
|
+
# retrieve the checksum.
|
717
|
+
#
|
718
|
+
#
|
719
|
+
#
|
720
|
+
# [1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html
|
708
721
|
# @return [Types::HeadObjectOutput]
|
709
722
|
def head(options = {})
|
710
723
|
options = options.merge(
|
data/lib/aws-sdk-s3/resource.rb
CHANGED
@@ -193,18 +193,20 @@ module Aws::S3
|
|
193
193
|
# @return [Bucket::Collection]
|
194
194
|
def buckets(options = {})
|
195
195
|
batches = Enumerator.new do |y|
|
196
|
-
batch = []
|
197
196
|
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
198
197
|
@client.list_buckets(options)
|
199
198
|
end
|
200
|
-
resp.
|
201
|
-
batch
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
199
|
+
resp.each_page do |page|
|
200
|
+
batch = []
|
201
|
+
page.data.buckets.each do |b|
|
202
|
+
batch << Bucket.new(
|
203
|
+
name: b.name,
|
204
|
+
data: b,
|
205
|
+
client: @client
|
206
|
+
)
|
207
|
+
end
|
208
|
+
y.yield(batch)
|
206
209
|
end
|
207
|
-
y.yield(batch)
|
208
210
|
end
|
209
211
|
Bucket::Collection.new(batches)
|
210
212
|
end
|