aws-sdk-s3 1.157.0 → 1.166.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.
@@ -15,19 +15,22 @@ module Aws::S3
15
15
  :endpoint_provider,
16
16
  doc_type: 'Aws::S3::EndpointProvider',
17
17
  rbs_type: 'untyped',
18
- docstring: 'The endpoint provider used to resolve endpoints. Any '\
19
- 'object that responds to `#resolve_endpoint(parameters)` '\
20
- 'where `parameters` is a Struct similar to '\
21
- '`Aws::S3::EndpointParameters`'
22
- ) do |cfg|
18
+ docstring: <<~DOCS) do |_cfg|
19
+ The endpoint provider used to resolve endpoints. Any object that responds to
20
+ `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
21
+ `Aws::S3::EndpointParameters`.
22
+ DOCS
23
23
  Aws::S3::EndpointProvider.new
24
24
  end
25
25
 
26
26
  option(
27
27
  :disable_s3_express_session_auth,
28
28
  doc_type: 'Boolean',
29
- default: nil,
30
- docstring: "Parameter to indicate whether S3Express session auth should be disabled")
29
+ docstring: <<~DOCS) do |cfg|
30
+ Parameter to indicate whether S3Express session auth should be disabled
31
+ DOCS
32
+ nil
33
+ end
31
34
 
32
35
  # @api private
33
36
  class Handler < Seahorse::Client::Handler
@@ -46,11 +49,23 @@ module Aws::S3
46
49
  context[:auth_scheme] =
47
50
  Aws::Endpoints.resolve_auth_scheme(context, endpoint)
48
51
 
49
- @handler.call(context)
52
+ with_metrics(context) { @handler.call(context) }
50
53
  end
51
54
 
52
55
  private
53
56
 
57
+ def with_metrics(context, &block)
58
+ metrics = []
59
+ metrics << 'ENDPOINT_OVERRIDE' unless context.config.regional_endpoint
60
+ if context[:auth_scheme] && context[:auth_scheme]['name'] == 'sigv4a'
61
+ metrics << 'SIGV4A_SIGNING'
62
+ end
63
+ if context.config.credentials&.credentials&.account_id
64
+ metrics << 'RESOLVED_ACCOUNT_ID'
65
+ end
66
+ Aws::Plugins::UserAgent.metric(*metrics, &block)
67
+ end
68
+
54
69
  def apply_endpoint_headers(context, headers)
55
70
  headers.each do |key, values|
56
71
  value = values
@@ -193,18 +193,20 @@ module Aws::S3
193
193
  # @return [Bucket::Collection]
194
194
  def buckets(options = {})
195
195
  batches = Enumerator.new do |y|
196
- batch = []
197
196
  resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
198
197
  @client.list_buckets(options)
199
198
  end
200
- resp.data.buckets.each do |b|
201
- batch << Bucket.new(
202
- name: b.name,
203
- data: b,
204
- client: @client
205
- )
199
+ resp.each_page do |page|
200
+ batch = []
201
+ page.data.buckets.each do |b|
202
+ batch << Bucket.new(
203
+ name: b.name,
204
+ data: b,
205
+ client: @client
206
+ )
207
+ end
208
+ y.yield(batch)
206
209
  end
207
- y.yield(batch)
208
210
  end
209
211
  Bucket::Collection.new(batches)
210
212
  end