214 214 |
|
215 215 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EnableKeyEndpointParamsInterceptor {
|
216 216 | fn name(&self) -> &'static str {
|
217 217 | "EnableKeyEndpointParamsInterceptor"
|
218 218 | }
|
219 219 |
|
220 220 | fn read_before_execution(
|
221 221 | &self,
|
222 222 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
223 223 | '_,
|
224 224 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
225 225 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
226 226 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
227 227 | >,
|
228 228 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
229 229 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
230 230 | let _input = context
|
231 231 | .input()
|
232 232 | .downcast_ref::<EnableKeyInput>()
|
233 233 | .ok_or("failed to downcast to EnableKeyInput")?;
|
234 234 |
|
235 235 | let params = crate::config::endpoint::Params::builder()
|
236 236 | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
237 237 | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
238 238 | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
239 239 | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
240 240 | .build()
|
241 241 | .map_err(|err| {
|
242 242 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
243 243 | })?;
|
244 + |
|
244 245 | cfg.interceptor_state()
|
245 246 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
247 + |
|
246 248 | ::std::result::Result::Ok(())
|
247 249 | }
|
248 250 | }
|
249 251 |
|
250 252 | // The get_* functions below are generated from JMESPath expressions in the
|
251 253 | // operationContextParams trait. They target the operation's input shape.
|
252 254 |
|
253 255 | /// Error type for the `EnableKeyError` operation.
|
254 256 | #[non_exhaustive]
|
255 257 | #[derive(::std::fmt::Debug)]
|
256 258 | pub enum EnableKeyError {
|
257 259 | /// <p>The system timed out while trying to fulfill the request. You can retry the request.</p>
|
258 260 | DependencyTimeoutException(crate::types::error::DependencyTimeoutException),
|
259 261 | /// <p>The request was rejected because a specified ARN, or an ARN in a key policy, is not valid.</p>
|
260 262 | InvalidArnException(crate::types::error::InvalidArnException),
|
261 263 | /// <p>The request was rejected because an internal exception occurred. The request can be retried.</p>
|
262 264 | KmsInternalException(crate::types::error::KmsInternalException),
|
263 265 | /// <p>The request was rejected because the state of the specified resource is not valid for this request.</p>
|
264 266 | /// <p>This exceptions means one of the following:</p>
|
265 267 | /// <ul>
|
266 268 | /// <li>
|
267 269 | /// <p>The key state of the KMS key is not compatible with the operation.</p>
|
268 270 | /// <p>To find the key state, use the <code>DescribeKey</code> operation. For more information about which key states are compatible with each KMS operation, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a> in the <i> <i>Key Management Service Developer Guide</i> </i>.</p></li>
|
269 271 | /// <li>
|
270 272 | /// <p>For cryptographic operations on KMS keys in custom key stores, this exception represents a general failure with many possible causes. To identify the cause, see the error message that accompanies the exception.</p></li>
|
271 273 | /// </ul>
|
272 274 | KmsInvalidStateException(crate::types::error::KmsInvalidStateException),
|
273 275 | /// <p>The request was rejected because a quota was exceeded. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/limits.html">Quotas</a> in the <i>Key Management Service Developer Guide</i>.</p>
|
274 276 | LimitExceededException(crate::types::error::LimitExceededException),
|
275 277 | /// <p>The request was rejected because the specified entity or resource could not be found.</p>
|