aws-sdk-s3 1.147.0 → 1.152.3

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +48 -2
  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 +241 -0
  6. data/lib/aws-sdk-s3/bucket.rb +10 -10
  7. data/lib/aws-sdk-s3/bucket_acl.rb +3 -3
  8. data/lib/aws-sdk-s3/bucket_cors.rb +4 -4
  9. data/lib/aws-sdk-s3/bucket_lifecycle.rb +4 -4
  10. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +4 -4
  11. data/lib/aws-sdk-s3/bucket_logging.rb +3 -3
  12. data/lib/aws-sdk-s3/bucket_notification.rb +3 -3
  13. data/lib/aws-sdk-s3/bucket_policy.rb +4 -4
  14. data/lib/aws-sdk-s3/bucket_region_cache.rb +9 -5
  15. data/lib/aws-sdk-s3/bucket_request_payment.rb +3 -3
  16. data/lib/aws-sdk-s3/bucket_tagging.rb +4 -4
  17. data/lib/aws-sdk-s3/bucket_versioning.rb +5 -5
  18. data/lib/aws-sdk-s3/bucket_website.rb +4 -4
  19. data/lib/aws-sdk-s3/client.rb +174 -138
  20. data/lib/aws-sdk-s3/client_api.rb +3 -2
  21. data/lib/aws-sdk-s3/customizations/bucket.rb +1 -1
  22. data/lib/aws-sdk-s3/customizations/errors.rb +15 -2
  23. data/lib/aws-sdk-s3/customizations/object.rb +5 -5
  24. data/lib/aws-sdk-s3/customizations.rb +4 -1
  25. data/lib/aws-sdk-s3/encryption/client.rb +2 -2
  26. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +2 -2
  27. data/lib/aws-sdk-s3/encryptionV2/client.rb +2 -2
  28. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +2 -2
  29. data/lib/aws-sdk-s3/endpoint_parameters.rb +8 -0
  30. data/lib/aws-sdk-s3/endpoint_provider.rb +1 -0
  31. data/lib/aws-sdk-s3/endpoints.rb +100 -1
  32. data/lib/aws-sdk-s3/express_credentials_provider.rb +27 -4
  33. data/lib/aws-sdk-s3/file_downloader.rb +1 -1
  34. data/lib/aws-sdk-s3/file_uploader.rb +1 -1
  35. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +1 -1
  36. data/lib/aws-sdk-s3/multipart_upload.rb +4 -4
  37. data/lib/aws-sdk-s3/multipart_upload_part.rb +3 -3
  38. data/lib/aws-sdk-s3/object.rb +12 -12
  39. data/lib/aws-sdk-s3/object_acl.rb +3 -3
  40. data/lib/aws-sdk-s3/object_copier.rb +1 -1
  41. data/lib/aws-sdk-s3/object_multipart_copier.rb +10 -8
  42. data/lib/aws-sdk-s3/object_summary.rb +10 -10
  43. data/lib/aws-sdk-s3/object_version.rb +5 -5
  44. data/lib/aws-sdk-s3/plugins/access_grants.rb +114 -0
  45. data/lib/aws-sdk-s3/plugins/express_session_auth.rb +8 -2
  46. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +53 -16
  47. data/lib/aws-sdk-s3/plugins/s3_signer.rb +7 -2
  48. data/lib/aws-sdk-s3/presigner.rb +1 -0
  49. data/lib/aws-sdk-s3/resource.rb +2 -2
  50. data/lib/aws-sdk-s3.rb +1 -1
  51. data/sig/client.rbs +2 -0
  52. data/sig/customizations/bucket.rbs +19 -0
  53. data/sig/customizations/object.rbs +38 -0
  54. data/sig/customizations/object_summary.rbs +35 -0
  55. data/sig/resource.rbs +2 -0
  56. metadata +10 -5
  57. data/lib/aws-sdk-s3/express_credentials_cache.rb +0 -30
@@ -22,6 +22,7 @@ require 'aws-sdk-core/plugins/endpoint_pattern.rb'
22
22
  require 'aws-sdk-core/plugins/response_paging.rb'
23
23
  require 'aws-sdk-core/plugins/stub_responses.rb'
24
24
  require 'aws-sdk-core/plugins/idempotency_token.rb'
25
+ require 'aws-sdk-core/plugins/invocation_id.rb'
25
26
  require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
26
27
  require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
27
28
  require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
@@ -34,6 +35,7 @@ require 'aws-sdk-core/plugins/recursion_detection.rb'
34
35
  require 'aws-sdk-core/plugins/sign.rb'
