aws-sdk-s3 1.136.0 → 1.208.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.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +452 -1
  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 +250 -0
  6. data/lib/aws-sdk-s3/bucket.rb +728 -145
  7. data/lib/aws-sdk-s3/bucket_acl.rb +19 -18
  8. data/lib/aws-sdk-s3/bucket_cors.rb +22 -21
  9. data/lib/aws-sdk-s3/bucket_lifecycle.rb +23 -18
  10. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +76 -19
  11. data/lib/aws-sdk-s3/bucket_logging.rb +21 -14
  12. data/lib/aws-sdk-s3/bucket_notification.rb +6 -6
  13. data/lib/aws-sdk-s3/bucket_policy.rb +65 -20
  14. data/lib/aws-sdk-s3/bucket_region_cache.rb +9 -5
  15. data/lib/aws-sdk-s3/bucket_request_payment.rb +15 -15
  16. data/lib/aws-sdk-s3/bucket_tagging.rb +19 -19
  17. data/lib/aws-sdk-s3/bucket_versioning.rb +74 -41
  18. data/lib/aws-sdk-s3/bucket_website.rb +19 -19
  19. data/lib/aws-sdk-s3/client.rb +9951 -3365
  20. data/lib/aws-sdk-s3/client_api.rb +758 -164
  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 +87 -91
  24. data/lib/aws-sdk-s3/customizations/object_summary.rb +5 -0
  25. data/lib/aws-sdk-s3/customizations/object_version.rb +13 -0
  26. data/lib/aws-sdk-s3/customizations.rb +28 -31
  27. data/lib/aws-sdk-s3/default_executor.rb +103 -0
  28. data/lib/aws-sdk-s3/encryption/client.rb +4 -4
  29. data/lib/aws-sdk-s3/encryption/default_cipher_provider.rb +2 -0
  30. data/lib/aws-sdk-s3/encryption/encrypt_handler.rb +2 -0
  31. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +4 -2
  32. data/lib/aws-sdk-s3/encryptionV2/client.rb +100 -25
  33. data/lib/aws-sdk-s3/encryptionV2/decrypt_handler.rb +7 -162
  34. data/lib/aws-sdk-s3/encryptionV2/decryption.rb +205 -0
  35. data/lib/aws-sdk-s3/encryptionV2/default_cipher_provider.rb +17 -0
  36. data/lib/aws-sdk-s3/encryptionV2/encrypt_handler.rb +2 -0
  37. data/lib/aws-sdk-s3/encryptionV2/io_encrypter.rb +2 -0
  38. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +10 -2
  39. data/lib/aws-sdk-s3/encryptionV2/utils.rb +5 -0
  40. data/lib/aws-sdk-s3/encryptionV3/client.rb +885 -0
  41. data/lib/aws-sdk-s3/encryptionV3/decrypt_handler.rb +98 -0
  42. data/lib/aws-sdk-s3/encryptionV3/decryption.rb +244 -0
  43. data/lib/aws-sdk-s3/encryptionV3/default_cipher_provider.rb +159 -0
  44. data/lib/aws-sdk-s3/encryptionV3/default_key_provider.rb +35 -0
  45. data/lib/aws-sdk-s3/encryptionV3/encrypt_handler.rb +98 -0
  46. data/lib/aws-sdk-s3/encryptionV3/errors.rb +47 -0
  47. data/lib/aws-sdk-s3/encryptionV3/io_auth_decrypter.rb +60 -0
  48. data/lib/aws-sdk-s3/encryptionV3/io_decrypter.rb +35 -0
  49. data/lib/aws-sdk-s3/encryptionV3/io_encrypter.rb +84 -0
  50. data/lib/aws-sdk-s3/encryptionV3/key_provider.rb +28 -0
  51. data/lib/aws-sdk-s3/encryptionV3/kms_cipher_provider.rb +159 -0
  52. data/lib/aws-sdk-s3/encryptionV3/materials.rb +58 -0
  53. data/lib/aws-sdk-s3/encryptionV3/utils.rb +321 -0
  54. data/lib/aws-sdk-s3/encryption_v2.rb +1 -0
  55. data/lib/aws-sdk-s3/encryption_v3.rb +24 -0
  56. data/lib/aws-sdk-s3/endpoint_parameters.rb +65 -30
  57. data/lib/aws-sdk-s3/endpoint_provider.rb +604 -227
  58. data/lib/aws-sdk-s3/endpoints.rb +655 -1261
  59. data/lib/aws-sdk-s3/errors.rb +58 -0
  60. data/lib/aws-sdk-s3/express_credentials.rb +55 -0
  61. data/lib/aws-sdk-s3/express_credentials_provider.rb +59 -0
  62. data/lib/aws-sdk-s3/file_downloader.rb +192 -147
  63. data/lib/aws-sdk-s3/file_uploader.rb +10 -14
  64. data/lib/aws-sdk-s3/legacy_signer.rb +2 -1
  65. data/lib/aws-sdk-s3/multipart_download_error.rb +8 -0
  66. data/lib/aws-sdk-s3/multipart_file_uploader.rb +106 -103
  67. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +99 -109
  68. data/lib/aws-sdk-s3/multipart_upload.rb +185 -38
  69. data/lib/aws-sdk-s3/multipart_upload_error.rb +3 -4
  70. data/lib/aws-sdk-s3/multipart_upload_part.rb +205 -68
  71. data/lib/aws-sdk-s3/object.rb +2052 -315
  72. data/lib/aws-sdk-s3/object_acl.rb +46 -28
  73. data/lib/aws-sdk-s3/object_copier.rb +1 -1
  74. data/lib/aws-sdk-s3/object_multipart_copier.rb +12 -9
  75. data/lib/aws-sdk-s3/object_summary.rb +1778 -262
  76. data/lib/aws-sdk-s3/object_version.rb +400 -68
  77. data/lib/aws-sdk-s3/plugins/access_grants.rb +178 -0
  78. data/lib/aws-sdk-s3/plugins/checksum_algorithm.rb +31 -0
  79. data/lib/aws-sdk-s3/plugins/endpoints.rb +32 -208
  80. data/lib/aws-sdk-s3/plugins/express_session_auth.rb +88 -0
  81. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +55 -18
  82. data/lib/aws-sdk-s3/plugins/location_constraint.rb +3 -1
  83. data/lib/aws-sdk-s3/plugins/md5s.rb +10 -70
  84. data/lib/aws-sdk-s3/plugins/s3_signer.rb +7 -2
  85. data/lib/aws-sdk-s3/plugins/streaming_retry.rb +5 -7
  86. data/lib/aws-sdk-s3/plugins/url_encoded_keys.rb +2 -1
  87. data/lib/aws-sdk-s3/presigner.rb +9 -7
  88. data/lib/aws-sdk-s3/resource.rb +127 -22
  89. data/lib/aws-sdk-s3/transfer_manager.rb +303 -0
  90. data/lib/aws-sdk-s3/types.rb +8065 -1783
  91. data/lib/aws-sdk-s3.rb +35 -31
  92. data/sig/bucket.rbs +231 -0
  93. data/sig/bucket_acl.rbs +78 -0
  94. data/sig/bucket_cors.rbs +69 -0
  95. data/sig/bucket_lifecycle.rbs +88 -0
  96. data/sig/bucket_lifecycle_configuration.rbs +115 -0
  97. data/sig/bucket_logging.rbs +76 -0
  98. data/sig/bucket_notification.rbs +114 -0
  99. data/sig/bucket_policy.rbs +59 -0
  100. data/sig/bucket_request_payment.rbs +54 -0
  101. data/sig/bucket_tagging.rbs +65 -0
  102. data/sig/bucket_versioning.rbs +77 -0
  103. data/sig/bucket_website.rbs +93 -0
  104. data/sig/client.rbs +2612 -0
  105. data/sig/customizations/bucket.rbs +19 -0
  106. data/sig/customizations/object.rbs +38 -0
  107. data/sig/customizations/object_summary.rbs +35 -0
  108. data/sig/errors.rbs +44 -0
  109. data/sig/multipart_upload.rbs +120 -0
  110. data/sig/multipart_upload_part.rbs +109 -0
  111. data/sig/object.rbs +464 -0
  112. data/sig/object_acl.rbs +86 -0
  113. data/sig/object_summary.rbs +347 -0
  114. data/sig/object_version.rbs +143 -0
  115. data/sig/resource.rbs +141 -0
  116. data/sig/types.rbs +2899 -0
  117. data/sig/waiters.rbs +95 -0
  118. metadata +61 -12
  119. data/lib/aws-sdk-s3/plugins/skip_whole_multipart_get_checksums.rb +0 -31
