aws-sdk-s3 1.151.0 → 1.152.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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/VERSION +1 -1
  4. data/lib/aws-sdk-s3/bucket.rb +10 -10
  5. data/lib/aws-sdk-s3/bucket_acl.rb +3 -3
  6. data/lib/aws-sdk-s3/bucket_cors.rb +4 -4
  7. data/lib/aws-sdk-s3/bucket_lifecycle.rb +4 -4
  8. data/lib/aws-sdk-s3/bucket_lifecycle_configuration.rb +4 -4
  9. data/lib/aws-sdk-s3/bucket_logging.rb +3 -3
  10. data/lib/aws-sdk-s3/bucket_notification.rb +3 -3
  11. data/lib/aws-sdk-s3/bucket_policy.rb +4 -4
  12. data/lib/aws-sdk-s3/bucket_request_payment.rb +3 -3
  13. data/lib/aws-sdk-s3/bucket_tagging.rb +4 -4
  14. data/lib/aws-sdk-s3/bucket_versioning.rb +5 -5
  15. data/lib/aws-sdk-s3/bucket_website.rb +4 -4
  16. data/lib/aws-sdk-s3/client.rb +61 -61
  17. data/lib/aws-sdk-s3/client_api.rb +2 -2
  18. data/lib/aws-sdk-s3/customizations/bucket.rb +1 -1
  19. data/lib/aws-sdk-s3/customizations/object.rb +5 -5
  20. data/lib/aws-sdk-s3/encryption/client.rb +2 -2
  21. data/lib/aws-sdk-s3/encryption/kms_cipher_provider.rb +2 -2
  22. data/lib/aws-sdk-s3/encryptionV2/client.rb +2 -2
  23. data/lib/aws-sdk-s3/encryptionV2/kms_cipher_provider.rb +2 -2
  24. data/lib/aws-sdk-s3/endpoint_parameters.rb +8 -0
  25. data/lib/aws-sdk-s3/endpoint_provider.rb +1 -0
  26. data/lib/aws-sdk-s3/endpoints.rb +100 -1
  27. data/lib/aws-sdk-s3/file_downloader.rb +1 -1
  28. data/lib/aws-sdk-s3/file_uploader.rb +1 -1
  29. data/lib/aws-sdk-s3/multipart_stream_uploader.rb +1 -1
  30. data/lib/aws-sdk-s3/multipart_upload.rb +4 -4
  31. data/lib/aws-sdk-s3/multipart_upload_part.rb +3 -3
  32. data/lib/aws-sdk-s3/object.rb +12 -12
  33. data/lib/aws-sdk-s3/object_acl.rb +3 -3
  34. data/lib/aws-sdk-s3/object_copier.rb +1 -1
  35. data/lib/aws-sdk-s3/object_summary.rb +10 -10
  36. data/lib/aws-sdk-s3/object_version.rb +5 -5
  37. data/lib/aws-sdk-s3/plugins/access_grants.rb +7 -1
  38. data/lib/aws-sdk-s3/plugins/express_session_auth.rb +7 -1
  39. data/lib/aws-sdk-s3/resource.rb +2 -2
  40. data/lib/aws-sdk-s3.rb +1 -1
  41. metadata +4 -4
@@ -44,7 +44,7 @@ module Aws
44
44
 
45
45
  validate!
46
46
 
47
- Aws::Plugins::UserAgent.feature('s3-transfer') do
47
+ Aws::Plugins::UserAgent.metric('S3_TRANSFER') do
48
48
  case @mode
49
49
  when 'auto' then multipart_download
50
50
  when 'single_request' then single_request
@@ -37,7 +37,7 @@ module Aws
37
37
  # objects smaller than the multipart threshold.
38
38
  # @return [void]
39
39
  def upload(source, options = {})
40
- Aws::Plugins::UserAgent.feature('s3-transfer') do
40
+ Aws::Plugins::UserAgent.metric('S3_TRANSFER') do
41
41
  if File.size(source) >= multipart_threshold
42
42
  MultipartFileUploader.new(@options).upload(source, options)
43
43
  else
@@ -46,7 +46,7 @@ module Aws
46
46
  # @option options [Integer] :thread_count (THREAD_COUNT)