35
36
  require 'aws-sdk-core/plugins/protocols/rest_xml.rb'
36
37
  require 'aws-sdk-s3/plugins/accelerate.rb'
38
+ require 'aws-sdk-s3/plugins/access_grants.rb'
37
39
  require 'aws-sdk-s3/plugins/arn.rb'
38
40
  require 'aws-sdk-s3/plugins/bucket_dns.rb'
39
41
  require 'aws-sdk-s3/plugins/bucket_name_restrictions.rb'
@@ -92,6 +94,7 @@ module Aws::S3
92
94
  add_plugin(Aws::Plugins::ResponsePaging)
93
95
  add_plugin(Aws::Plugins::StubResponses)
94
96
  add_plugin(Aws::Plugins::IdempotencyToken)
97
+ add_plugin(Aws::Plugins::InvocationId)
95
98
  add_plugin(Aws::Plugins::JsonvalueConverter)
96
99
  add_plugin(Aws::Plugins::ClientMetricsPlugin)
97
100
  add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
@@ -104,6 +107,7 @@ module Aws::S3
104
107
  add_plugin(Aws::Plugins::Sign)
105
108
  add_plugin(Aws::Plugins::Protocols::RestXml)
106
109
  add_plugin(Aws::S3::Plugins::Accelerate)
110
+ add_plugin(Aws::S3::Plugins::AccessGrants)
107
111
  add_plugin(Aws::S3::Plugins::ARN)
108
112
  add_plugin(Aws::S3::Plugins::BucketDns)
109
113
  add_plugin(Aws::S3::Plugins::BucketNameRestrictions)
@@ -184,6 +188,16 @@ module Aws::S3
184
188
  # * `~/.aws/credentials`
185
189
  # * `~/.aws/config`
186
190
  #
191
+ # @option options [Boolean] :access_grants (false)
192
+ # When `true`, the S3 client will use the S3 Access Grants feature to
193
+ # authenticate requests. Bucket credentials will be fetched from S3
194
+ # Control using the `get_data_access` API.
195
+ #
196
+ # @option options [Aws::S3::AccessGrantsCredentialsProvider] :access_grants_credentials_provider
197
+ # When `access_grants` is `true`, this option can be used to provide
198
+ # additional options to the credentials provider, including a privilege
199
+ # setting, caching, and fallback behavior.
200
+ #
187
201
  # @option options [String] :access_key_id
188
202
  #
189
203
  # @option options [Boolean] :active_endpoint_cache (false)
@@ -246,10 +260,17 @@ module Aws::S3
246
260
  # @option options [Boolean] :disable_s3_express_session_auth
247
261
  # Parameter to indicate whether S3Express session auth should be disabled
248
262
  #
249
- # @option options [String] :endpoint
250
- # The client endpoint is normally constructed from the `:region`
251
- # option. You should only configure an `:endpoint` when connecting
252
- # to test or custom endpoints. This should be a valid HTTP(S) URI.
263
+ # @option options [String, URI::HTTPS, URI::HTTP] :endpoint
264
+ # Normally you should not configure the `:endpoint` option
265
+ # directly. This is normally constructed from the `:region`
266
+ # option. Configuring `:endpoint` is normally reserved for
267
+ # connecting to test or custom endpoints. The endpoint should
268
+ # be a URI formatted like:
269
+ #
270
+ # 'http://example.com'
271
+ # 'https://example.com'
272
+ # 'http://example.com:123'
273
+ #
253
274
  #
254
275
  # @option options [Integer] :endpoint_cache_max_entries (1000)
255
276
  # Used for the maximum size limit of the LRU cache storing endpoints data
@@ -382,8 +403,9 @@ module Aws::S3
382
403
  #
383
404
  # @option options [String] :sdk_ua_app_id
384
405
  # A unique and opaque application ID that is appended to the
385
- # User-Agent header as app/<sdk_ua_app_id>. It should have a
386
- # maximum length of 50.
406
+ # User-Agent header as app/sdk_ua_app_id. It should have a
407
+ # maximum length of 50. This variable is sourced from environment
408
+ # variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
387
409
  #
388
410
  # @option options [String] :secret_access_key
389
411
  #
@@ -432,50 +454,65 @@ module Aws::S3
432
454
  # @option options [Aws::S3::EndpointProvider] :endpoint_provider
433
455
  # The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::S3::EndpointParameters`
434
456
  #
