aws-sdk-cognitoidentityprovider 1.97.0 → 1.107.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -48,6 +48,7 @@ module Aws::CognitoIdentityProvider
48
48
  # * {LimitExceededException}
49
49
  # * {MFAMethodNotFoundException}
50
50
  # * {NotAuthorizedException}
51
+ # * {PasswordHistoryPolicyViolationException}
51
52
  # * {PasswordResetRequiredException}
52
53
  # * {PreconditionNotMetException}
53
54
  # * {ResourceNotFoundException}
@@ -390,6 +391,21 @@ module Aws::CognitoIdentityProvider
390
391
  end
391
392
  end
392
393
 
394
+ class PasswordHistoryPolicyViolationException < ServiceError
395
+
396
+ # @param [Seahorse::Client::RequestContext] context
397
+ # @param [String] message
398
+ # @param [Aws::CognitoIdentityProvider::Types::PasswordHistoryPolicyViolationException] data
399
+ def initialize(context, message, data = Aws::EmptyStructure.new)
400
+ super(context, message, data)
401
+ end
402
+
403
+ # @return [String]
404
+ def message
405
+ @message || @data[:message]
406
+ end
407
+ end
408
+
393
409
  class PasswordResetRequiredException < ServiceError
394
410
 
395
411
  # @param [Seahorse::Client::RequestContext] context
@@ -15,11 +15,11 @@ module Aws::CognitoIdentityProvider
15
15
  :endpoint_provider,
16
16
  doc_type: 'Aws::CognitoIdentityProvider::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::CognitoIdentityProvider::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::CognitoIdentityProvider::EndpointParameters`.
22
+ DOCS
23
23
  Aws::CognitoIdentityProvider::EndpointProvider.new
24
24
  end
25
25
 
@@ -40,11 +40,23 @@ module Aws::CognitoIdentityProvider
40
40
  context[:auth_scheme] =
41
41
  Aws::Endpoints.resolve_auth_scheme(context, endpoint)
42
42
 
43
- @handler.call(context)
43
+ with_metrics(context) { @handler.call(context) }
44
44
  end
45
45
 
46
46
  private
47
47
 
48
+ def with_metrics(context, &block)
49
+ metrics = []
50
+ metrics << 'ENDPOINT_OVERRIDE' unless context.config.regional_endpoint
51
+ if context[:auth_scheme] && context[:auth_scheme]['name'] == 'sigv4a'
52
+ metrics << 'SIGV4A_SIGNING'
53
+ end
54
+ if context.config.credentials&.credentials&.account_id
55
+ metrics << 'RESOLVED_ACCOUNT_ID'
56
+ end
57
+ Aws::Plugins::UserAgent.metric(*metrics, &block)
58
+ end
59
+
48
60
  def apply_endpoint_headers(context, headers)
49
61
  headers.each do |key, values|
50
62
  value = values