aws-sdk-s3 1.143.0 → 1.156.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +100 -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 +241 -0
  6. data/lib/aws-sdk-s3/bucket.rb +13 -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 +370 -314
  20. data/lib/aws-sdk-s3/client_api.rb +15 -6
  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 +7 -6
  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_file_uploader.rb +4 -3
  36. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +6 -4
  37. data/lib/aws-sdk-s3/multipart_upload.rb +4 -4
  38. data/lib/aws-sdk-s3/multipart_upload_part.rb +3 -3
  39. data/lib/aws-sdk-s3/object.rb +30 -12
  40. data/lib/aws-sdk-s3/object_acl.rb +3 -3
  41. data/lib/aws-sdk-s3/object_copier.rb +1 -1
  42. data/lib/aws-sdk-s3/object_multipart_copier.rb +10 -8
  43. data/lib/aws-sdk-s3/object_summary.rb +10 -10
  44. data/lib/aws-sdk-s3/object_version.rb +23 -5
  45. data/lib/aws-sdk-s3/plugins/access_grants.rb +114 -0
  46. data/lib/aws-sdk-s3/plugins/express_session_auth.rb +8 -2
  47. data/lib/aws-sdk-s3/plugins/http_200_errors.rb +53 -16
  48. data/lib/aws-sdk-s3/plugins/s3_signer.rb +7 -2
  49. data/lib/aws-sdk-s3/presigner.rb +2 -0
  50. data/lib/aws-sdk-s3/resource.rb +3 -3
  51. data/lib/aws-sdk-s3/types.rb +101 -51
  52. data/lib/aws-sdk-s3.rb +1 -1
  53. data/sig/client.rbs +21 -0
  54. data/sig/customizations/bucket.rbs +19 -0
  55. data/sig/customizations/object.rbs +38 -0
  56. data/sig/customizations/object_summary.rbs +35 -0
  57. data/sig/object.rbs +6 -0
  58. data/sig/object_version.rbs +6 -0
  59. data/sig/resource.rbs +3 -0
  60. data/sig/types.rbs +6 -0
  61. data/sig/waiters.rbs +12 -0
  62. metadata +12 -7
  63. data/lib/aws-sdk-s3/express_credentials_cache.rb +0 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2be86d662a76114802ed36113558cb7e2df85c21e6b94e0c7e47b9a69f92ca60
4
- data.tar.gz: 3218088810b2459826d8a0ac475be22c7daeee303e195c8f22bc3569f6a42ab7
3
+ metadata.gz: 444d8fbcdc8d19b75228bdec52d8e1651f4d35459866847055b0d7e16d56371a
4
+ data.tar.gz: 785d49ecff3a7441d4f3c196ed64d7cfbe79330627c585fc7108a4a7b11d6d2b
5
5
  SHA512:
6
- metadata.gz: 02efd7ab304a9b6214ed80d59ff3ed833a3dedb28a6d444bbca6cad8cf46eebd6590290dffc8d0502014cbb31a9209e35cdf8c2e9d90c81b8398d97725f4028f
7
- data.tar.gz: 1af4e138d4866f2ab8e346039c7cf8b0dd141164c72f25b97ba80572bd614ee0881eecba3c8cd5cc58b274ac8318f18fdbbe1a06428b2f9abc5c59e8dbd7e495
6
+ metadata.gz: e60cb04b18ce10ec62f4b63f28cf8ed7adf206a22910c7251ed9d1c2040a3466cb2d09a0987d6fc8d2361b4c15dfa0b764877b5c7bdedd03146383b5a11a79ae
7
+ data.tar.gz: 2e5654d95f462359aebeae89f2b855211b95acbe1820ad354a7a8c0e8261ff1188715e469637aea8c647124a7672f102a08e5fa78d73ed27253fcb886cfa13b8
data/CHANGELOG.md CHANGED
@@ -1,6 +1,105 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 1.156.0 (2024-07-02)
5
+ ------------------
6
+
7
+ * Feature - Added response overrides to Head Object requests.
8
+
9
+ 1.155.0 (2024-06-28)
10
+ ------------------
11
+
12
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
13
+
14
+ 1.154.0 (2024-06-25)
15
+ ------------------
16
+
17
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
18
+
19
+ 1.153.0 (2024-06-24)
20
+ ------------------
21
+
22
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
23
+
24
+ 1.152.3 (2024-06-13)
25
+ ------------------
26
+
27
+ * Issue - Handle 200 errors for all S3 operations that do not have streaming responses.
28
+
29
+ 1.152.2 (2024-06-12)
30
+ ------------------
31
+
32
+ * Issue - Revert Handling of 200 errors for all S3 operations.
33
+
34
+ 1.152.1 (2024-06-10)
35
+ ------------------
36
+
37
+ * Issue - Handle 200 errors for all S3 operations that do not have streaming responses.
38
+
39
+ 1.152.0 (2024-06-05)
40
+ ------------------
41
+
42
+ * Feature - Added new params copySource and key to copyObject API for supporting S3 Access Grants plugin. These changes will not change any of the existing S3 API functionality.
43
+
44
+ 1.151.0 (2024-05-14)
45
+ ------------------
46
+
47
+ * Feature - Updated a few x-id in the http uri traits
48
+
49
+ 1.150.0 (2024-05-13)
50
+ ------------------
51
+
52
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
53
+
54
+ 1.149.1 (2024-05-06)
55
+ ------------------
56
+
57
+ * Issue - Fix bug where destination bucket default encryption was inadvertently overridden by source object encryption.
58
+
59
+ 1.149.0 (2024-04-30)
60
+ ------------------
61
+
62
+ * Feature - Support S3 Access Grants authentication. Access Grants can be enabled with the `access_grants` option, and custom options can be passed into the `access_grants_credentials_provider` option. This feature requires `aws-sdk-s3control` to be installed.
63
+
64
+ * Feature - Add RBS signatures for customizations of S3.
65
+
66
+ 1.148.0 (2024-04-25)
67
+ ------------------
68
+
69
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
70
+
71
+ 1.147.0 (2024-04-16)
72
+ ------------------
73
+
74
+ * Feature - Code Generated Changes, see `./build_tools` or `aws-sdk-core`'s CHANGELOG.md for details.
75
+
76
+ * Issue - Omit `ContentType` plugin when generating presigned url.
77
+
78
+ 1.146.1 (2024-03-28)
79
+ ------------------
80
+
81
+ * Issue - Fix bug where thread_count option was not being respected for multipart uploads.
82
+
83
+ 1.146.0 (2024-03-18)
84
+ ------------------
85
+
86
+ * Feature - Fix two issues with response root node names.
87
+
88
+ 1.145.0 (2024-03-15)
89
+ ------------------
90
+
91
+ * Feature - Documentation updates for Amazon S3.
92
+
93
+ 1.144.0 (2024-03-13)
94
+ ------------------
95
+
96
+ * Feature - This release makes the default option for S3 on Outposts request signing to use the SigV4A algorithm when using AWS Common Runtime (CRT).
97
+
98
+ 1.143.1 (2024-03-12)
99
+ ------------------
100
+
101
+ * Issue - Include original part errors in message when aborting multipart upload fails (#2990).
102
+
4
103
  1.143.0 (2024-01-26)
5
104
  ------------------
6
105
 
@@ -123,7 +222,7 @@ Unreleased Changes
123
222
  1.123.2 (2023-06-12)
124
223
  ------------------
125
224
 
126
- * Issue - Fix issue when decrypting noncurrent versions of objects when using client side encryption (#2866).
225
+ * Issue - Fix issue when decrypting noncurrent versions of objects when using client side encryption (#2866).
127
226
 
128
227
  1.123.1 (2023-06-02)
129
228
  ------------------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.143.0
1
+ 1.156.0
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'set'
4
+
5
+ module Aws
6
+ module S3
7
+ # @api private
8
+ class AccessGrantsCredentials
9
+ include CredentialProvider
10
+ include RefreshingCredentials
11
+
12
+ def initialize(options = {})
13
+ @client = options[:client]
14
+ @get_data_access_params = {}
15
+ options.each_pair do |key, value|
16
+ if self.class.get_data_access_options.include?(key)
17
+ @get_data_access_params[key] = value
18
+ end
19
+ end
20
+ @async_refresh = true
21
+ super
22
+ end
23
+
24
+ # @return [S3Control::Client]
25
+ attr_reader :client
26
+
27
+ # @return [String]
28
+ attr_reader :matched_grant_target
29
+
30
+ private
31
+
32
+ def refresh
33
+ c = @client.get_data_access(@get_data_access_params)
34
+ credentials = c.credentials
35
+ @matched_grant_target = c.matched_grant_target
36
+ @credentials = Credentials.new(
37
+ credentials.access_key_id,
38
+ credentials.secret_access_key,
39
+ credentials.session_token
40
+ )
41
+ @expiration = credentials.expiration
42
+ end
43
+
44
+ class << self
45
+
46
+ # @api private
47
+ def get_data_access_options
48
+ @gdao ||= begin
49
+ input = Aws::S3Control::Client.api.operation(:get_data_access).input
50
+ Set.new(input.shape.member_names)
51
+ end
52
+ end
53
+
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,241 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aws
4
+ module S3
5
+ # @api private
6
+ def self.access_grants_credentials_cache
7
+ @access_grants_credentials_cache ||= LRUCache.new(max_entries: 100)
8
+ end
9
+
10
+ # @api private
11
+ def self.access_grants_account_id_cache
12
+ @access_grants_account_id_cache ||= LRUCache.new(
13
+ max_entries: 100,
14
+ expiration: 60 * 10
15
+ )
16
+ end
17
+
18
+ # Returns Credentials class for S3 Access Grants. Accepts GetDataAccess
19
+ # params and other configuration as options. See
20
+ # {Aws::S3Control::Client#get_data_access} for details.
21
+ class AccessGrantsCredentialsProvider
22
+ # @param [Hash] options
23
+ # @option options [Hash] :s3_control_client_options The S3 Control
24
+ # client options used to create regional S3 Control clients to
25
+ # create the session. Region will be set to the region of the
26
+ # bucket.
27
+ # @option options [Aws::STS::Client] :sts_client The STS client used for
28
+ # fetching the Account ID for the credentials if credentials do not
29
+ # include an Account ID.
30
+ # @option options [Aws::S3::Client] :s3_client The S3 client used for
31
+ # fetching the location of the bucket so that a regional S3 Control
32
+ # client can be created. Defaults to the S3 client from the access
33
+ # grants plugin.
34
+ # @option options [String] :privilege ('Default') The privilege to use
35
+ # when requesting credentials. (see: {Aws::S3Control::Client#get_data_access})
36
+ # @option options [Boolean] :fallback (false) When true, if access is
37
+ # denied, the provider will fall back to the configured credentials.
38
+ # @option options [Boolean] :caching (true) When true, credentials and
39
+ # bucket account ids will be cached.
40
+ # @option options [Callable] :before_refresh Proc called before
41
+ # credentials are refreshed.
42
+ def initialize(options = {})
43
+ @s3_control_options = options.delete(:s3_control_client_options) || {}
44
+ @s3_client = options.delete(:s3_client)
45
+ @sts_client = options.delete(:sts_client)
46
+ @fallback = options.delete(:fallback) || false
47
+ @caching = options.delete(:caching) != false
48
+ @s3_control_clients = {}
49
+ @bucket_region_cache = Aws::S3.bucket_region_cache
50
+ return unless @caching
51
+
52
+ @credentials_cache = Aws::S3.access_grants_credentials_cache
53
+ @account_id_cache = Aws::S3.access_grants_account_id_cache
54
+ end
55
+
56
+ def access_grants_credentials_for(options = {})
57
+ target = target_prefix(
58
+ options[:bucket],
59
+ options[:key],
60
+ options[:prefix]
61
+ )
62
+ credentials = s3_client.config.credentials.credentials # resolves
63
+
64
+ if @caching
65
+ cached_credentials_for(target, options[:permission], credentials)
66
+ else
67
+ new_credentials_for(target, options[:permission], credentials)
68
+ end
69
+ rescue Aws::S3Control::Errors::AccessDenied
70
+ raise unless @fallback
71
+
72
+ warn 'Access denied for S3 Access Grants. Falling back to ' \
73
+ 'configured credentials.'
74
+ s3_client.config.credentials
75
+ end
76
+
77
+ attr_accessor :s3_client
78
+
79
+ private
80
+
81
+ def s3_control_client(bucket_region)
82
+ @s3_control_clients[bucket_region] ||= begin
83
+ credentials = s3_client.config.credentials
84
+ config = { credentials: credentials }.merge(@s3_control_options)
85
+ Aws::S3Control::Client.new(config.merge(
86
+ region: bucket_region,
87
+ use_fips_endpoint: s3_client.config.use_fips_endpoint,
88
+ use_dualstack_endpoint: s3_client.config.use_dualstack_endpoint
89
+ ))
90
+ end
91
+ end
92
+
93
+ def cached_credentials_for(target, permission, credentials)
94
+ cached_creds = broad_search_credentials_cache_prefix(target, permission, credentials)
95
+ return cached_creds if cached_creds
96
+
97
+ if %w[READ WRITE].include?(permission)
98
+ cached_creds = broad_search_credentials_cache_prefix(target, 'READWRITE', credentials)
99
+ return cached_creds if cached_creds
100
+ end
101
+
102
+ cached_creds = broad_search_credentials_cache_characters(target, permission, credentials)
103
+ return cached_creds if cached_creds
104
+
105
+ if %w[READ WRITE].include?(permission)
106
+ cached_creds = broad_search_credentials_cache_characters(target, 'READWRITE', credentials)
107
+ return cached_creds if cached_creds
108
+ end
109
+
110
+ creds = new_credentials_for(target, permission, credentials)
111
+ if creds.matched_grant_target.end_with?('*')
112
+ # remove /* from the end of the target
113
+ key = credentials_cache_key(creds.matched_grant_target[0...-2], permission, credentials)
114
+ @credentials_cache[key] = creds
115
+ end
116
+
117
+ creds
118
+ end
119
+
120
+ def broad_search_credentials_cache_prefix(target, permission, credentials)
121
+ prefix = target
122
+ while prefix != 's3:'
123
+ key = credentials_cache_key(prefix, permission, credentials)
124
+ return @credentials_cache[key] if @credentials_cache.key?(key)
125
+
126
+ prefix = prefix.split('/', -1)[0..-2].join('/')
127
+ end
128
+ nil
129
+ end
130
+
131
+ def broad_search_credentials_cache_characters(target, permission, credentials)
132
+ prefix = target
133
+ while prefix != 's3://'
134
+ key = credentials_cache_key("#{prefix}*", permission, credentials)
135
+ return @credentials_cache[key] if @credentials_cache.key?(key)
136
+
137
+ prefix = prefix[0..-2]
138
+ end
139
+ nil
140
+ end
141
+
142
+ def new_credentials_for(target, permission, credentials)
143
+ bucket_region = bucket_region_for_access_grants(target)
144
+ client = s3_control_client(bucket_region)
145
+
146
+ AccessGrantsCredentials.new(
147
+ target: target,
148
+ account_id: account_id_for_access_grants(target, credentials),
149
+ permission: permission,
150
+ client: client
151
+ )
152
+ end
153
+
154
+ def account_id_for_access_grants(target, credentials)
155
+ if @caching
156
+ cached_account_id_for(target, credentials)
157
+ else
158
+ new_account_id_for(target, credentials)
159
+ end
160
+ end
161
+
162
+ def cached_account_id_for(target, credentials)
163
+ bucket = bucket_name_from(target)
164
+
165
+ if @account_id_cache.key?(bucket)
166
+ @account_id_cache[bucket]
167
+ else
168
+ @account_id_cache[bucket] = new_account_id_for(target, credentials)
169
+ end
170
+ end
171
+
172
+ # returns the account id associated with the access grants instance
173
+ def new_account_id_for(target, credentials)
174
+ bucket_region = bucket_region_for_access_grants(target)
175
+ s3_control_client = s3_control_client(bucket_region)
176
+ resp = s3_control_client.get_access_grants_instance_for_prefix(
177
+ s3_prefix: target,
178
+ account_id: account_id_for_credentials(bucket_region, credentials)
179
+ )
180
+ ARNParser.parse(resp.access_grants_instance_arn).account_id
181
+ end
182
+
183
+ def bucket_region_for_access_grants(target)
184
+ bucket = bucket_name_from(target)
185
+ # regardless of caching option, bucket region cache is always shared
186
+ cached_bucket_region_for(bucket)
187
+ end
188
+
189
+ def cached_bucket_region_for(bucket)
190
+ if @bucket_region_cache.key?(bucket)
191
+ @bucket_region_cache[bucket]
192
+ else
193
+ @bucket_region_cache[bucket] = new_bucket_region_for(bucket)
194
+ end
195
+ end
196
+
197
+ def new_bucket_region_for(bucket)
198
+ @s3_client.head_bucket(bucket: bucket).bucket_region
199
+ rescue Aws::S3::Errors::Http301Error => e
200
+ e.data.region
201
+ end
202
+
203
+ # returns the account id for the configured credentials
204
+ def account_id_for_credentials(region, credentials)
205
+ # use resolved credentials to check for account id
206
+ if credentials.respond_to?(:account_id) && credentials.account_id &&
207
+ !credentials.account_id.empty?
208
+ credentials.account_id
209
+ else
210
+ @sts_client ||= Aws::STS::Client.new(
211
+ credentials: s3_client.config.credentials,
212
+ region: region,
213
+ use_fips_endpoint: s3_client.config.use_fips_endpoint,
214
+ use_dualstack_endpoint: s3_client.config.use_dualstack_endpoint
215
+ )
216
+ @sts_client.get_caller_identity.account
217
+ end
218
+ end
219
+
220
+ def target_prefix(bucket, key, prefix)
221
+ if key && !key.empty?
222
+ "s3://#{bucket}/#{key}"
223
+ elsif prefix && !prefix.empty?
224
+ "s3://#{bucket}/#{prefix}"
225
+ else
226
+ "s3://#{bucket}/*"
227
+ end
228
+ end
229
+
230
+ def credentials_cache_key(target, permission, credentials)
231
+ "#{credentials.access_key_id}-#{credentials.secret_access_key}" \
232
+ "-#{permission}-#{target}"
233
+ end
234
+
235
+ # extracts bucket name from target prefix
236
+ def bucket_name_from(target)
237
+ URI(target).host
238
+ end
239
+ end
240
+ end
241
+ end
@@ -95,7 +95,7 @@ module Aws::S3
95
95
  options, params = separate_params_and_options(options)
96
96
  waiter = Waiters::BucketExists.new(options)
97
97
  yield_waiter_and_warn(waiter, &block) if block_given?
98
- Aws::Plugins::UserAgent.feature('resource') do
98
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
99
99
  waiter.wait(params.merge(bucket: @name))
100
100
  end
101
101
  Bucket.new({
@@ -114,7 +114,7 @@ module Aws::S3
114
114
  options, params = separate_params_and_options(options)
115
115
  waiter = Waiters::BucketNotExists.new(options)
116
116
  yield_waiter_and_warn(waiter, &block) if block_given?
117
- Aws::Plugins::UserAgent.feature('resource') do
117
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
118
118
  waiter.wait(params.merge(bucket: @name))
119
119
  end
120
120
  Bucket.new({
@@ -217,7 +217,7 @@ module Aws::S3
217
217
  :retry
218
218
  end
219
219
  end
220
- Aws::Plugins::UserAgent.feature('resource') do
220
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
221
221
  Aws::Waiters::Waiter.new(options).wait({})
222
222
  end
223
223
  end
@@ -334,7 +334,7 @@ module Aws::S3
334
334
  # @return [Types::CreateBucketOutput]
335
335
  def create(options = {})
336
336
  options = options.merge(bucket: @name)
337
- resp = Aws::Plugins::UserAgent.feature('resource') do
337
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
338
338
  @client.create_bucket(options)
339
339
  end
340
340
  resp.data
@@ -359,7 +359,7 @@ module Aws::S3
359
359
  # @return [EmptyStructure]
360
360
  def delete(options = {})
361
361
  options = options.merge(bucket: @name)
362
- resp = Aws::Plugins::UserAgent.feature('resource') do
362
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
363
363
  @client.delete_bucket(options)
364
364
  end
365
365
  resp.data
@@ -473,7 +473,7 @@ module Aws::S3
473
473
  # @return [Types::DeleteObjectsOutput]
474
474
  def delete_objects(options = {})
475
475
  options = options.merge(bucket: @name)
476
- resp = Aws::Plugins::UserAgent.feature('resource') do
476
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
477
477
  @client.delete_objects(options)
478
478
  end
479
479
  resp.data
@@ -939,7 +939,7 @@ module Aws::S3
939
939
  # @return [Object]
940
940
  def put_object(options = {})
941
941
  options = options.merge(bucket: @name)
942
- Aws::Plugins::UserAgent.feature('resource') do
942
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
943
943
  @client.put_object(options)
944
944
  end
945
945
  Object.new(
@@ -1097,7 +1097,7 @@ module Aws::S3
1097
1097
  def multipart_uploads(options = {})
1098
1098
  batches = Enumerator.new do |y|
1099
1099
  options = options.merge(bucket: @name)
1100
- resp = Aws::Plugins::UserAgent.feature('resource') do
1100
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1101
1101
  @client.list_multipart_uploads(options)
1102
1102
  end
1103
1103
  resp.each_page do |page|
@@ -1200,7 +1200,7 @@ module Aws::S3
1200
1200
  def object_versions(options = {})
1201
1201
  batches = Enumerator.new do |y|
1202
1202
  options = options.merge(bucket: @name)
1203
- resp = Aws::Plugins::UserAgent.feature('resource') do
1203
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1204
1204
  @client.list_object_versions(options)
1205
1205
  end
1206
1206
  resp.each_page do |page|
@@ -1253,6 +1253,9 @@ module Aws::S3
1253
1253
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html
1254
1254
  # @option options [String] :encoding_type
1255
1255
  # Encoding type used by Amazon S3 to encode object keys in the response.
1256
+ # If using `url`, non-ASCII characters used in an object's key name
1257
+ # will be URL encoded. For example, the object `test_file(3).png` will
1258
+ # appear as `test_file%283%29.png`.
1256
1259
  # @option options [String] :prefix
1257
1260
  # Limits the response to keys that begin with the specified prefix.
1258
1261
  #
@@ -1300,7 +1303,7 @@ module Aws::S3
1300
1303
  def objects(options = {})
1301
1304
  batches = Enumerator.new do |y|
1302
1305
  options = options.merge(bucket: @name)
1303
- resp = Aws::Plugins::UserAgent.feature('resource') do
1306
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1304
1307
  @client.list_objects_v2(options)
1305
1308
  end
1306
1309
  resp.each_page do |page|
@@ -60,7 +60,7 @@ module Aws::S3
60
60
  #
61
61
  # @return [self]
62
62
  def load
63
- resp = Aws::Plugins::UserAgent.feature('resource') do
63
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
64
64
  @client.get_bucket_acl(bucket: @bucket_name)
65
65
  end
66
66
  @data = resp.data
@@ -177,7 +177,7 @@ module Aws::S3
177
177
  :retry
178
178
  end
179
179
  end
180
- Aws::Plugins::UserAgent.feature('resource') do
180
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
181
181
  Aws::Waiters::Waiter.new(options).wait({})
182
182
  end
183
183
  end
@@ -269,7 +269,7 @@ module Aws::S3
269
269
  # @return [EmptyStructure]
270
270
  def put(options = {})
271
271
  options = options.merge(bucket: @bucket_name)
272
- resp = Aws::Plugins::UserAgent.feature('resource') do
272
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
273
273
  @client.put_bucket_acl(options)
274
274
  end
275
275
  resp.data
@@ -55,7 +55,7 @@ module Aws::S3
55
55
  #
56
56
  # @return [self]
57
57
  def load
58
- resp = Aws::Plugins::UserAgent.feature('resource') do
58
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
59
59
  @client.get_bucket_cors(bucket: @bucket_name)
60
60
  end
61
61
  @data = resp.data
@@ -172,7 +172,7 @@ module Aws::S3
172
172
  :retry
173
173
  end
174
174
  end
175
- Aws::Plugins::UserAgent.feature('resource') do
175
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
176
176
  Aws::Waiters::Waiter.new(options).wait({})
177
177
  end
178
178
  end
@@ -192,7 +192,7 @@ module Aws::S3
192
192
  # @return [EmptyStructure]
193
193
  def delete(options = {})
194
194
  options = options.merge(bucket: @bucket_name)
195
- resp = Aws::Plugins::UserAgent.feature('resource') do
195
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
196
196
  @client.delete_bucket_cors(options)
197
197
  end
198
198
  resp.data
@@ -260,7 +260,7 @@ module Aws::S3
260
260
  # @return [EmptyStructure]
261
261
  def put(options = {})
262
262
  options = options.merge(bucket: @bucket_name)
263
- resp = Aws::Plugins::UserAgent.feature('resource') do
263
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
264
264
  @client.put_bucket_cors(options)
265
265
  end
266
266
  resp.data
@@ -54,7 +54,7 @@ module Aws::S3
54
54
  #
55
55
  # @return [self]
56
56
  def load
57
- resp = Aws::Plugins::UserAgent.feature('resource') do
57
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
58
58
  @client.get_bucket_lifecycle(bucket: @bucket_name)
59
59
  end
60
60
  @data = resp.data
@@ -171,7 +171,7 @@ module Aws::S3
171
171
  :retry
172
172
  end
173
173
  end
174
- Aws::Plugins::UserAgent.feature('resource') do
174
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
175
175
  Aws::Waiters::Waiter.new(options).wait({})
176
176
  end
177
177
  end
@@ -191,7 +191,7 @@ module Aws::S3
191
191
  # @return [EmptyStructure]
192
192
  def delete(options = {})
193
193
  options = options.merge(bucket: @bucket_name)
194
- resp = Aws::Plugins::UserAgent.feature('resource') do
194
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
195
195
  @client.delete_bucket_lifecycle(options)
196
196
  end
197
197
  resp.data
@@ -263,7 +263,7 @@ module Aws::S3
263
263
  # @return [EmptyStructure]
264
264
  def put(options = {})
265
265
  options = options.merge(bucket: @bucket_name)
266
- resp = Aws::Plugins::UserAgent.feature('resource') do
266
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
267
267
  @client.put_bucket_lifecycle(options)
268
268
  end
269
269
  resp.data
@@ -54,7 +54,7 @@ module Aws::S3
54
54
  #
55
55
  # @return [self]
56
56
  def load
57
- resp = Aws::Plugins::UserAgent.feature('resource') do
57
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
58
58
  @client.get_bucket_lifecycle_configuration(bucket: @bucket_name)
59
59
  end
60
60
  @data = resp.data
@@ -171,7 +171,7 @@ module Aws::S3
171
171
  :retry
172
172
  end
173
173
  end
174
- Aws::Plugins::UserAgent.feature('resource') do
174
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
175
175
  Aws::Waiters::Waiter.new(options).wait({})
176
176
  end
177
177
  end
@@ -191,7 +191,7 @@ module Aws::S3
191
191
  # @return [EmptyStructure]
192
192
  def delete(options = {})
193
193
  options = options.merge(bucket: @bucket_name)
194
- resp = Aws::Plugins::UserAgent.feature('resource') do
194
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
195
195
  @client.delete_bucket_lifecycle(options)
196
196
  end
197
197
  resp.data
@@ -283,7 +283,7 @@ module Aws::S3
283
283
  # @return [EmptyStructure]
284
284
  def put(options = {})
285
285
  options = options.merge(bucket: @bucket_name)
286
- resp = Aws::Plugins::UserAgent.feature('resource') do
286
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
287
287
  @client.put_bucket_lifecycle_configuration(options)
288
288
  end
289
289
  resp.data
@@ -60,7 +60,7 @@ module Aws::S3
60
60
  #
61
61
  # @return [self]
62
62
  def load
63
- resp = Aws::Plugins::UserAgent.feature('resource') do
63
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
64
64
  @client.get_bucket_logging(bucket: @bucket_name)
65
65
  end
66
66
  @data = resp.data
@@ -177,7 +177,7 @@ module Aws::S3
177
177
  :retry
178
178
  end
179
179
  end
180
- Aws::Plugins::UserAgent.feature('resource') do
180
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
181
181
  Aws::Waiters::Waiter.new(options).wait({})
182
182
  end
183
183
  end
@@ -247,7 +247,7 @@ module Aws::S3
247
247
  # @return [EmptyStructure]
248
248
  def put(options = {})
249
249
  options = options.merge(bucket: @bucket_name)
250
- resp = Aws::Plugins::UserAgent.feature('resource') do
250
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
251
251
  @client.put_bucket_logging(options)
252
252
  end
253
253
  resp.data