435
- # @option options [URI::HTTP,String] :http_proxy A proxy to send
436
- # requests through. Formatted like 'http://proxy.com:123'.
437
- #
438
- # @option options [Float] :http_open_timeout (15) The number of
439
- # seconds to wait when opening a HTTP session before raising a
440
- # `Timeout::Error`.
441
- #
442
- # @option options [Float] :http_read_timeout (60) The default
443
- # number of seconds to wait for response data. This value can
444
- # safely be set per-request on the session.
445
- #
446
- # @option options [Float] :http_idle_timeout (5) The number of
447
- # seconds a connection is allowed to sit idle before it is
448
- # considered stale. Stale connections are closed and removed
449
- # from the pool before making a request.
450
- #
451
- # @option options [Float] :http_continue_timeout (1) The number of
452
- # seconds to wait for a 100-continue response before sending the
453
- # request body. This option has no effect unless the request has
454
- # "Expect" header set to "100-continue". Defaults to `nil` which
455
- # disables this behaviour. This value can safely be set per
456
- # request on the session.
457
- #
458
- # @option options [Float] :ssl_timeout (nil) Sets the SSL timeout
459
- # in seconds.
457
+ # @option options [Float] :http_continue_timeout (1)
458
+ # The number of seconds to wait for a 100-continue response before sending the
459
+ # request body. This option has no effect unless the request has "Expect"
460
+ # header set to "100-continue". Defaults to `nil` which disables this
461
+ # behaviour. This value can safely be set per request on the session.
462
+ #
463
+ # @option options [Float] :http_idle_timeout (5)
464
+ # The number of seconds a connection is allowed to sit idle before it
465
+ # is considered stale. Stale connections are closed and removed from the
466
+ # pool before making a request.
467
+ #
468
+ # @option options [Float] :http_open_timeout (15)
469
+ # The default number of seconds to wait for response data.
470
+ # This value can safely be set per-request on the session.
471
+ #
472
+ # @option options [URI::HTTP,String] :http_proxy
473
+ # A proxy to send requests through. Formatted like 'http://proxy.com:123'.
474
+ #
475
+ # @option options [Float] :http_read_timeout (60)
476
+ # The default number of seconds to wait for response data.
477
+ # This value can safely be set per-request on the session.
478
+ #
479
+ # @option options [Boolean] :http_wire_trace (false)
480
+ # When `true`, HTTP debug output will be sent to the `:logger`.
481
+ #
482
+ # @option options [Proc] :on_chunk_received
483
+ # When a Proc object is provided, it will be used as callback when each chunk
484
+ # of the response body is received. It provides three arguments: the chunk,
485
+ # the number of bytes received, and the total number of
486
+ # bytes in the response (or nil if the server did not send a `content-length`).
487
+ #
488
+ # @option options [Proc] :on_chunk_sent
489
+ # When a Proc object is provided, it will be used as callback when each chunk
490
+ # of the request body is sent. It provides three arguments: the chunk,
491
+ # the number of bytes read from the body, and the total number of
492
+ # bytes in the body.
493
+ #
494
+ # @option options [Boolean] :raise_response_errors (true)
495
+ # When `true`, response errors are raised.
496
+ #
497
+ # @option options [String] :ssl_ca_bundle
498
+ # Full path to the SSL certificate authority bundle file that should be used when
499
+ # verifying peer certificates. If you do not pass `:ssl_ca_bundle` or
500
+ # `:ssl_ca_directory` the the system default will be used if available.
501
+ #
502
+ # @option options [String] :ssl_ca_directory
503
+ # Full path of the directory that contains the unbundled SSL certificate
504
+ # authority files for verifying peer certificates. If you do
505
+ # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the system
506
+ # default will be used if available.
460
507
  #
461
- # @option options [Boolean] :http_wire_trace (false) When `true`,
462
- # HTTP debug output will be sent to the `:logger`.
508
+ # @option options [String] :ssl_ca_store
509
+ # Sets the X509::Store to verify peer certificate.
463
510
  #
464
- # @option options [Boolean] :ssl_verify_peer (true) When `true`,
465
- # SSL peer certificates are verified when establishing a
466
- # connection.
511
+ # @option options [Float] :ssl_timeout
512
+ # Sets the SSL timeout in seconds
467
513
  #
468
- # @option options [String] :ssl_ca_bundle Full path to the SSL
469
- # certificate authority bundle file that should be used when
470
- # verifying peer certificates. If you do not pass
471
- # `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
472
- # will be used if available.
473
- #
474
- # @option options [String] :ssl_ca_directory Full path of the
475
- # directory that contains the unbundled SSL certificate
476
- # authority files for verifying peer certificates. If you do
477
- # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
478
- # system default will be used if available.
514
+ # @option options [Boolean] :ssl_verify_peer (true)
515
+ # When `true`, SSL peer certificates are verified when establishing a connection.
479
516
  #