@@ -6,80 +6,20 @@ module Aws
6
6
  module S3
7
7
  module Plugins
8
8
  # @api private
9
- # This plugin is effectively deprecated in favor of modeled
9
+ # This plugin is deprecated in favor of modeled
10
10
  # httpChecksumRequired traits.
11
11
  class Md5s < Seahorse::Client::Plugin
12
- # These operations allow Content MD5 but are not required by
13
- # httpChecksumRequired. This list should not grow.
14
- OPTIONAL_OPERATIONS = [
15
- :put_object,
16
- :upload_part
17
- ]
18
-
19
- # @api private
20
- class Handler < Seahorse::Client::Handler
21
-
22
- CHUNK_SIZE = 1 * 1024 * 1024 # one MB
23
-
24
- def call(context)
25
- if !context[:checksum_algorithms] # skip in favor of flexible checksum
26
- body = context.http_request.body
27
- if body.respond_to?(:size) && body.size > 0
28
- context.http_request.headers['Content-Md5'] ||= md5(body)
29
- end
30
- end
31
- @handler.call(context)
32
- end
33
-
34
- private
35
-
36
- # @param [File, Tempfile, IO#read, String] value
37
- # @return [String<MD5>]
38
- def md5(value)
39
- if (File === value || Tempfile === value) && !value.path.nil? && File.exist?(value.path)
40
- OpenSSL::Digest::MD5.file(value).base64digest
41
- elsif value.respond_to?(:read)
42
- md5 = OpenSSL::Digest::MD5.new
43
- update_in_chunks(md5, value)
44
- md5.base64digest
45
- else
46
- OpenSSL::Digest::MD5.digest(value).base64digest
47
- end
48
- end
49
-
50
- def update_in_chunks(digest, io)
51
- loop do
52
- chunk = io.read(CHUNK_SIZE)
53
- break unless chunk
54
- digest.update(chunk)
55
- end
56
- io.rewind
57
- end
58
-
59
- end
60
-
61
12
  option(:compute_checksums,
62
- default: true,
63
- doc_type: 'Boolean',
64
- docstring: <<-DOCS)
65
- When `true` a MD5 checksum will be computed and sent in the Content Md5
66
- header for :put_object and :upload_part. When `false`, MD5 checksums
67
- will not be computed for these operations. Checksums are still computed
68
- for operations requiring them. Checksum errors returned by Amazon S3 are
69
- automatically retried up to `:retry_limit` times.
70
- DOCS
71
-
72
- def add_handlers(handlers, config)
73
- if config.compute_checksums
74
- # priority set low to ensure md5 is computed AFTER the request is
75
- # built but before it is signed
76
- handlers.add(
77
- Handler,
78
- priority: 10, step: :build, operations: OPTIONAL_OPERATIONS
79
- )
80
- end
13
+ default: true,
14
+ doc_type: 'Boolean',
15
+ docstring: <<~DOCS)
16
+ This option is deprecated. Please use `:request_checksum_calculation` instead.
17
+ When `false`, `request_checksum_calculation` is overridden to `when_required`.
18
+ DOCS
19
+
20
+ def after_initialize(client)
21
+ client.config.request_checksum_calculation = 'when_required' unless client.config.compute_checksums
81
22
  end