47
47
  # @return [Seahorse::Client::Response] - the CompleteMultipartUploadResponse
48
48
  def upload(options = {}, &block)
49
- Aws::Plugins::UserAgent.feature('s3-transfer') do
49
+ Aws::Plugins::UserAgent.metric('S3_TRANSFER') do
50
50
  upload_id = initiate_upload(options)
51
51
  parts = upload_parts(upload_id, options, &block)
52
52
  complete_upload(upload_id, parts, options)
@@ -227,7 +227,7 @@ module Aws::S3
227
227
  :retry
228
228
  end
229
229
  end
230
- Aws::Plugins::UserAgent.feature('resource') do
230
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
231
231
  Aws::Waiters::Waiter.new(options).wait({})
232
232
  end
233
233
  end
@@ -268,7 +268,7 @@ module Aws::S3
268
268
  key: @object_key,
269
269
  upload_id: @id
270
270
  )
271
- resp = Aws::Plugins::UserAgent.feature('resource') do
271
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
272
272
  @client.abort_multipart_upload(options)
273
273
  end
274
274
  resp.data
@@ -409,7 +409,7 @@ module Aws::S3
409
409
  key: @object_key,
410
410
  upload_id: @id
411
411
  )
412
- Aws::Plugins::UserAgent.feature('resource') do
412
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
413
413
  @client.complete_multipart_upload(options)
414
414
  end
415
415
  Object.new(
@@ -519,7 +519,7 @@ module Aws::S3
519
519
  key: @object_key,
520
520
  upload_id: @id
521
521
  )
522
- resp = Aws::Plugins::UserAgent.feature('resource') do
522
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
523
523
  @client.list_parts(options)
524
524
  end
525
525
  resp.each_page do |page|
@@ -262,7 +262,7 @@ module Aws::S3
262
262
  :retry
263
263
  end
264
264
  end
265
- Aws::Plugins::UserAgent.feature('resource') do
265
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
266
266
  Aws::Waiters::Waiter.new(options).wait({})
267
267
  end
268
268
  end
@@ -500,7 +500,7 @@ module Aws::S3
500
500
  upload_id: @multipart_upload_id,
501
501
  part_number: @part_number
502
502
  )
503
- resp = Aws::Plugins::UserAgent.feature('resource') do
503
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
504
504
  @client.upload_part_copy(options)
505
505
  end
506
506
  resp.data
@@ -650,7 +650,7 @@ module Aws::S3
650
650
  upload_id: @multipart_upload_id,
651
651
  part_number: @part_number
652
652
  )
653
- resp = Aws::Plugins::UserAgent.feature('resource') do
653
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
654
654
  @client.upload_part(options)
655
655
  end
656
656
  resp.data
@@ -500,7 +500,7 @@ module Aws::S3
500
500
  #
501
501
  # @return [self]
502
502
  def load
503
- resp = Aws::Plugins::UserAgent.feature('resource') do
503
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
504
504
  @client.head_object(
505
505
  bucket: @bucket_name,
506
506
  key: @key
@@ -550,7 +550,7 @@ module Aws::S3
550
550
  options, params = separate_params_and_options(options)
551
551
  waiter = Waiters::ObjectExists.new(options)
552
552
  yield_waiter_and_warn(waiter, &block) if block_given?
553
- Aws::Plugins::UserAgent.feature('resource') do
553
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
554
554
  waiter.wait(params.merge(bucket: @bucket_name,
555
555
  key: @key))
556
556
  end
@@ -571,7 +571,7 @@ module Aws::S3
571
571
  options, params = separate_params_and_options(options)
572
572
  waiter = Waiters::ObjectNotExists.new(options)
573
573
  yield_waiter_and_warn(waiter, &block) if block_given?
574
- Aws::Plugins::UserAgent.feature('resource') do
574
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
575
575
  waiter.wait(params.merge(bucket: @bucket_name,
576
576
  key: @key))
577
577
  end
@@ -676,7 +676,7 @@ module Aws::S3
676
676
  :retry
677
677
  end
678
678
  end
679
- Aws::Plugins::UserAgent.feature('resource') do
679
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
680
680
  Aws::Waiters::Waiter.new(options).wait({})
681
681
  end
682
682
  end
@@ -1346,7 +1346,7 @@ module Aws::S3
1346
1346
  bucket: @bucket_name,
1347
1347
  key: @key
1348
1348
  )
