aws-sdk-s3 1.157.0 → 1.162.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.
@@ -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
@@ -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 `ChecksumMode` and the object is encrypted
2948
- # with Amazon Web Services Key Management Service (Amazon Web Services
2949
- # KMS), you must have permission to use the `kms:Decrypt` action for the
2950
- # request to succeed.
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 `ChecksumMode` and the object is encrypted
705
- # with Amazon Web Services Key Management Service (Amazon Web Services
706
- # KMS), you must have permission to use the `kms:Decrypt` action for the
707
- # request to succeed.
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(
@@ -46,11 +46,20 @@ module Aws::S3
46
46
  context[:auth_scheme] =
47
47
  Aws::Endpoints.resolve_auth_scheme(context, endpoint)
48
48
 
49
- @handler.call(context)
49
+ with_metrics(context) { @handler.call(context) }
50
50
  end
51
51
 
52
52
  private
53
53
 
54
+ def with_metrics(context, &block)
55
+ metrics = []
56
+ metrics << 'ENDPOINT_OVERRIDE' unless context.config.regional_endpoint
57
+ if context[:auth_scheme] && context[:auth_scheme]['name'] == 'sigv4a'
58
+ metrics << 'SIGV4A_SIGNING'
59
+ end
60
+ Aws::Plugins::UserAgent.metric(*metrics, &block)
61
+ end
62
+
54
63
  def apply_endpoint_headers(context, headers)
55
64
  headers.each do |key, values|
56
65
  value = values
@@ -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.data.buckets.each do |b|
201
- batch << Bucket.new(
202
- name: b.name,
203
- data: b,
204
- client: @client
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