480
517
  def initialize(*args)
481
518
  super
@@ -4450,6 +4487,15 @@ module Aws::S3
4450
4487
  # * {Types::DeleteObjectOutput#request_charged #request_charged} => String
4451
4488
  #
4452
4489
  #
4490
+ # @example Example: To delete an object (from a non-versioned bucket)
4491
+ #
4492
+ # # The following example deletes an object from a non-versioned bucket.
4493
+ #
4494
+ # resp = client.delete_object({
4495
+ # bucket: "ExampleBucket",
4496
+ # key: "HappyFace.jpg",
4497
+ # })
4498
+ #
4453
4499
  # @example Example: To delete an object
4454
4500
  #
4455
4501
  # # The following example deletes an object from an S3 bucket.
@@ -4463,15 +4509,6 @@ module Aws::S3
4463
4509
  # {
4464
4510
  # }
4465
4511
  #
4466
- # @example Example: To delete an object (from a non-versioned bucket)
4467
- #
4468
- # # The following example deletes an object from a non-versioned bucket.
4469
- #
4470
- # resp = client.delete_object({
4471
- # bucket: "ExampleBucket",
4472
- # key: "HappyFace.jpg",
4473
- # })
4474
- #
4475
4512
  # @example Request syntax with placeholder values
4476
4513
  #
4477
4514
  # resp = client.delete_object({
@@ -8698,49 +8735,49 @@ module Aws::S3
8698
8735
  # * {Types::GetObjectTaggingOutput#tag_set #tag_set} => Array&lt;Types::Tag&gt;
8699
8736
  #
8700
8737
  #
8701
- # @example Example: To retrieve tag set of a specific object version
8738
+ # @example Example: To retrieve tag set of an object
8702
8739
  #
8703
- # # The following example retrieves tag set of an object. The request specifies object version.
8740
+ # # The following example retrieves tag set of an object.
8704
8741
  #
8705
8742
  # resp = client.get_object_tagging({
8706
8743
  # bucket: "examplebucket",
8707
- # key: "exampleobject",
8708
- # version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
8744
+ # key: "HappyFace.jpg",
8709
8745
  # })
8710
8746
  #
8711
8747
  # resp.to_h outputs the following:
8712
8748
  # {
8713
8749
  # tag_set: [
8714
8750
  # {
8715
- # key: "Key1",
8716
- # value: "Value1",
8751
+ # key: "Key4",
8752
+ # value: "Value4",
8753
+ # },
8754
+ # {
8755
+ # key: "Key3",
8756
+ # value: "Value3",
8717
8757
  # },
8718
8758
  # ],
8719
- # version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
8759
+ # version_id: "null",
8720
8760
  # }
8721
8761
  #
8722
- # @example Example: To retrieve tag set of an object
8762
+ # @example Example: To retrieve tag set of a specific object version
8723
8763
  #
8724
- # # The following example retrieves tag set of an object.
8764
+ # # The following example retrieves tag set of an object. The request specifies object version.
8725
8765
  #
8726
8766
  # resp = client.get_object_tagging({
8727
8767
  # bucket: "examplebucket",
8728
- # key: "HappyFace.jpg",
8768
+ # key: "exampleobject",
8769
+ # version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
8729
8770
  # })
8730
8771
  #
8731
8772
  # resp.to_h outputs the following:
8732
8773
  # {
8733
8774
  # tag_set: [
8734
8775
  # {
8735
- # key: "Key4",
8736
- # value: "Value4",
8737
- # },
8738
- # {
8739
- # key: "Key3",
8740
- # value: "Value3",
8776
+ # key: "Key1",
8777
+ # value: "Value1",
8741
8778
  # },
8742
8779
  # ],
8743
- # version_id: "null",
8780
+ # version_id: "ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI",
8744
8781
  # }
8745
8782
  #
8746
8783
  # @example Request syntax with placeholder values
@@ -15373,21 +15410,40 @@ module Aws::S3
15373
15410
  # * {Types::PutObjectOutput#request_charged #request_charged} => String
15374
15411
  #
15375
15412
  #
15376
- # @example Example: To upload an object
15413
+ # @example Example: To upload an object and specify server-side encryption and object tags
15377
15414
  #