1349
- resp = Aws::Plugins::UserAgent.feature('resource') do
1349
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1350
1350
  @client.copy_object(options)
1351
1351
  end
1352
1352
  resp.data
@@ -1412,7 +1412,7 @@ module Aws::S3
1412
1412
  bucket: @bucket_name,
1413
1413
  key: @key
1414
1414
  )
1415
- resp = Aws::Plugins::UserAgent.feature('resource') do
1415
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1416
1416
  @client.delete_object(options)
1417
1417
  end
1418
1418
  resp.data
@@ -1668,7 +1668,7 @@ module Aws::S3
1668
1668
  bucket: @bucket_name,
1669
1669
  key: @key
1670
1670
  )
1671
- resp = Aws::Plugins::UserAgent.feature('resource') do
1671
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1672
1672
  @client.get_object(options, &block)
1673
1673
  end
1674
1674
  resp.data
@@ -2153,7 +2153,7 @@ module Aws::S3
2153
2153
  bucket: @bucket_name,
2154
2154
  key: @key
2155
2155
  )
2156
- resp = Aws::Plugins::UserAgent.feature('resource') do
2156
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
2157
2157
  @client.create_multipart_upload(options)
2158
2158
  end
2159
2159
  MultipartUpload.new(
@@ -2624,7 +2624,7 @@ module Aws::S3
2624
2624
  bucket: @bucket_name,
2625
2625
  key: @key
2626
2626
  )
2627
- resp = Aws::Plugins::UserAgent.feature('resource') do
2627
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
2628
2628
  @client.put_object(options)
2629
2629
  end
2630
2630
  resp.data
@@ -2765,7 +2765,7 @@ module Aws::S3
2765
2765
  bucket: @bucket_name,
2766
2766
  key: @key
2767
2767
  )
2768
- resp = Aws::Plugins::UserAgent.feature('resource') do
2768
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
2769
2769
  @client.restore_object(options)
2770
2770
  end
2771
2771
  resp.data
@@ -2936,7 +2936,7 @@ module Aws::S3
2936
2936
  bucket: @bucket_name,
2937
2937
  key: @key
2938
2938
  )
2939
- resp = Aws::Plugins::UserAgent.feature('resource') do
2939
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
2940
2940
  @client.head_object(options)
2941
2941
  end
2942
2942
  resp.data
@@ -3154,7 +3154,7 @@ module Aws::S3
3154
3154
  key: item.key
3155
3155
  }
3156
3156
  end
3157
- Aws::Plugins::UserAgent.feature('resource') do
3157
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
3158
3158
  batch[0].client.delete_objects(params)
3159
3159
  end
3160
3160
  end
@@ -79,7 +79,7 @@ module Aws::S3
79
79
  #
80
80
  # @return [self]
81
81
  def load
82
- resp = Aws::Plugins::UserAgent.feature('resource') do
82
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
83
83
  @client.get_object_acl(
84
84
  bucket: @bucket_name,
85
85
  key: @object_key
@@ -199,7 +199,7 @@ module Aws::S3
199
199
  :retry
200
200
  end
201
201
  end
202
- Aws::Plugins::UserAgent.feature('resource') do
202
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
203
203
  Aws::Waiters::Waiter.new(options).wait({})
204
204
  end
205
205
  end
@@ -332,7 +332,7 @@ module Aws::S3
332
332
  bucket: @bucket_name,
333
333
  key: @object_key
334
334
  )
335
- resp = Aws::Plugins::UserAgent.feature('resource') do
335
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
336
336
  @client.put_object_acl(options)
337
337
  end
338
338
  resp.data
@@ -28,7 +28,7 @@ module Aws
28
28
  options[:bucket] = target_bucket
29
29
  options[:key] = target_key
30
30
  options[:copy_source] = copy_source(source)
31
- Aws::Plugins::UserAgent.feature('s3-transfer') do
31
+ Aws::Plugins::UserAgent.metric('S3_TRANSFER') do
32
32
  if options.delete(:multipart_copy)