82
-
83
23
  end
84
24
  end
85
25
  end
@@ -4,6 +4,11 @@ require 'aws-sigv4'
4
4
 
5
5
  module Aws
6
6
  module S3
7
+ # @api private
8
+ def self.bucket_region_cache
9
+ @bucket_region_cache ||= BucketRegionCache.new
10
+ end
11
+
7
12
  module Plugins
8
13
  # This plugin used to have a V4 signer but it was removed in favor of
9
14
  # generic Sign plugin that uses endpoint auth scheme.
@@ -51,7 +56,7 @@ module Aws
51
56
  private
52
57
 
53
58
  def check_for_cached_region(context, bucket)
54
- cached_region = S3::BUCKET_REGIONS[bucket]
59
+ cached_region = Aws::S3.bucket_region_cache[bucket]
55
60
  if cached_region &&
56
61
  cached_region != context.config.region &&
57
62
  !S3Signer.custom_endpoint?(context)
@@ -97,7 +102,7 @@ module Aws
97
102
  end
98
103
 
99
104
  def update_bucket_cache(context, actual_region)
100
- S3::BUCKET_REGIONS[context.params[:bucket]] = actual_region
105
+ Aws::S3.bucket_region_cache[context.params[:bucket]] = actual_region
101
106
  end
102
107
 