15378
- # # The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file
15379
- # # syntax. S3 returns VersionId of the newly created object.
15415
+ # # The following example uploads an object. The request specifies the optional server-side encryption option. The request
15416
+ # # also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
15380
15417
  #
15381
15418
  # resp = client.put_object({
15382
- # body: "HappyFace.jpg",
15419
+ # body: "filetoupload",
15383
15420
  # bucket: "examplebucket",
15384
- # key: "HappyFace.jpg",
15421
+ # key: "exampleobject",
15422
+ # server_side_encryption: "AES256",
15423
+ # tagging: "key1=value1&key2=value2",
15385
15424
  # })
15386
15425
  #
15387
15426
  # resp.to_h outputs the following:
15388
15427
  # {
15389
15428
  # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
15390
- # version_id: "tpf3zF08nBplQK1XLOefGskR7mGDwcDk",
15429
+ # server_side_encryption: "AES256",
15430
+ # version_id: "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt",
15431
+ # }
15432
+ #
15433
+ # @example Example: To create an object.
15434
+ #
15435
+ # # The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
15436
+ #
15437
+ # resp = client.put_object({
15438
+ # body: "filetoupload",
15439
+ # bucket: "examplebucket",
15440
+ # key: "objectkey",
15441
+ # })
15442
+ #
15443
+ # resp.to_h outputs the following:
15444
+ # {
15445
+ # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
15446
+ # version_id: "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ",
15391
15447
  # }
15392
15448
  #
15393
15449
  # @example Example: To upload an object (specify optional headers)
@@ -15410,6 +15466,24 @@ module Aws::S3
15410
15466
  # version_id: "CG612hodqujkf8FaaNfp8U..FIhLROcp",
15411
15467
  # }
15412
15468
  #
15469
+ # @example Example: To upload an object and specify optional tags
15470
+ #
15471
+ # # The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore
15472
+ # # S3 returns version ID of the newly created object.
15473
+ #
15474
+ # resp = client.put_object({
15475
+ # body: "c:\\HappyFace.jpg",
15476
+ # bucket: "examplebucket",
15477
+ # key: "HappyFace.jpg",
15478
+ # tagging: "key1=value1&key2=value2",
15479
+ # })
15480
+ #
15481
+ # resp.to_h outputs the following:
15482
+ # {
15483
+ # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
15484
+ # version_id: "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a",
15485
+ # }
15486
+ #
15413
15487
  # @example Example: To upload object and specify user-defined metadata
15414
15488
  #
15415
15489
  # # The following example creates an object. The request also specifies optional metadata. If the bucket is versioning
@@ -15449,58 +15523,21 @@ module Aws::S3
15449
15523
  # version_id: "Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr",
15450
15524
  # }
15451
15525
  #
15452
- # @example Example: To create an object.
15453
- #
15454
- # # The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response.
15455
- #
15456
- # resp = client.put_object({
15457
- # body: "filetoupload",
15458
- # bucket: "examplebucket",
15459
- # key: "objectkey",
15460
- # })
15461
- #
15462
- # resp.to_h outputs the following:
15463
- # {
15464
- # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
15465
- # version_id: "Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ",
15466
- # }
15467
- #
15468
- # @example Example: To upload an object and specify server-side encryption and object tags
15469
- #
15470
- # # The following example uploads an object. The request specifies the optional server-side encryption option. The request
15471
- # # also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response.
15472
- #
15473
- # resp = client.put_object({
15474
- # body: "filetoupload",
15475
- # bucket: "examplebucket",
15476
- # key: "exampleobject",
15477
- # server_side_encryption: "AES256",
15478
- # tagging: "key1=value1&key2=value2",
15479
- # })
15480
- #
15481
- # resp.to_h outputs the following:
15482
- # {
15483
- # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
15484
- # server_side_encryption: "AES256",
15485
- # version_id: "Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt",
15486
- # }
15487
- #
15488
- # @example Example: To upload an object and specify optional tags
15526
+ # @example Example: To upload an object
15489
15527
  #
15490
- # # The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore
15491
- # # S3 returns version ID of the newly created object.
15528
+ # # The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file
15529
+ # # syntax. S3 returns VersionId of the newly created object.
15492
15530
  #
15493
15531
  # resp = client.put_object({
15494
- # body: "c:\\HappyFace.jpg",
15532
+ # body: "HappyFace.jpg",
15495
15533
  # bucket: "examplebucket",
15496
15534
  # key: "HappyFace.jpg",
15497
- # tagging: "key1=value1&key2=value2",
15498
15535
  # })
15499
15536
  #
15500
15537
  # resp.to_h outputs the following:
15501
15538
  # {
15502
15539
  # etag: "\"6805f2cfc46c0f04559748bb039d69ae\"",
15503
- # version_id: "psM2sYY4.o1501dSx8wMvnkOzSBB.V4a",
15540
+ # version_id: "tpf3zF08nBplQK1XLOefGskR7mGDwcDk",
15504
15541
  # }
15505
15542
  #
15506
15543
  # @example Streaming a file from disk
@@ -17206,22 +17243,22 @@ module Aws::S3
17206
17243
  #
17207
17244
  # @example EventStream Operation Example
17208
17245
  #
17209
- # You can process event once it arrives immediately, or wait until
17210
- # full response complete and iterate through eventstream enumerator.
17246
+ # You can process the event once it arrives immediately, or wait until the
17247
+ # full response is complete and iterate through the eventstream enumerator.
17211
17248
  #
17212
17249
  # To interact with event immediately, you need to register #select_object_content
17213
- # with callbacks, callbacks can be register for specifc events or for all events,
17214
- # callback for errors in the event stream is also available for register.
17250
+ # with callbacks. Callbacks can be registered for specific events or for all
17251
+ # events, including error events.
17215
17252
  #
17216
- # Callbacks can be passed in by `:event_stream_handler` option or within block
17217
- # statement attached to #select_object_content call directly. Hybrid pattern of both
17218
- # is also supported.
17253
+ # Callbacks can be passed into the `:event_stream_handler` option or within a
17254
+ # block statement attached to the #select_object_content call directly. Hybrid
17255
+ # pattern of both is also supported.
17219
17256
  #
17220
- # `:event_stream_handler` option takes in either Proc object or
17257
+ # `:event_stream_handler` option takes in either a Proc object or
17221
17258
  # Aws::S3::EventStreams::SelectObjectContentEventStream object.
17222
17259
  #
17223
- # Usage pattern a): callbacks with a block attached to #select_object_content
17224
- # Example for registering callbacks for all event types and error event
17260
+ # Usage pattern a): Callbacks with a block attached to #select_object_content
17261
+ # Example for registering callbacks for all event types and an error event
17225
17262
  #
17226
17263
  # client.select_object_content( # params input# ) do |stream|
17227
17264
  # stream.on_error_event do |event|
@@ -17241,9 +17278,9 @@ module Aws::S3
17241
17278
  #
17242
17279
  # end
17243
17280
  #
17244
- # Usage pattern b): pass in `:event_stream_handler` for #select_object_content
17281
+ # Usage pattern b): Pass in `:event_stream_handler` for #select_object_content
17245
17282
  #
17246
- # 1) create a Aws::S3::EventStreams::SelectObjectContentEventStream object
17283
+ # 1) Create a Aws::S3::EventStreams::SelectObjectContentEventStream object
17247
17284
  # Example for registering callbacks with specific events
17248
17285
  #
17249
17286
  # handler = Aws::S3::EventStreams::SelectObjectContentEventStream.new
@@ -17265,7 +17302,7 @@ module Aws::S3
17265
17302
  #
17266
17303
  # client.select_object_content( # params input #, event_stream_handler: handler)
17267
17304
  #
17268
- # 2) use a Ruby Proc object
17305
+ # 2) Use a Ruby Proc object
17269
17306
  # Example for registering callbacks with specific events
17270
17307
  #
17271
17308
  # handler = Proc.new do |stream|
@@ -17288,7 +17325,7 @@ module Aws::S3
17288
17325
  #
17289
17326
  # client.select_object_content( # params input #, event_stream_handler: handler)
17290
17327
  #
17291
- # Usage pattern c): hybird pattern of a) and b)
17328
+ # Usage pattern c): Hybrid pattern of a) and b)
17292
17329
  #
17293
17330
  # handler = Aws::S3::EventStreams::SelectObjectContentEventStream.new
17294
17331
  # handler.on_records_event do |event|
@@ -17318,8 +17355,7 @@ module Aws::S3
17318
17355
  # end
17319
17356
  # end
17320
17357
  #
17321
- # Besides above usage patterns for process events when they arrive immediately, you can also
17322
- # iterate through events after response complete.
17358
+ # You can also iterate through events after the response complete.
17323
17359
  #
17324
17360
  # Events are available at resp.payload # => Enumerator
17325
17361
  # For parameter input example, please refer to following request syntax
@@ -18792,7 +18828,7 @@ module Aws::S3
18792
18828
  params: params,
18793
18829
  config: config)