33
33
  apply_source_client(source, options)
34
34
  ObjectMultipartCopier.new(@options).copy(options)
@@ -186,7 +186,7 @@ module Aws::S3
186
186
  options, params = separate_params_and_options(options)
187
187
  waiter = Waiters::ObjectExists.new(options)
188
188
  yield_waiter_and_warn(waiter, &block) if block_given?
189
- Aws::Plugins::UserAgent.feature('resource') do
189
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
190
190
  waiter.wait(params.merge(bucket: @bucket_name,
191
191
  key: @key))
192
192
  end
@@ -207,7 +207,7 @@ module Aws::S3
207
207
  options, params = separate_params_and_options(options)
208
208
  waiter = Waiters::ObjectNotExists.new(options)
209
209
  yield_waiter_and_warn(waiter, &block) if block_given?
210
- Aws::Plugins::UserAgent.feature('resource') do
210
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
211
211
  waiter.wait(params.merge(bucket: @bucket_name,
212
212
  key: @key))
213
213
  end
@@ -312,7 +312,7 @@ module Aws::S3
312
312
  :retry
313
313
  end
314
314
  end
315
- Aws::Plugins::UserAgent.feature('resource') do
315
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
316
316
  Aws::Waiters::Waiter.new(options).wait({})
317
317
  end
318
318
  end
@@ -982,7 +982,7 @@ module Aws::S3
982
982
  bucket: @bucket_name,
983
983
  key: @key
984
984
  )
985
- resp = Aws::Plugins::UserAgent.feature('resource') do
985
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
986
986
  @client.copy_object(options)
987
987
  end
988
988
  resp.data
@@ -1048,7 +1048,7 @@ module Aws::S3
1048
1048
  bucket: @bucket_name,
1049
1049
  key: @key
1050
1050
  )
1051
- resp = Aws::Plugins::UserAgent.feature('resource') do
1051
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1052
1052
  @client.delete_object(options)
1053
1053
  end
1054
1054
  resp.data
@@ -1304,7 +1304,7 @@ module Aws::S3
1304
1304
  bucket: @bucket_name,
1305
1305
  key: @key
1306
1306
  )
1307
- resp = Aws::Plugins::UserAgent.feature('resource') do
1307
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1308
1308
  @client.get_object(options, &block)
1309
1309
  end
1310
1310
  resp.data
@@ -1789,7 +1789,7 @@ module Aws::S3
1789
1789
  bucket: @bucket_name,
1790
1790
  key: @key
1791
1791
  )
1792
- resp = Aws::Plugins::UserAgent.feature('resource') do
1792
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
1793
1793
  @client.create_multipart_upload(options)
1794
1794
  end
1795
1795
  MultipartUpload.new(
@@ -2260,7 +2260,7 @@ module Aws::S3
2260
2260
  bucket: @bucket_name,
2261
2261
  key: @key
2262
2262
  )
2263
- resp = Aws::Plugins::UserAgent.feature('resource') do
2263
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
2264
2264
  @client.put_object(options)
2265
2265
  end
2266
2266
  resp.data
@@ -2401,7 +2401,7 @@ module Aws::S3
2401
2401
  bucket: @bucket_name,
2402
2402
  key: @key
2403
2403
  )
2404
- resp = Aws::Plugins::UserAgent.feature('resource') do
2404
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
2405
2405
  @client.restore_object(options)
2406
2406
  end
2407
2407
  resp.data
@@ -2628,7 +2628,7 @@ module Aws::S3
2628
2628
  key: item.key
2629
2629
  }
2630
2630
  end
2631
- Aws::Plugins::UserAgent.feature('resource') do
2631
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
2632
2632
  batch[0].client.delete_objects(params)
2633
2633
  end
2634
2634
  end
@@ -243,7 +243,7 @@ module Aws::S3
243
243
  :retry
244
244
  end
245
245
  end
246
- Aws::Plugins::UserAgent.feature('resource') do
246
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
247
247
  Aws::Waiters::Waiter.new(options).wait({})
248
248
  end
249
249
  end
@@ -303,7 +303,7 @@ module Aws::S3
303
303
  key: @object_key,
304
304
  version_id: @id
305
305
  )
