Skip to main content

aws_sdk_kms/operation/
create_custom_key_store.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `CreateCustomKeyStore`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateCustomKeyStore;
6impl CreateCustomKeyStore {
7    /// Creates a new `CreateCustomKeyStore`
8    pub fn new() -> Self {
9        Self
10    }
11    /// The schema for this operation's input shape.
12    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
13        crate::operation::create_custom_key_store::CreateCustomKeyStoreInput::SCHEMA;
14    /// The schema for this operation's output shape.
15    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
16        crate::operation::create_custom_key_store::CreateCustomKeyStoreOutput::SCHEMA;
17    pub(crate) async fn orchestrate(
18        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
19        input: crate::operation::create_custom_key_store::CreateCustomKeyStoreInput,
20    ) -> ::std::result::Result<
21        crate::operation::create_custom_key_store::CreateCustomKeyStoreOutput,
22        ::aws_smithy_runtime_api::client::result::SdkError<
23            crate::operation::create_custom_key_store::CreateCustomKeyStoreError,
24            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
25        >,
26    > {
27        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
28            ::aws_smithy_runtime_api::client::interceptors::context::Error,
29            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
30        >| {
31            err.map_service_error(|err| {
32                err.downcast::<crate::operation::create_custom_key_store::CreateCustomKeyStoreError>()
33                    .expect("correct error type")
34            })
35        };
36        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
37            .await
38            .map_err(map_err)?;
39        let output = context.finalize().map_err(map_err)?;
40        ::std::result::Result::Ok(
41            output
42                .downcast::<crate::operation::create_custom_key_store::CreateCustomKeyStoreOutput>()
43                .expect("correct output type"),
44        )
45    }
46
47    pub(crate) async fn orchestrate_with_stop_point(
48        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
49        input: crate::operation::create_custom_key_store::CreateCustomKeyStoreInput,
50        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
51    ) -> ::std::result::Result<
52        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
53        ::aws_smithy_runtime_api::client::result::SdkError<
54            ::aws_smithy_runtime_api::client::interceptors::context::Error,
55            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
56        >,
57    > {
58        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
59        use ::tracing::Instrument;
60        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("KMS", "CreateCustomKeyStore", input, runtime_plugins, stop_point)
61            // Create a parent span for the entire operation. Includes a random, internal-only,
62            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
63            .instrument(::tracing::debug_span!(
64                "KMS.CreateCustomKeyStore",
65                "rpc.service" = "KMS",
66                "rpc.method" = "CreateCustomKeyStore",
67                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
68                "rpc.system" = "aws-api",
69            ))
70            .await
71    }
72
73    pub(crate) fn operation_runtime_plugins(
74        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
75        client_config: &crate::config::Config,
76        config_override: ::std::option::Option<crate::config::Builder>,
77    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
78        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
79
80        if let ::std::option::Option::Some(config_override) = config_override {
81            for plugin in config_override.runtime_plugins.iter().cloned() {
82                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
83            }
84            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
85                config_override,
86                client_config.config.clone(),
87                &client_config.runtime_components,
88            ));
89        }
90        runtime_plugins
91    }
92}
93/// Per-operation error registry. Contains an entry for every modeled
94/// error this operation can throw.
95///
96/// Used by the schema-serde error path as the operation-scoped lookup
97/// for registry-backed error reification: an error code that does not
98/// match one of the operation's modeled errors directly is resolved
99/// against this registry first, then widened to the service-wide error
100/// registry.
101pub(crate) mod error_registry {
102    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
103        ::aws_smithy_schema::registry::TypeRegistry::builder()
104                            .insert_error_shape(
105                        crate::types::error::CloudHsmClusterInUseException::SCHEMA,
106                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
107                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::CloudHsmClusterInUseException::deserialize(d)?))
108                        },
109                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
110                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::CloudHsmClusterInUseException::deserialize(d)?))
111                        },
112                    )
113.insert_error_shape(
114                        crate::types::error::CloudHsmClusterInvalidConfigurationException::SCHEMA,
115                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
116                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::CloudHsmClusterInvalidConfigurationException::deserialize(d)?))
117                        },
118                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
119                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::CloudHsmClusterInvalidConfigurationException::deserialize(d)?))
120                        },
121                    )
122.insert_error_shape(
123                        crate::types::error::CloudHsmClusterNotActiveException::SCHEMA,
124                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
125                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::CloudHsmClusterNotActiveException::deserialize(d)?))
126                        },
127                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
128                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::CloudHsmClusterNotActiveException::deserialize(d)?))
129                        },
130                    )
131.insert_error_shape(
132                        crate::types::error::CloudHsmClusterNotFoundException::SCHEMA,
133                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
134                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::CloudHsmClusterNotFoundException::deserialize(d)?))
135                        },
136                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
137                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::CloudHsmClusterNotFoundException::deserialize(d)?))
138                        },
139                    )
140.insert_error_shape(
141                        crate::types::error::CustomKeyStoreNameInUseException::SCHEMA,
142                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
143                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::CustomKeyStoreNameInUseException::deserialize(d)?))
144                        },
145                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
146                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::CustomKeyStoreNameInUseException::deserialize(d)?))
147                        },
148                    )
149.insert_error_shape(
150                        crate::types::error::IncorrectTrustAnchorException::SCHEMA,
151                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
152                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::IncorrectTrustAnchorException::deserialize(d)?))
153                        },
154                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
155                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::IncorrectTrustAnchorException::deserialize(d)?))
156                        },
157                    )
158.insert_error_shape(
159                        crate::types::error::KmsInternalException::SCHEMA,
160                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
161                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::KmsInternalException::deserialize(d)?))
162                        },
163                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
164                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::KmsInternalException::deserialize(d)?))
165                        },
166                    )
167.insert_error_shape(
168                        crate::types::error::LimitExceededException::SCHEMA,
169                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
170                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::LimitExceededException::deserialize(d)?))
171                        },
172                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
173                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::LimitExceededException::deserialize(d)?))
174                        },
175                    )
176.insert_error_shape(
177                        crate::types::error::XksProxyIncorrectAuthenticationCredentialException::SCHEMA,
178                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
179                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::XksProxyIncorrectAuthenticationCredentialException::deserialize(d)?))
180                        },
181                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
182                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::XksProxyIncorrectAuthenticationCredentialException::deserialize(d)?))
183                        },
184                    )
185.insert_error_shape(
186                        crate::types::error::XksProxyInvalidConfigurationException::SCHEMA,
187                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
188                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::XksProxyInvalidConfigurationException::deserialize(d)?))
189                        },
190                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
191                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::XksProxyInvalidConfigurationException::deserialize(d)?))
192                        },
193                    )
194.insert_error_shape(
195                        crate::types::error::XksProxyInvalidResponseException::SCHEMA,
196                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
197                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::XksProxyInvalidResponseException::deserialize(d)?))
198                        },
199                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
200                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::XksProxyInvalidResponseException::deserialize(d)?))
201                        },
202                    )
203.insert_error_shape(
204                        crate::types::error::XksProxyUriEndpointInUseException::SCHEMA,
205                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
206                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::XksProxyUriEndpointInUseException::deserialize(d)?))
207                        },
208                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
209                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::XksProxyUriEndpointInUseException::deserialize(d)?))
210                        },
211                    )
212.insert_error_shape(
213                        crate::types::error::XksProxyUriInUseException::SCHEMA,
214                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
215                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::XksProxyUriInUseException::deserialize(d)?))
216                        },
217                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
218                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::XksProxyUriInUseException::deserialize(d)?))
219                        },
220                    )
221.insert_error_shape(
222                        crate::types::error::XksProxyUriUnreachableException::SCHEMA,
223                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
224                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::XksProxyUriUnreachableException::deserialize(d)?))
225                        },
226                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
227                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::XksProxyUriUnreachableException::deserialize(d)?))
228                        },
229                    )
230.insert_error_shape(
231                        crate::types::error::XksProxyVpcEndpointServiceInUseException::SCHEMA,
232                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
233                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::XksProxyVpcEndpointServiceInUseException::deserialize(d)?))
234                        },
235                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
236                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::XksProxyVpcEndpointServiceInUseException::deserialize(d)?))
237                        },
238                    )
239.insert_error_shape(
240                        crate::types::error::XksProxyVpcEndpointServiceInvalidConfigurationException::SCHEMA,
241                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
242                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::XksProxyVpcEndpointServiceInvalidConfigurationException::deserialize(d)?))
243                        },
244                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
245                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::XksProxyVpcEndpointServiceInvalidConfigurationException::deserialize(d)?))
246                        },
247                    )
248.insert_error_shape(
249                        crate::types::error::XksProxyVpcEndpointServiceNotFoundException::SCHEMA,
250                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
251                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::XksProxyVpcEndpointServiceNotFoundException::deserialize(d)?))
252                        },
253                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
254                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::XksProxyVpcEndpointServiceNotFoundException::deserialize(d)?))
255                        },
256                    )
257                            .build()
258    });
259}
260impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateCustomKeyStore {
261    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
262        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateCustomKeyStore");
263
264        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
265            CreateCustomKeyStoreRequestSerializer,
266        ));
267        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
268            CreateCustomKeyStoreResponseDeserializer,
269        ));
270
271        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
272            crate::config::auth::Params::builder()
273                .operation_name("CreateCustomKeyStore")
274                .build()
275                .expect("required fields set"),
276        ));
277
278        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
279            "CreateCustomKeyStore",
280            "KMS",
281        ));
282        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
283        signing_options.double_uri_encode = true;
284        signing_options.content_sha256_header = false;
285        signing_options.normalize_uri_path = true;
286        signing_options.payload_override = None;
287
288        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
289            signing_options,
290            ..::std::default::Default::default()
291        });
292
293        ::std::option::Option::Some(cfg.freeze())
294    }
295
296    fn runtime_components(
297        &self,
298        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
299    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
300        #[allow(unused_mut)]
301        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateCustomKeyStore")
302            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
303                CreateCustomKeyStoreTelemetryInputCaptureInterceptor,
304            ))
305            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
306                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
307            ))
308            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
309                CreateCustomKeyStoreEndpointParamsInterceptor,
310            ))
311            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
312                crate::operation::create_custom_key_store::CreateCustomKeyStoreError,
313            >::new())
314            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
315                crate::operation::create_custom_key_store::CreateCustomKeyStoreError,
316            >::new())
317            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
318                crate::operation::create_custom_key_store::CreateCustomKeyStoreError,
319            >::new())
320            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
321                crate::operation::create_custom_key_store::CreateCustomKeyStoreError,
322            >::new());
323
324        ::std::borrow::Cow::Owned(rcb)
325    }
326}
327
328#[derive(Debug)]
329struct CreateCustomKeyStoreTelemetryInputCaptureInterceptor;
330
331#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
332impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateCustomKeyStoreTelemetryInputCaptureInterceptor {
333    fn name(&self) -> &'static str {
334        "CreateCustomKeyStoreTelemetryInputCaptureInterceptor"
335    }
336
337    fn read_before_execution(
338        &self,
339        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
340            '_,
341            ::aws_smithy_runtime_api::client::interceptors::context::Input,
342            ::aws_smithy_runtime_api::client::interceptors::context::Output,
343            ::aws_smithy_runtime_api::client::interceptors::context::Error,
344        >,
345        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
346    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
347        // Nothing to do unless the customer opted in by naming members to record.
348        let ::std::option::Option::Some(requested) = cfg
349            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
350            .filter(|r| !r.is_empty())
351        else {
352            return ::std::result::Result::Ok(());
353        };
354
355        let ::std::option::Option::Some(input) = context.input().downcast_ref::<CreateCustomKeyStoreInput>() else {
356            // A mismatched input is not this interceptor's concern; skip quietly.
357            return ::std::result::Result::Ok(());
358        };
359
360        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
361        if requested.should_capture("CustomKeyStoreName") {
362            if let ::std::option::Option::Some(value) = input.custom_key_store_name.as_deref() {
363                captured.insert("CustomKeyStoreName", value);
364            }
365        }
366        if requested.should_capture("CloudHsmClusterId") {
367            if let ::std::option::Option::Some(value) = input.cloud_hsm_cluster_id.as_deref() {
368                captured.insert("CloudHsmClusterId", value);
369            }
370        }
371        if requested.should_capture("TrustAnchorCertificate") {
372            if let ::std::option::Option::Some(value) = input.trust_anchor_certificate.as_deref() {
373                captured.insert("TrustAnchorCertificate", value);
374            }
375        }
376        if requested.should_capture("XksProxyUriEndpoint") {
377            if let ::std::option::Option::Some(value) = input.xks_proxy_uri_endpoint.as_deref() {
378                captured.insert("XksProxyUriEndpoint", value);
379            }
380        }
381        if requested.should_capture("XksProxyUriPath") {
382            if let ::std::option::Option::Some(value) = input.xks_proxy_uri_path.as_deref() {
383                captured.insert("XksProxyUriPath", value);
384            }
385        }
386        if requested.should_capture("XksProxyVpcEndpointServiceName") {
387            if let ::std::option::Option::Some(value) = input.xks_proxy_vpc_endpoint_service_name.as_deref() {
388                captured.insert("XksProxyVpcEndpointServiceName", value);
389            }
390        }
391        if requested.should_capture("XksProxyVpcEndpointServiceOwner") {
392            if let ::std::option::Option::Some(value) = input.xks_proxy_vpc_endpoint_service_owner.as_deref() {
393                captured.insert("XksProxyVpcEndpointServiceOwner", value);
394            }
395        }
396
397        cfg.interceptor_state().store_put(captured);
398        ::std::result::Result::Ok(())
399    }
400}
401#[derive(Debug)]
402struct CreateCustomKeyStoreResponseDeserializer;
403impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateCustomKeyStoreResponseDeserializer {
404    fn deserialize_nonstreaming_with_config(
405        &self,
406        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
407        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
408    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
409        let (success, status) = (response.status().is_success(), response.status().as_u16());
410        // Load body and headers BEFORE BeforeParseResponse so customizations
411        // (e.g., S3's `body_is_error` check that detects errors returned with
412        // HTTP 200) can inspect them. The legacy non-streaming path also
413        // loads `body` before firing this hook.
414        #[allow(unused_variables)]
415        let body = response.body().bytes().expect("body loaded");
416        let headers = response.headers();
417        #[allow(unused_mut)]
418        let mut force_error = false;
419        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
420        if !success && status != 200 || force_error {
421            let protocol = _cfg
422                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
423                .expect("a SharedClientProtocol is required");
424            #[allow(unused_mut)]
425            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
426                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
427            })?;
428            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
429            let generic = generic_builder.build();
430            let error_code = match generic.code() {
431                ::std::option::Option::Some(code) => code,
432                ::std::option::Option::None => {
433                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
434                        ::aws_smithy_runtime_api::box_error::BoxError::from(
435                            crate::operation::create_custom_key_store::CreateCustomKeyStoreError::unhandled(generic),
436                        ),
437                    ))
438                }
439            };
440            let _error_message = generic.message().map(|msg| msg.to_owned());
441            let err = match error_code {
442                "CloudHsmClusterInUseException" => {
443                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CloudHsmClusterInUseException({
444                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
445                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
446                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
447                            )
448                        })?;
449                        let mut tmp = <crate::types::error::builders::CloudHsmClusterInUseExceptionBuilder>::default();
450                        tmp.deserialize_members(&mut *deser).map_err(|e| {
451                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
452                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
453                            )
454                        })?;
455                        if tmp.message.is_none() {
456                            tmp.message = _error_message;
457                        }
458                        let tmp = tmp.meta(generic);
459                        tmp.build()
460                    })
461                }
462                "CloudHsmClusterInvalidConfigurationException" => {
463                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CloudHsmClusterInvalidConfigurationException({
464                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
465                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
466                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
467                            )
468                        })?;
469                        let mut tmp = <crate::types::error::builders::CloudHsmClusterInvalidConfigurationExceptionBuilder>::default();
470                        tmp.deserialize_members(&mut *deser).map_err(|e| {
471                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
472                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
473                            )
474                        })?;
475                        if tmp.message.is_none() {
476                            tmp.message = _error_message;
477                        }
478                        let tmp = tmp.meta(generic);
479                        tmp.build()
480                    })
481                }
482                "CloudHsmClusterNotActiveException" => {
483                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CloudHsmClusterNotActiveException({
484                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
485                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
486                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
487                            )
488                        })?;
489                        let mut tmp = <crate::types::error::builders::CloudHsmClusterNotActiveExceptionBuilder>::default();
490                        tmp.deserialize_members(&mut *deser).map_err(|e| {
491                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
492                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
493                            )
494                        })?;
495                        if tmp.message.is_none() {
496                            tmp.message = _error_message;
497                        }
498                        let tmp = tmp.meta(generic);
499                        tmp.build()
500                    })
501                }
502                "CloudHsmClusterNotFoundException" => {
503                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CloudHsmClusterNotFoundException({
504                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
505                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
506                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
507                            )
508                        })?;
509                        let mut tmp = <crate::types::error::builders::CloudHsmClusterNotFoundExceptionBuilder>::default();
510                        tmp.deserialize_members(&mut *deser).map_err(|e| {
511                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
512                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
513                            )
514                        })?;
515                        if tmp.message.is_none() {
516                            tmp.message = _error_message;
517                        }
518                        let tmp = tmp.meta(generic);
519                        tmp.build()
520                    })
521                }
522                "CustomKeyStoreNameInUseException" => {
523                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::CustomKeyStoreNameInUseException({
524                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
525                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
526                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
527                            )
528                        })?;
529                        let mut tmp = <crate::types::error::builders::CustomKeyStoreNameInUseExceptionBuilder>::default();
530                        tmp.deserialize_members(&mut *deser).map_err(|e| {
531                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
532                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
533                            )
534                        })?;
535                        if tmp.message.is_none() {
536                            tmp.message = _error_message;
537                        }
538                        let tmp = tmp.meta(generic);
539                        tmp.build()
540                    })
541                }
542                "IncorrectTrustAnchorException" => {
543                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::IncorrectTrustAnchorException({
544                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
545                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
546                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
547                            )
548                        })?;
549                        let mut tmp = <crate::types::error::builders::IncorrectTrustAnchorExceptionBuilder>::default();
550                        tmp.deserialize_members(&mut *deser).map_err(|e| {
551                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
552                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
553                            )
554                        })?;
555                        if tmp.message.is_none() {
556                            tmp.message = _error_message;
557                        }
558                        let tmp = tmp.meta(generic);
559                        tmp.build()
560                    })
561                }
562                "KMSInternalException" => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::KmsInternalException({
563                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
564                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
565                            e,
566                        ))
567                    })?;
568                    let mut tmp = <crate::types::error::builders::KmsInternalExceptionBuilder>::default();
569                    tmp.deserialize_members(&mut *deser).map_err(|e| {
570                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
571                            e,
572                        ))
573                    })?;
574                    if tmp.message.is_none() {
575                        tmp.message = _error_message;
576                    }
577                    let tmp = tmp.meta(generic);
578                    tmp.build()
579                }),
580                "LimitExceededException" => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::LimitExceededException({
581                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
582                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
583                            e,
584                        ))
585                    })?;
586                    let mut tmp = <crate::types::error::builders::LimitExceededExceptionBuilder>::default();
587                    tmp.deserialize_members(&mut *deser).map_err(|e| {
588                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
589                            e,
590                        ))
591                    })?;
592                    if tmp.message.is_none() {
593                        tmp.message = _error_message;
594                    }
595                    let tmp = tmp.meta(generic);
596                    tmp.build()
597                }),
598                "XksProxyIncorrectAuthenticationCredentialException" => {
599                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyIncorrectAuthenticationCredentialException({
600                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
601                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
602                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
603                            )
604                        })?;
605                        let mut tmp = <crate::types::error::builders::XksProxyIncorrectAuthenticationCredentialExceptionBuilder>::default();
606                        tmp.deserialize_members(&mut *deser).map_err(|e| {
607                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
608                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
609                            )
610                        })?;
611                        if tmp.message.is_none() {
612                            tmp.message = _error_message;
613                        }
614                        let tmp = tmp.meta(generic);
615                        tmp.build()
616                    })
617                }
618                "XksProxyInvalidConfigurationException" => {
619                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyInvalidConfigurationException({
620                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
621                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
622                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
623                            )
624                        })?;
625                        let mut tmp = <crate::types::error::builders::XksProxyInvalidConfigurationExceptionBuilder>::default();
626                        tmp.deserialize_members(&mut *deser).map_err(|e| {
627                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
628                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
629                            )
630                        })?;
631                        if tmp.message.is_none() {
632                            tmp.message = _error_message;
633                        }
634                        let tmp = tmp.meta(generic);
635                        tmp.build()
636                    })
637                }
638                "XksProxyInvalidResponseException" => {
639                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyInvalidResponseException({
640                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
641                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
642                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
643                            )
644                        })?;
645                        let mut tmp = <crate::types::error::builders::XksProxyInvalidResponseExceptionBuilder>::default();
646                        tmp.deserialize_members(&mut *deser).map_err(|e| {
647                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
648                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
649                            )
650                        })?;
651                        if tmp.message.is_none() {
652                            tmp.message = _error_message;
653                        }
654                        let tmp = tmp.meta(generic);
655                        tmp.build()
656                    })
657                }
658                "XksProxyUriEndpointInUseException" => {
659                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyUriEndpointInUseException({
660                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
661                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
662                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
663                            )
664                        })?;
665                        let mut tmp = <crate::types::error::builders::XksProxyUriEndpointInUseExceptionBuilder>::default();
666                        tmp.deserialize_members(&mut *deser).map_err(|e| {
667                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
668                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
669                            )
670                        })?;
671                        if tmp.message.is_none() {
672                            tmp.message = _error_message;
673                        }
674                        let tmp = tmp.meta(generic);
675                        tmp.build()
676                    })
677                }
678                "XksProxyUriInUseException" => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyUriInUseException({
679                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
680                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
681                            e,
682                        ))
683                    })?;
684                    let mut tmp = <crate::types::error::builders::XksProxyUriInUseExceptionBuilder>::default();
685                    tmp.deserialize_members(&mut *deser).map_err(|e| {
686                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
687                            e,
688                        ))
689                    })?;
690                    if tmp.message.is_none() {
691                        tmp.message = _error_message;
692                    }
693                    let tmp = tmp.meta(generic);
694                    tmp.build()
695                }),
696                "XksProxyUriUnreachableException" => {
697                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyUriUnreachableException({
698                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
699                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
700                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
701                            )
702                        })?;
703                        let mut tmp = <crate::types::error::builders::XksProxyUriUnreachableExceptionBuilder>::default();
704                        tmp.deserialize_members(&mut *deser).map_err(|e| {
705                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
706                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
707                            )
708                        })?;
709                        if tmp.message.is_none() {
710                            tmp.message = _error_message;
711                        }
712                        let tmp = tmp.meta(generic);
713                        tmp.build()
714                    })
715                }
716                "XksProxyVpcEndpointServiceInUseException" => {
717                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyVpcEndpointServiceInUseException({
718                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
719                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
720                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
721                            )
722                        })?;
723                        let mut tmp = <crate::types::error::builders::XksProxyVpcEndpointServiceInUseExceptionBuilder>::default();
724                        tmp.deserialize_members(&mut *deser).map_err(|e| {
725                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
726                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
727                            )
728                        })?;
729                        if tmp.message.is_none() {
730                            tmp.message = _error_message;
731                        }
732                        let tmp = tmp.meta(generic);
733                        tmp.build()
734                    })
735                }
736                "XksProxyVpcEndpointServiceInvalidConfigurationException" => {
737                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyVpcEndpointServiceInvalidConfigurationException({
738                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
739                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
740                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
741                            )
742                        })?;
743                        let mut tmp = <crate::types::error::builders::XksProxyVpcEndpointServiceInvalidConfigurationExceptionBuilder>::default();
744                        tmp.deserialize_members(&mut *deser).map_err(|e| {
745                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
746                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
747                            )
748                        })?;
749                        if tmp.message.is_none() {
750                            tmp.message = _error_message;
751                        }
752                        let tmp = tmp.meta(generic);
753                        tmp.build()
754                    })
755                }
756                "XksProxyVpcEndpointServiceNotFoundException" => {
757                    crate::operation::create_custom_key_store::CreateCustomKeyStoreError::XksProxyVpcEndpointServiceNotFoundException({
758                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
759                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
760                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
761                            )
762                        })?;
763                        let mut tmp = <crate::types::error::builders::XksProxyVpcEndpointServiceNotFoundExceptionBuilder>::default();
764                        tmp.deserialize_members(&mut *deser).map_err(|e| {
765                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
766                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
767                            )
768                        })?;
769                        if tmp.message.is_none() {
770                            tmp.message = _error_message;
771                        }
772                        let tmp = tmp.meta(generic);
773                        tmp.build()
774                    })
775                }
776                _ => {
777                    // Registry-backed, operation-scoped reification of an error whose
778                    // code this operation does not model directly: the operation's own
779                    // error registry is consulted first, then the lookup widens to the
780                    // service-wide error registry. On a hit, the reified error is attached
781                    // as the source of the returned unhandled error while its metadata
782                    // (code, message, request id) is preserved; on a miss the generic
783                    // error is returned unchanged.
784                    match protocol
785                        .deserialize_error_response(response, _cfg)
786                        .ok()
787                        .and_then(|mut deser| {
788                            ::aws_smithy_schema::registry::reify_error(
789                                crate::operation::create_custom_key_store::error_registry::REGISTRY
790                                    .or(&crate::error_type_registry::REGISTRY),
791                                error_code,
792                                &mut *deser,
793                            )
794                        }) {
795                        ::std::option::Option::Some(source) => <crate::operation::create_custom_key_store::CreateCustomKeyStoreError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
796                        ::std::option::Option::None => crate::operation::create_custom_key_store::CreateCustomKeyStoreError::generic(generic),
797                    }
798                }
799            };
800            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
801                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
802            ))
803        } else {
804            let protocol = _cfg
805                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
806                .expect("a SharedClientProtocol is required");
807            let mut deser = protocol
808                .deserialize_response(response, CreateCustomKeyStore::OUTPUT_SCHEMA, _cfg)
809                .map_err(|e| {
810                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
811                })?;
812            // `headers` is already in scope from the top of the function; alias it as
813            // `_response_headers` so MutateOutput customizations have a stable name to
814            // read from.
815            let _response_headers = headers;
816            // `mut` is required because `deserialize_members` and the `MutateOutput`
817            // builder setters take `&mut self`. Marked `allow(unused_mut)` because an
818            // empty output has no members and no customizations to run.
819            #[allow(unused_mut)]
820            let mut output = <crate::operation::create_custom_key_store::builders::CreateCustomKeyStoreOutputBuilder>::default();
821            output.deserialize_members(&mut *deser).map_err(|e| {
822                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
823            })?;
824            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
825            let output = output.build();
826            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
827        }
828    }
829}
830#[derive(Debug)]
831struct CreateCustomKeyStoreRequestSerializer;
832impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateCustomKeyStoreRequestSerializer {
833    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
834    fn serialize_input(
835        &self,
836        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
837        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
838    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
839        let input = input
840            .downcast::<crate::operation::create_custom_key_store::CreateCustomKeyStoreInput>()
841            .expect("correct type");
842
843        let protocol = _cfg
844            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
845            .expect("a SharedClientProtocol is required");
846        let mut request = protocol
847            .serialize_request(&input, CreateCustomKeyStore::INPUT_SCHEMA, "/", _cfg)
848            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
849
850        return ::std::result::Result::Ok(request);
851    }
852}
853#[derive(Debug)]
854struct CreateCustomKeyStoreEndpointParamsInterceptor;
855
856#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
857impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateCustomKeyStoreEndpointParamsInterceptor {
858    fn name(&self) -> &'static str {
859        "CreateCustomKeyStoreEndpointParamsInterceptor"
860    }
861
862    fn read_before_execution(
863        &self,
864        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
865            '_,
866            ::aws_smithy_runtime_api::client::interceptors::context::Input,
867            ::aws_smithy_runtime_api::client::interceptors::context::Output,
868            ::aws_smithy_runtime_api::client::interceptors::context::Error,
869        >,
870        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
871    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
872        let _input = context
873            .input()
874            .downcast_ref::<CreateCustomKeyStoreInput>()
875            .ok_or("failed to downcast to CreateCustomKeyStoreInput")?;
876
877        let params = crate::config::endpoint::Params::builder()
878            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
879            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
880            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
881            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
882            .build()
883            .map_err(|err| {
884                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
885            })?;
886        cfg.interceptor_state()
887            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
888        ::std::result::Result::Ok(())
889    }
890}
891
892// The get_* functions below are generated from JMESPath expressions in the
893// operationContextParams trait. They target the operation's input shape.
894
895/// Error type for the `CreateCustomKeyStoreError` operation.
896#[non_exhaustive]
897#[derive(::std::fmt::Debug)]
898pub enum CreateCustomKeyStoreError {
899    /// <p>The request was rejected because the specified CloudHSM cluster is already associated with an CloudHSM key store in the account, or it shares a backup history with an CloudHSM key store in the account. Each CloudHSM key store in the account must be associated with a different CloudHSM cluster.</p>
900    /// <p>CloudHSM clusters that share a backup history have the same cluster certificate. To view the cluster certificate of an CloudHSM cluster, use the <a href="https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html">DescribeClusters</a> operation.</p>
901    CloudHsmClusterInUseException(crate::types::error::CloudHsmClusterInUseException),
902    /// <p>The request was rejected because the associated CloudHSM cluster did not meet the configuration requirements for an CloudHSM key store.</p>
903    /// <ul>
904    /// <li>
905    /// <p>The CloudHSM cluster must be configured with private subnets in at least two different Availability Zones in the Region.</p></li>
906    /// <li>
907    /// <p>The <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html">security group for the cluster</a> (cloudhsm-cluster-<i><cluster-id></cluster-id></i>-sg) must include inbound rules and outbound rules that allow TCP traffic on ports 2223-2225. The <b>Source</b> in the inbound rules and the <b>Destination</b> in the outbound rules must match the security group ID. These rules are set by default when you create the CloudHSM cluster. Do not delete or change them. To get information about a particular security group, use the <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html">DescribeSecurityGroups</a> operation.</p></li>
908    /// <li>
909    /// <p>The CloudHSM cluster must contain at least as many HSMs as the operation requires. To add HSMs, use the CloudHSM <a href="https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html">CreateHsm</a> operation.</p>
910    /// <p>For the <code>CreateCustomKeyStore</code>, <code>UpdateCustomKeyStore</code>, and <code>CreateKey</code> operations, the CloudHSM cluster must have at least two active HSMs, each in a different Availability Zone. For the <code>ConnectCustomKeyStore</code> operation, the CloudHSM must contain at least one active HSM.</p></li>
911    /// </ul>
912    /// <p>For information about the requirements for an CloudHSM cluster that is associated with an CloudHSM key store, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore">Assemble the Prerequisites</a> in the <i>Key Management Service Developer Guide</i>. For information about creating a private subnet for an CloudHSM cluster, see <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html">Create a Private Subnet</a> in the <i>CloudHSM User Guide</i>. For information about cluster security groups, see <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html">Configure a Default Security Group</a> in the <i> <i>CloudHSM User Guide</i> </i>.</p>
913    CloudHsmClusterInvalidConfigurationException(crate::types::error::CloudHsmClusterInvalidConfigurationException),
914    /// <p>The request was rejected because the CloudHSM cluster associated with the CloudHSM key store is not active. Initialize and activate the cluster and try the command again. For detailed instructions, see <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html">Getting Started</a> in the <i>CloudHSM User Guide</i>.</p>
915    CloudHsmClusterNotActiveException(crate::types::error::CloudHsmClusterNotActiveException),
916    /// <p>The request was rejected because KMS cannot find the CloudHSM cluster with the specified cluster ID. Retry the request with a different cluster ID.</p>
917    CloudHsmClusterNotFoundException(crate::types::error::CloudHsmClusterNotFoundException),
918    /// <p>The request was rejected because the specified custom key store name is already assigned to another custom key store in the account. Try again with a custom key store name that is unique in the account.</p>
919    CustomKeyStoreNameInUseException(crate::types::error::CustomKeyStoreNameInUseException),
920    /// <p>The request was rejected because the trust anchor certificate in the request to create an CloudHSM key store is not the trust anchor certificate for the specified CloudHSM cluster.</p>
921    /// <p>When you <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr">initialize the CloudHSM cluster</a>, you create the trust anchor certificate and save it in the <code>customerCA.crt</code> file.</p>
922    IncorrectTrustAnchorException(crate::types::error::IncorrectTrustAnchorException),
923    /// <p>The request was rejected because an internal exception occurred. The request can be retried.</p>
924    KmsInternalException(crate::types::error::KmsInternalException),
925    /// <p>The request was rejected because a length constraint or 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>
926    LimitExceededException(crate::types::error::LimitExceededException),
927    /// <p>The request was rejected because the proxy credentials failed to authenticate to the specified external key store proxy. The specified external key store proxy rejected a status request from KMS due to invalid credentials. This can indicate an error in the credentials or in the identification of the external key store proxy.</p>
928    XksProxyIncorrectAuthenticationCredentialException(crate::types::error::XksProxyIncorrectAuthenticationCredentialException),
929    /// <p>The request was rejected because the external key store proxy is not configured correctly. To identify the cause, see the error message that accompanies the exception.</p>
930    XksProxyInvalidConfigurationException(crate::types::error::XksProxyInvalidConfigurationException),
931    /// <p></p>
932    /// <p>KMS cannot interpret the response it received from the external key store proxy. The problem might be a poorly constructed response, but it could also be a transient network issue. If you see this error repeatedly, report it to the proxy vendor.</p>
933    XksProxyInvalidResponseException(crate::types::error::XksProxyInvalidResponseException),
934    /// <p>The request was rejected because the <code>XksProxyUriEndpoint</code> is already associated with another external key store in this Amazon Web Services Region. To identify the cause, see the error message that accompanies the exception.</p>
935    XksProxyUriEndpointInUseException(crate::types::error::XksProxyUriEndpointInUseException),
936    /// <p>The request was rejected because the concatenation of the <code>XksProxyUriEndpoint</code> and <code>XksProxyUriPath</code> is already associated with another external key store in this Amazon Web Services Region. Each external key store in a Region must use a unique external key store proxy API address.</p>
937    XksProxyUriInUseException(crate::types::error::XksProxyUriInUseException),
938    /// <p>KMS was unable to reach the specified <code>XksProxyUriPath</code>. The path must be reachable before you create the external key store or update its settings.</p>
939    /// <p>This exception is also thrown when the external key store proxy response to a <code>GetHealthStatus</code> request indicates that all external key manager instances are unavailable.</p>
940    XksProxyUriUnreachableException(crate::types::error::XksProxyUriUnreachableException),
941    /// <p>The request was rejected because the specified Amazon VPC endpoint service is already associated with another external key store in this Amazon Web Services Region. Each external key store in a Region must use a different Amazon VPC endpoint service.</p>
942    XksProxyVpcEndpointServiceInUseException(crate::types::error::XksProxyVpcEndpointServiceInUseException),
943    /// <p>The request was rejected because the Amazon VPC endpoint service configuration does not fulfill the requirements for an external key store. To identify the cause, see the error message that accompanies the exception and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/vpc-connectivity.html#xks-vpc-requirements">review the requirements</a> for Amazon VPC endpoint service connectivity for an external key store.</p>
944    XksProxyVpcEndpointServiceInvalidConfigurationException(crate::types::error::XksProxyVpcEndpointServiceInvalidConfigurationException),
945    /// <p>The request was rejected because KMS could not find the specified VPC endpoint service. Use <code>DescribeCustomKeyStores</code> to verify the VPC endpoint service name for the external key store. Also, confirm that the <code>Allow principals</code> list for the VPC endpoint service includes the KMS service principal for the Region, such as <code>cks.kms.us-east-1.amazonaws.com</code>.</p>
946    XksProxyVpcEndpointServiceNotFoundException(crate::types::error::XksProxyVpcEndpointServiceNotFoundException),
947    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
948    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
949    variable wildcard pattern and check `.code()`:
950     \
951    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
952     \
953    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateCustomKeyStoreError) for what information is available for the error.")]
954    Unhandled(crate::error::sealed_unhandled::Unhandled),
955}
956impl CreateCustomKeyStoreError {
957    /// Creates the `CreateCustomKeyStoreError::Unhandled` variant from any error type.
958    pub fn unhandled(
959        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
960    ) -> Self {
961        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
962            source: err.into(),
963            meta: ::std::default::Default::default(),
964        })
965    }
966
967    /// Creates the `CreateCustomKeyStoreError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
968    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
969        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
970            source: err.clone().into(),
971            meta: err,
972        })
973    }
974    ///
975    /// Returns error metadata, which includes the error code, message,
976    /// request ID, and potentially additional information.
977    ///
978    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
979        match self {
980            Self::CloudHsmClusterInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
981            Self::CloudHsmClusterInvalidConfigurationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
982            Self::CloudHsmClusterNotActiveException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
983            Self::CloudHsmClusterNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
984            Self::CustomKeyStoreNameInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
985            Self::IncorrectTrustAnchorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
986            Self::KmsInternalException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
987            Self::LimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
988            Self::XksProxyIncorrectAuthenticationCredentialException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
989            Self::XksProxyInvalidConfigurationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
990            Self::XksProxyInvalidResponseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
991            Self::XksProxyUriEndpointInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
992            Self::XksProxyUriInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
993            Self::XksProxyUriUnreachableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
994            Self::XksProxyVpcEndpointServiceInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
995            Self::XksProxyVpcEndpointServiceInvalidConfigurationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
996            Self::XksProxyVpcEndpointServiceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
997            Self::Unhandled(e) => &e.meta,
998        }
999    }
1000    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::CloudHsmClusterInUseException`.
1001    pub fn is_cloud_hsm_cluster_in_use_exception(&self) -> bool {
1002        matches!(self, Self::CloudHsmClusterInUseException(_))
1003    }
1004    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::CloudHsmClusterInvalidConfigurationException`.
1005    pub fn is_cloud_hsm_cluster_invalid_configuration_exception(&self) -> bool {
1006        matches!(self, Self::CloudHsmClusterInvalidConfigurationException(_))
1007    }
1008    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::CloudHsmClusterNotActiveException`.
1009    pub fn is_cloud_hsm_cluster_not_active_exception(&self) -> bool {
1010        matches!(self, Self::CloudHsmClusterNotActiveException(_))
1011    }
1012    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::CloudHsmClusterNotFoundException`.
1013    pub fn is_cloud_hsm_cluster_not_found_exception(&self) -> bool {
1014        matches!(self, Self::CloudHsmClusterNotFoundException(_))
1015    }
1016    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::CustomKeyStoreNameInUseException`.
1017    pub fn is_custom_key_store_name_in_use_exception(&self) -> bool {
1018        matches!(self, Self::CustomKeyStoreNameInUseException(_))
1019    }
1020    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::IncorrectTrustAnchorException`.
1021    pub fn is_incorrect_trust_anchor_exception(&self) -> bool {
1022        matches!(self, Self::IncorrectTrustAnchorException(_))
1023    }
1024    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::KmsInternalException`.
1025    pub fn is_kms_internal_exception(&self) -> bool {
1026        matches!(self, Self::KmsInternalException(_))
1027    }
1028    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::LimitExceededException`.
1029    pub fn is_limit_exceeded_exception(&self) -> bool {
1030        matches!(self, Self::LimitExceededException(_))
1031    }
1032    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::XksProxyIncorrectAuthenticationCredentialException`.
1033    pub fn is_xks_proxy_incorrect_authentication_credential_exception(&self) -> bool {
1034        matches!(self, Self::XksProxyIncorrectAuthenticationCredentialException(_))
1035    }
1036    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::XksProxyInvalidConfigurationException`.
1037    pub fn is_xks_proxy_invalid_configuration_exception(&self) -> bool {
1038        matches!(self, Self::XksProxyInvalidConfigurationException(_))
1039    }
1040    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::XksProxyInvalidResponseException`.
1041    pub fn is_xks_proxy_invalid_response_exception(&self) -> bool {
1042        matches!(self, Self::XksProxyInvalidResponseException(_))
1043    }
1044    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::XksProxyUriEndpointInUseException`.
1045    pub fn is_xks_proxy_uri_endpoint_in_use_exception(&self) -> bool {
1046        matches!(self, Self::XksProxyUriEndpointInUseException(_))
1047    }
1048    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::XksProxyUriInUseException`.
1049    pub fn is_xks_proxy_uri_in_use_exception(&self) -> bool {
1050        matches!(self, Self::XksProxyUriInUseException(_))
1051    }
1052    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::XksProxyUriUnreachableException`.
1053    pub fn is_xks_proxy_uri_unreachable_exception(&self) -> bool {
1054        matches!(self, Self::XksProxyUriUnreachableException(_))
1055    }
1056    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::XksProxyVpcEndpointServiceInUseException`.
1057    pub fn is_xks_proxy_vpc_endpoint_service_in_use_exception(&self) -> bool {
1058        matches!(self, Self::XksProxyVpcEndpointServiceInUseException(_))
1059    }
1060    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::XksProxyVpcEndpointServiceInvalidConfigurationException`.
1061    pub fn is_xks_proxy_vpc_endpoint_service_invalid_configuration_exception(&self) -> bool {
1062        matches!(self, Self::XksProxyVpcEndpointServiceInvalidConfigurationException(_))
1063    }
1064    /// Returns `true` if the error kind is `CreateCustomKeyStoreError::XksProxyVpcEndpointServiceNotFoundException`.
1065    pub fn is_xks_proxy_vpc_endpoint_service_not_found_exception(&self) -> bool {
1066        matches!(self, Self::XksProxyVpcEndpointServiceNotFoundException(_))
1067    }
1068}
1069impl ::std::error::Error for CreateCustomKeyStoreError {
1070    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
1071        match self {
1072            Self::CloudHsmClusterInUseException(_inner) => ::std::option::Option::Some(_inner),
1073            Self::CloudHsmClusterInvalidConfigurationException(_inner) => ::std::option::Option::Some(_inner),
1074            Self::CloudHsmClusterNotActiveException(_inner) => ::std::option::Option::Some(_inner),
1075            Self::CloudHsmClusterNotFoundException(_inner) => ::std::option::Option::Some(_inner),
1076            Self::CustomKeyStoreNameInUseException(_inner) => ::std::option::Option::Some(_inner),
1077            Self::IncorrectTrustAnchorException(_inner) => ::std::option::Option::Some(_inner),
1078            Self::KmsInternalException(_inner) => ::std::option::Option::Some(_inner),
1079            Self::LimitExceededException(_inner) => ::std::option::Option::Some(_inner),
1080            Self::XksProxyIncorrectAuthenticationCredentialException(_inner) => ::std::option::Option::Some(_inner),
1081            Self::XksProxyInvalidConfigurationException(_inner) => ::std::option::Option::Some(_inner),
1082            Self::XksProxyInvalidResponseException(_inner) => ::std::option::Option::Some(_inner),
1083            Self::XksProxyUriEndpointInUseException(_inner) => ::std::option::Option::Some(_inner),
1084            Self::XksProxyUriInUseException(_inner) => ::std::option::Option::Some(_inner),
1085            Self::XksProxyUriUnreachableException(_inner) => ::std::option::Option::Some(_inner),
1086            Self::XksProxyVpcEndpointServiceInUseException(_inner) => ::std::option::Option::Some(_inner),
1087            Self::XksProxyVpcEndpointServiceInvalidConfigurationException(_inner) => ::std::option::Option::Some(_inner),
1088            Self::XksProxyVpcEndpointServiceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
1089            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
1090        }
1091    }
1092}
1093impl ::std::fmt::Display for CreateCustomKeyStoreError {
1094    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1095        match self {
1096            Self::CloudHsmClusterInUseException(_inner) => _inner.fmt(f),
1097            Self::CloudHsmClusterInvalidConfigurationException(_inner) => _inner.fmt(f),
1098            Self::CloudHsmClusterNotActiveException(_inner) => _inner.fmt(f),
1099            Self::CloudHsmClusterNotFoundException(_inner) => _inner.fmt(f),
1100            Self::CustomKeyStoreNameInUseException(_inner) => _inner.fmt(f),
1101            Self::IncorrectTrustAnchorException(_inner) => _inner.fmt(f),
1102            Self::KmsInternalException(_inner) => _inner.fmt(f),
1103            Self::LimitExceededException(_inner) => _inner.fmt(f),
1104            Self::XksProxyIncorrectAuthenticationCredentialException(_inner) => _inner.fmt(f),
1105            Self::XksProxyInvalidConfigurationException(_inner) => _inner.fmt(f),
1106            Self::XksProxyInvalidResponseException(_inner) => _inner.fmt(f),
1107            Self::XksProxyUriEndpointInUseException(_inner) => _inner.fmt(f),
1108            Self::XksProxyUriInUseException(_inner) => _inner.fmt(f),
1109            Self::XksProxyUriUnreachableException(_inner) => _inner.fmt(f),
1110            Self::XksProxyVpcEndpointServiceInUseException(_inner) => _inner.fmt(f),
1111            Self::XksProxyVpcEndpointServiceInvalidConfigurationException(_inner) => _inner.fmt(f),
1112            Self::XksProxyVpcEndpointServiceNotFoundException(_inner) => _inner.fmt(f),
1113            Self::Unhandled(_inner) => {
1114                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
1115                    write!(f, "unhandled error ({code})")
1116                } else {
1117                    f.write_str("unhandled error")
1118                }
1119            }
1120        }
1121    }
1122}
1123impl ::aws_smithy_types::retry::ProvideErrorKind for CreateCustomKeyStoreError {
1124    fn code(&self) -> ::std::option::Option<&str> {
1125        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
1126    }
1127    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
1128        ::std::option::Option::None
1129    }
1130}
1131impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateCustomKeyStoreError {
1132    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
1133        match self {
1134            Self::CloudHsmClusterInUseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1135            Self::CloudHsmClusterInvalidConfigurationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1136            Self::CloudHsmClusterNotActiveException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1137            Self::CloudHsmClusterNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1138            Self::CustomKeyStoreNameInUseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1139            Self::IncorrectTrustAnchorException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1140            Self::KmsInternalException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1141            Self::LimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1142            Self::XksProxyIncorrectAuthenticationCredentialException(_inner) => {
1143                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
1144            }
1145            Self::XksProxyInvalidConfigurationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1146            Self::XksProxyInvalidResponseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1147            Self::XksProxyUriEndpointInUseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1148            Self::XksProxyUriInUseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1149            Self::XksProxyUriUnreachableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1150            Self::XksProxyVpcEndpointServiceInUseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1151            Self::XksProxyVpcEndpointServiceInvalidConfigurationException(_inner) => {
1152                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
1153            }
1154            Self::XksProxyVpcEndpointServiceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1155            Self::Unhandled(_inner) => &_inner.meta,
1156        }
1157    }
1158}
1159impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateCustomKeyStoreError {
1160    fn create_unhandled_error(
1161        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
1162        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
1163    ) -> Self {
1164        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
1165            source,
1166            meta: meta.unwrap_or_default(),
1167        })
1168    }
1169}
1170impl ::aws_types::request_id::RequestId for crate::operation::create_custom_key_store::CreateCustomKeyStoreError {
1171    fn request_id(&self) -> Option<&str> {
1172        self.meta().request_id()
1173    }
1174}
1175
1176pub use crate::operation::create_custom_key_store::_create_custom_key_store_input::CreateCustomKeyStoreInput;
1177
1178pub use crate::operation::create_custom_key_store::_create_custom_key_store_output::CreateCustomKeyStoreOutput;
1179
1180mod _create_custom_key_store_input;
1181
1182mod _create_custom_key_store_output;
1183
1184/// Builders
1185pub mod builders;