18794
18830
  context[:gem_name] = 'aws-sdk-s3'
18795
- context[:gem_version] = '1.147.0'
18831
+ context[:gem_version] = '1.152.3'
18796
18832
  Seahorse::Client::Request.new(handlers, context)
18797
18833
  end
18798
18834
 
@@ -817,7 +817,7 @@ module Aws::S3
817
817
  CopyObjectRequest.add_member(:content_encoding, Shapes::ShapeRef.new(shape: ContentEncoding, location: "header", location_name: "Content-Encoding"))
818
818
  CopyObjectRequest.add_member(:content_language, Shapes::ShapeRef.new(shape: ContentLanguage, location: "header", location_name: "Content-Language"))
819
819
  CopyObjectRequest.add_member(:content_type, Shapes::ShapeRef.new(shape: ContentType, location: "header", location_name: "Content-Type"))
820
- CopyObjectRequest.add_member(:copy_source, Shapes::ShapeRef.new(shape: CopySource, required: true, location: "header", location_name: "x-amz-copy-source"))
820
+ CopyObjectRequest.add_member(:copy_source, Shapes::ShapeRef.new(shape: CopySource, required: true, location: "header", location_name: "x-amz-copy-source", metadata: {"contextParam"=>{"name"=>"CopySource"}}))
821
821
  CopyObjectRequest.add_member(:copy_source_if_match, Shapes::ShapeRef.new(shape: CopySourceIfMatch, location: "header", location_name: "x-amz-copy-source-if-match"))
822
822
  CopyObjectRequest.add_member(:copy_source_if_modified_since, Shapes::ShapeRef.new(shape: CopySourceIfModifiedSince, location: "header", location_name: "x-amz-copy-source-if-modified-since"))
823
823
  CopyObjectRequest.add_member(:copy_source_if_none_match, Shapes::ShapeRef.new(shape: CopySourceIfNoneMatch, location: "header", location_name: "x-amz-copy-source-if-none-match"))
@@ -827,7 +827,7 @@ module Aws::S3
827
827
  CopyObjectRequest.add_member(:grant_read, Shapes::ShapeRef.new(shape: GrantRead, location: "header", location_name: "x-amz-grant-read"))
828
828
  CopyObjectRequest.add_member(:grant_read_acp, Shapes::ShapeRef.new(shape: GrantReadACP, location: "header", location_name: "x-amz-grant-read-acp"))
829
829
  CopyObjectRequest.add_member(:grant_write_acp, Shapes::ShapeRef.new(shape: GrantWriteACP, location: "header", location_name: "x-amz-grant-write-acp"))
830
- CopyObjectRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key"))
830
+ CopyObjectRequest.add_member(:key, Shapes::ShapeRef.new(shape: ObjectKey, required: true, location: "uri", location_name: "Key", metadata: {"contextParam"=>{"name"=>"Key"}}))
831
831
  CopyObjectRequest.add_member(:metadata, Shapes::ShapeRef.new(shape: Metadata, location: "headers", location_name: "x-amz-meta-"))
832
832
  CopyObjectRequest.add_member(:metadata_directive, Shapes::ShapeRef.new(shape: MetadataDirective, location: "header", location_name: "x-amz-metadata-directive"))
833
833
  CopyObjectRequest.add_member(:tagging_directive, Shapes::ShapeRef.new(shape: TaggingDirective, location: "header", location_name: "x-amz-tagging-directive"))
@@ -2764,6 +2764,7 @@ module Aws::S3
2764
2764
  "endpointPrefix" => "s3",
2765
2765
  "globalEndpoint" => "s3.amazonaws.com",
2766
2766
  "protocol" => "rest-xml",
2767
+ "protocols" => ["rest-xml"],
2767
2768
  "serviceAbbreviation" => "Amazon S3",
2768
2769
  "serviceFullName" => "Amazon Simple Storage Service",
2769
2770
  "serviceId" => "S3",
@@ -134,7 +134,7 @@ module Aws
134
134
 
135
135
  # @api private
136
136
  def load
137
- @data = Aws::Plugins::UserAgent.feature('resource') do
137
+ @data = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
138
138
  client.list_buckets.buckets.find { |b| b.name == name }
139
139
  end
140
140
  raise "unable to load bucket #{name}" if @data.nil?
@@ -3,8 +3,8 @@
3
3
  module Aws
4
4
  module S3
5
5
  module Errors
6
- # Hijack PermanentRedirect dynamic error to also include endpoint
7
- # and bucket.
6
+ # Hijack PermanentRedirect dynamic error to include the bucket, region,
7
+ # and endpoint.
8
8
  class PermanentRedirect < ServiceError