306
- resp = Aws::Plugins::UserAgent.feature('resource') do
306
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
307
307
  @client.delete_object(options)
308
308
  end
309
309
  resp.data
@@ -530,7 +530,7 @@ module Aws::S3
530
530
  key: @object_key,
531
531
  version_id: @id
532
532
  )
533
- resp = Aws::Plugins::UserAgent.feature('resource') do
533
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
534
534
  @client.get_object(options, &block)
535
535
  end
536
536
  resp.data
@@ -694,7 +694,7 @@ module Aws::S3
694
694
  key: @object_key,
695
695
  version_id: @id
696
696
  )
697
- resp = Aws::Plugins::UserAgent.feature('resource') do
697
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
698
698
  @client.head_object(options)
699
699
  end
700
700
  resp.data
@@ -868,7 +868,7 @@ module Aws::S3
868
868
  version_id: item.id
869
869
  }
870
870
  end
871
- Aws::Plugins::UserAgent.feature('resource') do
871
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
872
872
  batch[0].client.delete_objects(params)
873
873
  end
874
874
  end
@@ -69,11 +69,17 @@ setting, caching, and fallback behavior.
69
69
  context[:sigv4_credentials] = credentials # Sign will use this
70
70
  end
71
71
 
72
- @handler.call(context)
72
+ with_metric(credentials) { @handler.call(context) }
73
73
  end
74
74
 
75
75
  private
76
76
 
77
+ def with_metric(credentials, &block)
78
+ return block.call unless credentials
79
+
80
+ Aws::Plugins::UserAgent.metric('S3_ACCESS_GRANTS', &block)
81
+ end
82
+
77
83
  def access_grants_operation?(context)
78
84
  params = context[:endpoint_params]
79
85
  params[:bucket] && PERMISSION_MAP[context.operation_name]
@@ -47,11 +47,17 @@ for different buckets.
47
47
  context[:sigv4_credentials] = credentials # Sign will use this
48
48
  end
49
49
  end
50
- @handler.call(context)
50
+ with_metric(credentials) { @handler.call(context) }
51
51
  end
52
52
 
53
53
  private
54
54
 
55
+ def with_metric(credentials, &block)
56
+ return block.call unless credentials
57
+
58
+ Aws::Plugins::UserAgent.metric('S3_EXPRESS_BUCKET', &block)
59
+ end
60
+
55
61
  def checksum_required?(context)
56
62
  context.operation.http_checksum_required ||
57
63
  (context.operation.http_checksum &&
@@ -166,7 +166,7 @@ module Aws::S3
166
166
  # [1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html
167
167
  # @return [Bucket]
168
168
  def create_bucket(options = {})
169
- Aws::Plugins::UserAgent.feature('resource') do
169
+ Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
170
170
  @client.create_bucket(options)
171
171
  end
172
172
  Bucket.new(
@@ -194,7 +194,7 @@ module Aws::S3
194
194
  def buckets(options = {})
195
195
  batches = Enumerator.new do |y|
196
196
  batch = []
197
- resp = Aws::Plugins::UserAgent.feature('resource') do
197
+ resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
198
198
  @client.list_buckets(options)
199
199
  end
200
200
  resp.data.buckets.each do |b|
data/lib/aws-sdk-s3.rb CHANGED
@@ -73,6 +73,6 @@ require_relative 'aws-sdk-s3/event_streams'
73
73
  # @!group service
74
74
  module Aws::S3
75
75
 
76
- GEM_VERSION = '1.151.0'
76
+ GEM_VERSION = '1.152.0'
77
77
 
78
78
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.151.0
4
+ version: 1.152.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-14 00:00:00.000000000 Z
11
+ date: 2024-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-kms
@@ -47,7 +47,7 @@ dependencies:
47
47
  version: '3'
48
48
  - - ">="
49
49
  - !ruby/object:Gem::Version
50
- version: 3.194.0
50
+ version: 3.197.0
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -57,7 +57,7 @@ dependencies:
57
57
  version: '3'
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 3.194.0
60
+ version: 3.197.0
61
61
  description: Official AWS Ruby gem for Amazon Simple Storage Service (Amazon S3).
62
62
  This gem is part of the AWS SDK for Ruby.
63
63
  email: