aws-sdk-kms 1.76.0 → 1.118.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.
@@ -33,6 +33,7 @@ module Aws::KMS
33
33
  # * {CloudHsmClusterNotActiveException}
34
34
  # * {CloudHsmClusterNotFoundException}
35
35
  # * {CloudHsmClusterNotRelatedException}
36
+ # * {ConflictException}
36
37
  # * {CustomKeyStoreHasCMKsException}
37
38
  # * {CustomKeyStoreInvalidStateException}
38
39
  # * {CustomKeyStoreNameInUseException}
@@ -171,6 +172,21 @@ module Aws::KMS
171
172
  end
172
173
  end
173
174
 
175
+ class ConflictException < ServiceError
176
+
177
+ # @param [Seahorse::Client::RequestContext] context
178
+ # @param [String] message
179
+ # @param [Aws::KMS::Types::ConflictException] data
180
+ def initialize(context, message, data = Aws::EmptyStructure.new)
181
+ super(context, message, data)
182
+ end
183
+
184
+ # @return [String]
185
+ def message
186
+ @message || @data[:message]
187
+ end
188
+ end
189
+
174
190
  class CustomKeyStoreHasCMKsException < ServiceError
175
191
 
176
192
  # @param [Seahorse::Client::RequestContext] context
@@ -14,11 +14,12 @@ module Aws::KMS
14
14
  option(
15
15
  :endpoint_provider,
16
16
  doc_type: 'Aws::KMS::EndpointProvider',
17
- docstring: 'The endpoint provider used to resolve endpoints. Any '\
18
- 'object that responds to `#resolve_endpoint(parameters)` '\
19
- 'where `parameters` is a Struct similar to '\
20
- '`Aws::KMS::EndpointParameters`'
21
- ) do |cfg|
17
+ rbs_type: 'untyped',
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::KMS::EndpointParameters`.
22
+ DOCS
22
23
  Aws::KMS::EndpointProvider.new
23
24
  end
24
25
 
@@ -26,7 +27,7 @@ module Aws::KMS
26
27
  class Handler < Seahorse::Client::Handler
27
28
  def call(context)
28
29
  unless context[:discovered_endpoint]
29
- params = parameters_for_operation(context)
30
+ params = Aws::KMS::Endpoints.parameters_for_operation(context)
30
31
  endpoint = context.config.endpoint_provider.resolve_endpoint(params)
31
32
 
32
33
  context.http_request.endpoint = endpoint.url
@@ -39,11 +40,23 @@ module Aws::KMS
39
40
  context[:auth_scheme] =
40
41
  Aws::Endpoints.resolve_auth_scheme(context, endpoint)
41
42
 
42
- @handler.call(context)
43
+ with_metrics(context) { @handler.call(context) }
43
44
  end
44
45
 
45
46
  private
46
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
+
47
60
  def apply_endpoint_headers(context, headers)
48
61
  headers.each do |key, values|
49
62
  value = values
@@ -54,111 +67,6 @@ module Aws::KMS
54
67
  context.http_request.headers[key] = value
55
68
  end
56
69
  end
57
-
58
- def parameters_for_operation(context)
59
- case context.operation_name
60
- when :cancel_key_deletion
61
- Aws::KMS::Endpoints::CancelKeyDeletion.build(context)
62
- when :connect_custom_key_store
63
- Aws::KMS::Endpoints::ConnectCustomKeyStore.build(context)
64
- when :create_alias
65
- Aws::KMS::Endpoints::CreateAlias.build(context)
66
- when :create_custom_key_store
67
- Aws::KMS::Endpoints::CreateCustomKeyStore.build(context)
68
- when :create_grant
69
- Aws::KMS::Endpoints::CreateGrant.build(context)
70
- when :create_key
71
- Aws::KMS::Endpoints::CreateKey.build(context)
72
- when :decrypt
73
- Aws::KMS::Endpoints::Decrypt.build(context)
74
- when :delete_alias
75
- Aws::KMS::Endpoints::DeleteAlias.build(context)
76
- when :delete_custom_key_store
77
- Aws::KMS::Endpoints::DeleteCustomKeyStore.build(context)
78
- when :delete_imported_key_material
79
- Aws::KMS::Endpoints::DeleteImportedKeyMaterial.build(context)
80
- when :describe_custom_key_stores
81
- Aws::KMS::Endpoints::DescribeCustomKeyStores.build(context)
82
- when :describe_key
83
- Aws::KMS::Endpoints::DescribeKey.build(context)
84
- when :disable_key
85
- Aws::KMS::Endpoints::DisableKey.build(context)
86
- when :disable_key_rotation
87
- Aws::KMS::Endpoints::DisableKeyRotation.build(context)
88
- when :disconnect_custom_key_store
89
- Aws::KMS::Endpoints::DisconnectCustomKeyStore.build(context)
90
- when :enable_key
91
- Aws::KMS::Endpoints::EnableKey.build(context)
92
- when :enable_key_rotation
93
- Aws::KMS::Endpoints::EnableKeyRotation.build(context)
94
- when :encrypt
95
- Aws::KMS::Endpoints::Encrypt.build(context)
96
- when :generate_data_key
97
- Aws::KMS::Endpoints::GenerateDataKey.build(context)
98
- when :generate_data_key_pair
99
- Aws::KMS::Endpoints::GenerateDataKeyPair.build(context)
100
- when :generate_data_key_pair_without_plaintext
101
- Aws::KMS::Endpoints::GenerateDataKeyPairWithoutPlaintext.build(context)
102
- when :generate_data_key_without_plaintext
103
- Aws::KMS::Endpoints::GenerateDataKeyWithoutPlaintext.build(context)
104
- when :generate_mac
105
- Aws::KMS::Endpoints::GenerateMac.build(context)
106
- when :generate_random
107
- Aws::KMS::Endpoints::GenerateRandom.build(context)
108
- when :get_key_policy
109
- Aws::KMS::Endpoints::GetKeyPolicy.build(context)
110
- when :get_key_rotation_status
111
- Aws::KMS::Endpoints::GetKeyRotationStatus.build(context)
112
- when :get_parameters_for_import
113
- Aws::KMS::Endpoints::GetParametersForImport.build(context)
114
- when :get_public_key
115
- Aws::KMS::Endpoints::GetPublicKey.build(context)
116
- when :import_key_material
117
- Aws::KMS::Endpoints::ImportKeyMaterial.build(context)
118
- when :list_aliases
119
- Aws::KMS::Endpoints::ListAliases.build(context)
120
- when :list_grants
121
- Aws::KMS::Endpoints::ListGrants.build(context)
122
- when :list_key_policies
123
- Aws::KMS::Endpoints::ListKeyPolicies.build(context)
124
- when :list_keys
125
- Aws::KMS::Endpoints::ListKeys.build(context)
126
- when :list_resource_tags
127
- Aws::KMS::Endpoints::ListResourceTags.build(context)
128
- when :list_retirable_grants
129
- Aws::KMS::Endpoints::ListRetirableGrants.build(context)
130
- when :put_key_policy
131
- Aws::KMS::Endpoints::PutKeyPolicy.build(context)
132
- when :re_encrypt
133
- Aws::KMS::Endpoints::ReEncrypt.build(context)
134
- when :replicate_key
135
- Aws::KMS::Endpoints::ReplicateKey.build(context)
136
- when :retire_grant
137
- Aws::KMS::Endpoints::RetireGrant.build(context)
138
- when :revoke_grant
139
- Aws::KMS::Endpoints::RevokeGrant.build(context)
140
- when :schedule_key_deletion
141
- Aws::KMS::Endpoints::ScheduleKeyDeletion.build(context)
142
- when :sign
143
- Aws::KMS::Endpoints::Sign.build(context)
144
- when :tag_resource
145
- Aws::KMS::Endpoints::TagResource.build(context)
146
- when :untag_resource
147
- Aws::KMS::Endpoints::UntagResource.build(context)
148
- when :update_alias
149
- Aws::KMS::Endpoints::UpdateAlias.build(context)
150
- when :update_custom_key_store
151
- Aws::KMS::Endpoints::UpdateCustomKeyStore.build(context)
152
- when :update_key_description
153
- Aws::KMS::Endpoints::UpdateKeyDescription.build(context)
154
- when :update_primary_region
155
- Aws::KMS::Endpoints::UpdatePrimaryRegion.build(context)
156
- when :verify
157
- Aws::KMS::Endpoints::Verify.build(context)
158
- when :verify_mac
159
- Aws::KMS::Endpoints::VerifyMac.build(context)
160
- end
161
- end
162
70
  end
163
71
 
164
72
  def add_handlers(handlers, _config)