9
9
  # @param [Seahorse::Client::RequestContext] context
10
10
  # @param [String] message
@@ -22,6 +22,19 @@ module Aws
22
22
  super(context, message, data)
23
23
  end
24
24
  end
25
+
26
+ # Hijack PermanentRedirect (HeadBucket case - no body) dynamic error to
27
+ # include the region.
28
+ class Http301Error < ServiceError
29
+ # @param [Seahorse::Client::RequestContext] context
30
+ # @param [String] message
31
+ # @param [Aws::S3::Types::PermanentRedirect] _data
32
+ def initialize(context, message, _data = Aws::EmptyStructure.new)
33
+ data = Aws::S3::Types::PermanentRedirect.new(message: message)
34
+ data.region = context.http_response.headers['x-amz-bucket-region']
35
+ super(context, message, data)
36
+ end
37
+ end
25
38
  end
26
39
  end
27
40
  end
@@ -76,7 +76,7 @@ module Aws
76
76
  # @see #copy_to
77
77
  #
78
78
  def copy_from(source, options = {})
79
- Aws::Plugins::UserAgent.feature('resource') do
79
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
80
80
  if Hash === source && source[:copy_source]
81
81
  # for backwards compatibility
82
82
  @client.copy_object(source.merge(bucket: bucket_name, key: key))
@@ -119,7 +119,7 @@ module Aws
119
119
  # object.copy_to('src-bucket/src-key', multipart_copy: true)
120
120
  #
121
121
  def copy_to(target, options = {})
122
- Aws::Plugins::UserAgent.feature('resource') do
122
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
123
123
  ObjectCopier.new(self, options).copy_to(target, options)
124
124
  end
125
125
  end
@@ -390,7 +390,7 @@ module Aws
390
390
  tempfile: uploading_options.delete(:tempfile),
391
391
  part_size: uploading_options.delete(:part_size)
392
392
  )
393
- Aws::Plugins::UserAgent.feature('resource') do
393
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
394
394
  uploader.upload(
395
395
  uploading_options.merge(bucket: bucket_name, key: key),
396
396
  &block
@@ -473,7 +473,7 @@ module Aws
473
473
  multipart_threshold: uploading_options.delete(:multipart_threshold),
474
474
  client: client
475
475
  )
476
- response = Aws::Plugins::UserAgent.feature('resource') do
476
+ response = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
477
477
  uploader.upload(
478
478
  source,
479
479
  uploading_options.merge(bucket: bucket_name, key: key)
@@ -551,7 +551,7 @@ module Aws
551
551
  # @see Client#head_object
552
552
  def download_file(destination, options = {})
553
553
  downloader = FileDownloader.new(client: client)
554
- Aws::Plugins::UserAgent.feature('resource') do
554
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
555
555
  downloader.download(
556
556
  destination,
557
557
  options.merge(bucket: bucket_name, key: key)
@@ -18,9 +18,12 @@ require 'aws-sdk-s3/presigner'
18
18
 
19
19
  # s3 express session auth
20
20
  require 'aws-sdk-s3/express_credentials'
21
- require 'aws-sdk-s3/express_credentials_cache'
22
21
  require 'aws-sdk-s3/express_credentials_provider'
23
22
 
23
+ # s3 access grants auth
24
+ require 'aws-sdk-s3/access_grants_credentials'
25
+ require 'aws-sdk-s3/access_grants_credentials_provider'
26
+
24
27
  # customizations to generated classes
25
28
  require 'aws-sdk-s3/customizations/bucket'
26
29
  require 'aws-sdk-s3/customizations/errors'
@@ -270,7 +270,7 @@ module Aws
270
270
  envelope_location: @envelope_location,
271
271
  instruction_file_suffix: @instruction_file_suffix,
272
272
  }
273
- Aws::Plugins::UserAgent.feature('S3CryptoV1n') do
273
+ Aws::Plugins::UserAgent.metric('S3_CRYPTO_V1N') do
274
274
  req.send_request
275
275
  end
276
276
  end
@@ -300,7 +300,7 @@ module Aws
300
300
  envelope_location: envelope_location,
301
301
  instruction_file_suffix: instruction_file_suffix,
302
302
  }
303
- Aws::Plugins::UserAgent.feature('S3CryptoV1n') do
303
+ Aws::Plugins::UserAgent.metric('S3_CRYPTO_V1N') do
304
304
  req.send_request(target: block)
305
305
  end
306
306
  end