103
108
  def fips_region?(resp)
@@ -62,18 +62,16 @@ module Aws
62
62
  class Handler < Seahorse::Client::Handler
63
63
 
64
64
  def call(context)
65
- target = context.params[:response_target] || context[:response_target]
66
-
67
65
  # retry is only supported when range is NOT set on the initial request
68
- if supported_target?(target) && !context.params[:range]
69
- add_event_listeners(context, target)
66
+ if supported_target?(context) && !context.params[:range]
67
+ add_event_listeners(context)
70
68
  end
71
69
  @handler.call(context)
72
70
  end
73
71
 
74
72
  private
75
73
 
76
- def add_event_listeners(context, target)
74
+ def add_event_listeners(context)
77
75
  context.http_response.on_headers(200..299) do
78
76
  case context.http_response.body
79
77
  when Seahorse::Client::BlockIO then
@@ -123,8 +121,8 @@ module Aws
123
121
  context.http_response.body.is_a?(RetryableManagedFile)
124
122
  end
125
123
 
126
- def supported_target?(target)
127
- case target
124
+ def supported_target?(context)
125
+ case context[:response_target]
128
126
  when Proc, String, Pathname then true
129
127
  else false
130
128
  end
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'uri'
4
- require 'cgi'
4
+ require "cgi/escape"
5
+ require "cgi/util" if RUBY_VERSION < "3.5"
5
6
 
6
7
  module Aws
7
8
  module S3
@@ -193,13 +193,14 @@ module Aws
193
193
  req, expires_in, secure, time, unsigned_headers, hoist = true
194
194
  )
195
195
  x_amz_headers = {}
196
-
197
196
  http_req = req.context.http_request
198
-
199
- req.handlers.remove(Aws::S3::Plugins::S3Signer::LegacyHandler)
200
- req.handlers.remove(Aws::Plugins::Sign::Handler)
201
197
  req.handlers.remove(Seahorse::Client::Plugins::ContentLength::Handler)
202
-
198
+ req.handlers.remove(Aws::Rest::ContentTypeHandler)
199
+ req.handlers.remove(Aws::Plugins::ChecksumAlgorithm::OptionHandler)
200
+ req.handlers.remove(Aws::Plugins::ChecksumAlgorithm::ChecksumHandler)
201
+ req.handlers.remove(Aws::Plugins::InvocationId::Handler)
202
+ req.handlers.remove(Aws::Plugins::Sign::Handler)
203
+ req.handlers.remove(Aws::S3::Plugins::S3Signer::LegacyHandler)
203
204
  req.handle(step: :send) do |context|
204
205
  # if an endpoint was not provided, force secure or insecure
205
206
  if context.config.regional_endpoint
@@ -232,10 +233,11 @@ module Aws
232
233
  end
233
234
  signer = Aws::Sigv4::Signer.new(
234
235
  service: auth_scheme['signingName'] || 's3',
235
- region: region || context.config.region,
236
- credentials_provider: context.config.credentials,
236
+ region: context[:sigv4_region] || region || context.config.region,
237
+ credentials_provider: context[:sigv4_credentials] || context.config.credentials,
237
238
  signing_algorithm: scheme_name.to_sym,
238
239
  uri_escape_path: !!!auth_scheme['disableDoubleEncoding'],
240
+ normalize_path: !!!auth_scheme['disableNormalizePath'],
239
241
  unsigned_headers: unsigned_headers,
240
242
  apply_checksum_header: false
241
243
  )
@@ -41,7 +41,21 @@ 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, ap-south-2, eu-south-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-south-2, ap-southeast-1, ap-southeast-2, ap-southeast-3, ap-southeast-4, ap-southeast-5, ca-central-1, cn-north-1, cn-northwest-1, EU, eu-central-1, eu-central-2, eu-north-1, eu-south-1, eu-south-2, eu-west-1, eu-west-2, eu-west-3, il-central-1, me-central-1, me-south-1, sa-east-1, us-east-2, us-gov-east-1, us-gov-west-1, us-west-1, us-west-2
45
+ # location: {
46
+ # type: "AvailabilityZone", # accepts AvailabilityZone, LocalZone
47
+ # name: "LocationNameAsString",
48
+ # },
49
+ # bucket: {
50
+ # data_redundancy: "SingleAvailabilityZone", # accepts SingleAvailabilityZone, SingleLocalZone
51
+ # type: "Directory", # accepts Directory
52
+ # },
53
+ # tags: [
54
+ # {
55
+ # key: "ObjectKey", # required
56
+ # value: "Value", # required
57
+ # },
58
+ # ],
45
59
  # },
46
60
  # grant_full_control: "GrantFullControl",
47
61
  # grant_read: "GrantRead",
@@ -54,47 +68,112 @@ module Aws::S3
54
68
  # @param [Hash] options ({})
55
69
  # @option options [String] :acl
56
70
  # The canned ACL to apply to the bucket.
71
+ #
72
+ # <note markdown="1"> This functionality is not supported for directory buckets.
73
+ #
74
+ # </note>
57
75
  # @option options [required, String] :bucket
58
76
  # The name of the bucket to create.
77
+ #
78
+ # **General purpose buckets** - For information about bucket naming
79
+ # restrictions, see [Bucket naming rules][1] in the *Amazon S3 User
80
+ # Guide*.
81
+ #
82
+ # <b>Directory buckets </b> - When you use this operation with a
83
+ # directory bucket, you must use path-style requests in the format
84
+ # `https://s3express-control.region-code.amazonaws.com/bucket-name `.
85
+ # Virtual-hosted-style requests aren't supported. Directory bucket
86
+ # names must be unique in the chosen Zone (Availability Zone or Local
87
+ # Zone). Bucket names must also follow the format `
88
+ # bucket-base-name--zone-id--x-s3` (for example, `
89
+ # DOC-EXAMPLE-BUCKET--usw2-az1--x-s3`). For information about bucket
90
+ # naming restrictions, see [Directory bucket naming rules][2] in the
91
+ # *Amazon S3 User Guide*
92
+ #
93
+ #
94
+ #
95
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html
96
+ # [2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html
59
97
  # @option options [Types::CreateBucketConfiguration] :create_bucket_configuration
60
98
  # The configuration information for the bucket.
61
99
  # @option options [String] :grant_full_control
62
100
  # Allows grantee the read, write, read ACP, and write ACP permissions on
63
101
  # the bucket.
102
+ #
103
+ # <note markdown="1"> This functionality is not supported for directory buckets.
104
+ #
105
+ # </note>
64
106
  # @option options [String] :grant_read
65
107
  # Allows grantee to list the objects in the bucket.
108
+ #
109
+ # <note markdown="1"> This functionality is not supported for directory buckets.
110
+ #
111
+ # </note>
66
112
  # @option options [String] :grant_read_acp
67
113
  # Allows grantee to read the bucket ACL.
114
+ #
115
+ # <note markdown="1"> This functionality is not supported for directory buckets.
116
+ #
117
+ # </note>
68
118
  # @option options [String] :grant_write
69
119
  # Allows grantee to create new objects in the bucket.
70
120
  #
71
121
  # For the bucket and object owners of existing objects, also allows
72
122
  # deletions and overwrites of those objects.
123
+ #
124
+ # <note markdown="1"> This functionality is not supported for directory buckets.
125
+ #
126
+ # </note>
73
127
  # @option options [String] :grant_write_acp
74
128
  # Allows grantee to write the ACL for the applicable bucket.
129
+ #
130
+ # <note markdown="1"> This functionality is not supported for directory buckets.
131
+ #
132
+ # </note>
75
133
  # @option options [Boolean] :object_lock_enabled_for_bucket
76
134
  # Specifies whether you want S3 Object Lock to be enabled for the new
77
135
  # bucket.
136
+ #
137
+ # <note markdown="1"> This functionality is not supported for directory buckets.
138
+ #
139
+ # </note>
78
140
  # @option options [String] :object_ownership
79
141
  # The container element for object ownership for a bucket's ownership
80
142
  # controls.
81
143
  #
82
- # BucketOwnerPreferred - Objects uploaded to the bucket change ownership
83
- # to the bucket owner if the objects are uploaded with the
144
+ # `BucketOwnerPreferred` - Objects uploaded to the bucket change
145
+ # ownership to the bucket owner if the objects are uploaded with the
84
146
  # `bucket-owner-full-control` canned ACL.
85
147
  #
86
- # ObjectWriter - The uploading account will own the object if the object
87
- # is uploaded with the `bucket-owner-full-control` canned ACL.
148
+ # `ObjectWriter` - The uploading account will own the object if the
149
+ # object is uploaded with the `bucket-owner-full-control` canned ACL.
150
+ #
151
+ # `BucketOwnerEnforced` - Access control lists (ACLs) are disabled and
152
+ # no longer affect permissions. The bucket owner automatically owns and
153
+ # has full control over every object in the bucket. The bucket only
154
+ # accepts PUT requests that don't specify an ACL or specify bucket
155
+ # owner full control ACLs (such as the predefined
156
+ # `bucket-owner-full-control` canned ACL or a custom ACL in XML format
157
+ # that grants the same permissions).
158
+ #
159
+ # By default, `ObjectOwnership` is set to `BucketOwnerEnforced` and ACLs
160
+ # are disabled. We recommend keeping ACLs disabled, except in uncommon
161
+ # use cases where you must control access for each object individually.
162
+ # For more information about S3 Object Ownership, see [Controlling
163
+ # ownership of objects and disabling ACLs for your bucket][1] in the
164
+ # *Amazon S3 User Guide*.
165
+ #
166
+ # <note markdown="1"> This functionality is not supported for directory buckets. Directory
167
+ # buckets use the bucket owner enforced setting for S3 Object Ownership.
168
+ #
169
+ # </note>
170
+ #
88
171
  #
89
- # BucketOwnerEnforced - Access control lists (ACLs) are disabled and no
90
- # longer affect permissions. The bucket owner automatically owns and has
91
- # full control over every object in the bucket. The bucket only accepts
92
- # PUT requests that don't specify an ACL or bucket owner full control
93
- # ACLs, such as the `bucket-owner-full-control` canned ACL or an
94
- # equivalent form of this ACL expressed in the XML format.
172
+ #
173
+ # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html
95
174
  # @return [Bucket]
96
175
  def create_bucket(options = {})
97
- Aws::Plugins::UserAgent.feature('resource') do
176
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
98
177
  @client.create_bucket(options)
99
178
  end
100
179
  Bucket.new(
@@ -116,23 +195,49 @@ module Aws::S3
116
195
 
117
196
  # @example Request syntax with placeholder values
118
197
  #
119
- # s3.buckets()
198
+ # buckets = s3.buckets({
199
+ # prefix: "Prefix",
200
+ # bucket_region: "BucketRegion",
201
+ # })
120
202
  # @param [Hash] options ({})
203
+ # @option options [String] :prefix
204
+ # Limits the response to bucket names that begin with the specified
205
+ # bucket name prefix.
206
+ # @option options [String] :bucket_region
207
+ # Limits the response to buckets that are located in the specified
208
+ # Amazon Web Services Region. The Amazon Web Services Region must be
209
+ # expressed according to the Amazon Web Services Region code, such as
210
+ # `us-west-2` for the US West (Oregon) Region. For a list of the valid
211
+ # values for all of the Amazon Web Services Regions, see [Regions and
212
+ # Endpoints][1].
213
+ #
214
+ # <note markdown="1"> Requests made to a Regional endpoint that is different from the
215
+ # `bucket-region` parameter are not supported. For example, if you want
216
+ # to limit the response to your buckets in Region `us-west-2`, the
217
+ # request must be made to an endpoint in Region `us-west-2`.
218
+ #
219
+ # </note>
220
+ #
221
+ #
222
+ #
223
+ # [1]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
121
224
  # @return [Bucket::Collection]
122
225
  def buckets(options = {})
123
226
  batches = Enumerator.new do |y|
124
- batch = []
125
- resp = Aws::Plugins::UserAgent.feature('resource') do
227
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
126
228
  @client.list_buckets(options)
127
229
  end
128
- resp.data.buckets.each do |b|
129
- batch << Bucket.new(
130
- name: b.name,
131
- data: b,
132
- client: @client
133
- )
230
+ resp.each_page do |page|
231
+ batch = []
232
+ page.data.buckets.each do |b|
233
+ batch << Bucket.new(
234
+ name: b.name,
235
+ data: b,
236
+ client: @client
237
+ )
238
+ end
239
+ y.yield(batch)
134
240
  end
135
- y.yield(batch)
136
241
  end
137
242
  Bucket::Collection.new(batches)
138
243
  end