Skip to main content

aws_sdk_kms/operation/
update_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 `UpdateCustomKeyStore`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct UpdateCustomKeyStore;
6impl UpdateCustomKeyStore {
7    /// Creates a new `UpdateCustomKeyStore`
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::update_custom_key_store::UpdateCustomKeyStoreInput::SCHEMA;
14    /// The schema for this operation's output shape.
15    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
16        crate::operation::update_custom_key_store::UpdateCustomKeyStoreOutput::SCHEMA;
17    pub(crate) async fn orchestrate(
18        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
19        input: crate::operation::update_custom_key_store::UpdateCustomKeyStoreInput,
20    ) -> ::std::result::Result<
21        crate::operation::update_custom_key_store::UpdateCustomKeyStoreOutput,
22        ::aws_smithy_runtime_api::client::result::SdkError<
23            crate::operation::update_custom_key_store::UpdateCustomKeyStoreError,
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::update_custom_key_store::UpdateCustomKeyStoreError>()
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::update_custom_key_store::UpdateCustomKeyStoreOutput>()
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::update_custom_key_store::UpdateCustomKeyStoreInput,
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", "UpdateCustomKeyStore", 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.UpdateCustomKeyStore",
65                "rpc.service" = "KMS",
66                "rpc.method" = "UpdateCustomKeyStore",
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::CloudHsmClusterInvalidConfigurationException::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::CloudHsmClusterInvalidConfigurationException::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::CloudHsmClusterInvalidConfigurationException::deserialize(d)?))
111                        },
112                    )
113.insert_error_shape(
114                        crate::types::error::CloudHsmClusterNotActiveException::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::CloudHsmClusterNotActiveException::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::CloudHsmClusterNotActiveException::deserialize(d)?))
120                        },
121                    )
122.insert_error_shape(
123                        crate::types::error::CloudHsmClusterNotFoundException::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::CloudHsmClusterNotFoundException::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::CloudHsmClusterNotFoundException::deserialize(d)?))
129                        },
130                    )
131.insert_error_shape(
132                        crate::types::error::CloudHsmClusterNotRelatedException::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::CloudHsmClusterNotRelatedException::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::CloudHsmClusterNotRelatedException::deserialize(d)?))
138                        },
139                    )
140.insert_error_shape(
141                        crate::types::error::CustomKeyStoreInvalidStateException::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::CustomKeyStoreInvalidStateException::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::CustomKeyStoreInvalidStateException::deserialize(d)?))
147                        },
148                    )
149.insert_error_shape(
150                        crate::types::error::CustomKeyStoreNameInUseException::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::CustomKeyStoreNameInUseException::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::CustomKeyStoreNameInUseException::deserialize(d)?))
156                        },
157                    )
158.insert_error_shape(
159                        crate::types::error::CustomKeyStoreNotFoundException::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::CustomKeyStoreNotFoundException::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::CustomKeyStoreNotFoundException::deserialize(d)?))
165                        },
166                    )
167.insert_error_shape(
168                        crate::types::error::KmsInternalException::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::KmsInternalException::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::KmsInternalException::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 UpdateCustomKeyStore {
261    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
262        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateCustomKeyStore");
263
264        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
265            UpdateCustomKeyStoreRequestSerializer,
266        ));
267        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
268            UpdateCustomKeyStoreResponseDeserializer,
269        ));
270
271        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
272            crate::config::auth::Params::builder()
273                .operation_name("UpdateCustomKeyStore")
274                .build()
275                .expect("required fields set"),
276        ));
277
278        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
279            "UpdateCustomKeyStore",
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("UpdateCustomKeyStore")
302            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
303                UpdateCustomKeyStoreTelemetryInputCaptureInterceptor,
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                UpdateCustomKeyStoreEndpointParamsInterceptor,
310            ))
311            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
312                crate::operation::update_custom_key_store::UpdateCustomKeyStoreError,
313            >::new())
314            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
315                crate::operation::update_custom_key_store::UpdateCustomKeyStoreError,
316            >::new())
317            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
318                crate::operation::update_custom_key_store::UpdateCustomKeyStoreError,
319            >::new())
320            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
321                crate::operation::update_custom_key_store::UpdateCustomKeyStoreError,
322            >::new());
323
324        ::std::borrow::Cow::Owned(rcb)
325    }
326}
327
328#[derive(Debug)]
329struct UpdateCustomKeyStoreTelemetryInputCaptureInterceptor;
330
331#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
332impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateCustomKeyStoreTelemetryInputCaptureInterceptor {
333    fn name(&self) -> &'static str {
334        "UpdateCustomKeyStoreTelemetryInputCaptureInterceptor"
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::<UpdateCustomKeyStoreInput>() 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("CustomKeyStoreId") {
362            if let ::std::option::Option::Some(value) = input.custom_key_store_id.as_deref() {
363                captured.insert("CustomKeyStoreId", value);
364            }
365        }
366        if requested.should_capture("NewCustomKeyStoreName") {
367            if let ::std::option::Option::Some(value) = input.new_custom_key_store_name.as_deref() {
368                captured.insert("NewCustomKeyStoreName", value);
369            }
370        }
371        if requested.should_capture("CloudHsmClusterId") {
372            if let ::std::option::Option::Some(value) = input.cloud_hsm_cluster_id.as_deref() {
373                captured.insert("CloudHsmClusterId", 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 UpdateCustomKeyStoreResponseDeserializer;
403impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateCustomKeyStoreResponseDeserializer {
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::update_custom_key_store::UpdateCustomKeyStoreError::unhandled(generic),
436                        ),
437                    ))
438                }
439            };
440            let _error_message = generic.message().map(|msg| msg.to_owned());
441            let err = match error_code {
442                "CloudHsmClusterInvalidConfigurationException" => {
443                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CloudHsmClusterInvalidConfigurationException({
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::CloudHsmClusterInvalidConfigurationExceptionBuilder>::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                "CloudHsmClusterNotActiveException" => {
463                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CloudHsmClusterNotActiveException({
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::CloudHsmClusterNotActiveExceptionBuilder>::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                "CloudHsmClusterNotFoundException" => {
483                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CloudHsmClusterNotFoundException({
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::CloudHsmClusterNotFoundExceptionBuilder>::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                "CloudHsmClusterNotRelatedException" => {
503                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CloudHsmClusterNotRelatedException({
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::CloudHsmClusterNotRelatedExceptionBuilder>::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                "CustomKeyStoreInvalidStateException" => {
523                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CustomKeyStoreInvalidStateException({
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::CustomKeyStoreInvalidStateExceptionBuilder>::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                "CustomKeyStoreNameInUseException" => {
543                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CustomKeyStoreNameInUseException({
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::CustomKeyStoreNameInUseExceptionBuilder>::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                "CustomKeyStoreNotFoundException" => {
563                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::CustomKeyStoreNotFoundException({
564                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
565                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
566                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
567                            )
568                        })?;
569                        let mut tmp = <crate::types::error::builders::CustomKeyStoreNotFoundExceptionBuilder>::default();
570                        tmp.deserialize_members(&mut *deser).map_err(|e| {
571                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
572                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
573                            )
574                        })?;
575                        if tmp.message.is_none() {
576                            tmp.message = _error_message;
577                        }
578                        let tmp = tmp.meta(generic);
579                        tmp.build()
580                    })
581                }
582                "KMSInternalException" => crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::KmsInternalException({
583                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
584                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
585                            e,
586                        ))
587                    })?;
588                    let mut tmp = <crate::types::error::builders::KmsInternalExceptionBuilder>::default();
589                    tmp.deserialize_members(&mut *deser).map_err(|e| {
590                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
591                            e,
592                        ))
593                    })?;
594                    if tmp.message.is_none() {
595                        tmp.message = _error_message;
596                    }
597                    let tmp = tmp.meta(generic);
598                    tmp.build()
599                }),
600                "XksProxyIncorrectAuthenticationCredentialException" => {
601                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyIncorrectAuthenticationCredentialException({
602                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
603                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
604                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
605                            )
606                        })?;
607                        let mut tmp = <crate::types::error::builders::XksProxyIncorrectAuthenticationCredentialExceptionBuilder>::default();
608                        tmp.deserialize_members(&mut *deser).map_err(|e| {
609                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
610                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
611                            )
612                        })?;
613                        if tmp.message.is_none() {
614                            tmp.message = _error_message;
615                        }
616                        let tmp = tmp.meta(generic);
617                        tmp.build()
618                    })
619                }
620                "XksProxyInvalidConfigurationException" => {
621                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyInvalidConfigurationException({
622                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
623                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
624                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
625                            )
626                        })?;
627                        let mut tmp = <crate::types::error::builders::XksProxyInvalidConfigurationExceptionBuilder>::default();
628                        tmp.deserialize_members(&mut *deser).map_err(|e| {
629                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
630                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
631                            )
632                        })?;
633                        if tmp.message.is_none() {
634                            tmp.message = _error_message;
635                        }
636                        let tmp = tmp.meta(generic);
637                        tmp.build()
638                    })
639                }
640                "XksProxyInvalidResponseException" => {
641                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyInvalidResponseException({
642                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
643                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
644                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
645                            )
646                        })?;
647                        let mut tmp = <crate::types::error::builders::XksProxyInvalidResponseExceptionBuilder>::default();
648                        tmp.deserialize_members(&mut *deser).map_err(|e| {
649                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
650                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
651                            )
652                        })?;
653                        if tmp.message.is_none() {
654                            tmp.message = _error_message;
655                        }
656                        let tmp = tmp.meta(generic);
657                        tmp.build()
658                    })
659                }
660                "XksProxyUriEndpointInUseException" => {
661                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyUriEndpointInUseException({
662                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
663                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
664                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
665                            )
666                        })?;
667                        let mut tmp = <crate::types::error::builders::XksProxyUriEndpointInUseExceptionBuilder>::default();
668                        tmp.deserialize_members(&mut *deser).map_err(|e| {
669                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
670                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
671                            )
672                        })?;
673                        if tmp.message.is_none() {
674                            tmp.message = _error_message;
675                        }
676                        let tmp = tmp.meta(generic);
677                        tmp.build()
678                    })
679                }
680                "XksProxyUriInUseException" => crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyUriInUseException({
681                    let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
682                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
683                            e,
684                        ))
685                    })?;
686                    let mut tmp = <crate::types::error::builders::XksProxyUriInUseExceptionBuilder>::default();
687                    tmp.deserialize_members(&mut *deser).map_err(|e| {
688                        ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(
689                            e,
690                        ))
691                    })?;
692                    if tmp.message.is_none() {
693                        tmp.message = _error_message;
694                    }
695                    let tmp = tmp.meta(generic);
696                    tmp.build()
697                }),
698                "XksProxyUriUnreachableException" => {
699                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyUriUnreachableException({
700                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
701                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
702                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
703                            )
704                        })?;
705                        let mut tmp = <crate::types::error::builders::XksProxyUriUnreachableExceptionBuilder>::default();
706                        tmp.deserialize_members(&mut *deser).map_err(|e| {
707                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
708                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
709                            )
710                        })?;
711                        if tmp.message.is_none() {
712                            tmp.message = _error_message;
713                        }
714                        let tmp = tmp.meta(generic);
715                        tmp.build()
716                    })
717                }
718                "XksProxyVpcEndpointServiceInUseException" => {
719                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyVpcEndpointServiceInUseException({
720                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
721                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
722                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
723                            )
724                        })?;
725                        let mut tmp = <crate::types::error::builders::XksProxyVpcEndpointServiceInUseExceptionBuilder>::default();
726                        tmp.deserialize_members(&mut *deser).map_err(|e| {
727                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
728                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
729                            )
730                        })?;
731                        if tmp.message.is_none() {
732                            tmp.message = _error_message;
733                        }
734                        let tmp = tmp.meta(generic);
735                        tmp.build()
736                    })
737                }
738                "XksProxyVpcEndpointServiceInvalidConfigurationException" => {
739                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyVpcEndpointServiceInvalidConfigurationException({
740                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
741                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
742                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
743                            )
744                        })?;
745                        let mut tmp = <crate::types::error::builders::XksProxyVpcEndpointServiceInvalidConfigurationExceptionBuilder>::default();
746                        tmp.deserialize_members(&mut *deser).map_err(|e| {
747                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
748                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
749                            )
750                        })?;
751                        if tmp.message.is_none() {
752                            tmp.message = _error_message;
753                        }
754                        let tmp = tmp.meta(generic);
755                        tmp.build()
756                    })
757                }
758                "XksProxyVpcEndpointServiceNotFoundException" => {
759                    crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::XksProxyVpcEndpointServiceNotFoundException({
760                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
761                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
762                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
763                            )
764                        })?;
765                        let mut tmp = <crate::types::error::builders::XksProxyVpcEndpointServiceNotFoundExceptionBuilder>::default();
766                        tmp.deserialize_members(&mut *deser).map_err(|e| {
767                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
768                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
769                            )
770                        })?;
771                        if tmp.message.is_none() {
772                            tmp.message = _error_message;
773                        }
774                        let tmp = tmp.meta(generic);
775                        tmp.build()
776                    })
777                }
778                _ => {
779                    // Registry-backed, operation-scoped reification of an error whose
780                    // code this operation does not model directly: the operation's own
781                    // error registry is consulted first, then the lookup widens to the
782                    // service-wide error registry. On a hit, the reified error is attached
783                    // as the source of the returned unhandled error while its metadata
784                    // (code, message, request id) is preserved; on a miss the generic
785                    // error is returned unchanged.
786                    match protocol
787                        .deserialize_error_response(response, _cfg)
788                        .ok()
789                        .and_then(|mut deser| {
790                            ::aws_smithy_schema::registry::reify_error(
791                                crate::operation::update_custom_key_store::error_registry::REGISTRY
792                                    .or(&crate::error_type_registry::REGISTRY),
793                                error_code,
794                                &mut *deser,
795                            )
796                        }) {
797                        ::std::option::Option::Some(source) => <crate::operation::update_custom_key_store::UpdateCustomKeyStoreError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
798                        ::std::option::Option::None => crate::operation::update_custom_key_store::UpdateCustomKeyStoreError::generic(generic),
799                    }
800                }
801            };
802            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
803                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
804            ))
805        } else {
806            let protocol = _cfg
807                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
808                .expect("a SharedClientProtocol is required");
809            let mut deser = protocol
810                .deserialize_response(response, UpdateCustomKeyStore::OUTPUT_SCHEMA, _cfg)
811                .map_err(|e| {
812                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
813                })?;
814            // `headers` is already in scope from the top of the function; alias it as
815            // `_response_headers` so MutateOutput customizations have a stable name to
816            // read from.
817            let _response_headers = headers;
818            // `mut` is required because `deserialize_members` and the `MutateOutput`
819            // builder setters take `&mut self`. Marked `allow(unused_mut)` because an
820            // empty output has no members and no customizations to run.
821            #[allow(unused_mut)]
822            let mut output = <crate::operation::update_custom_key_store::builders::UpdateCustomKeyStoreOutputBuilder>::default();
823            output.deserialize_members(&mut *deser).map_err(|e| {
824                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
825            })?;
826            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
827            let output = output.build();
828            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
829        }
830    }
831}
832#[derive(Debug)]
833struct UpdateCustomKeyStoreRequestSerializer;
834impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateCustomKeyStoreRequestSerializer {
835    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
836    fn serialize_input(
837        &self,
838        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
839        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
840    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
841        let input = input
842            .downcast::<crate::operation::update_custom_key_store::UpdateCustomKeyStoreInput>()
843            .expect("correct type");
844
845        let protocol = _cfg
846            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
847            .expect("a SharedClientProtocol is required");
848        let mut request = protocol
849            .serialize_request(&input, UpdateCustomKeyStore::INPUT_SCHEMA, "/", _cfg)
850            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
851
852        return ::std::result::Result::Ok(request);
853    }
854}
855#[derive(Debug)]
856struct UpdateCustomKeyStoreEndpointParamsInterceptor;
857
858#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
859impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateCustomKeyStoreEndpointParamsInterceptor {
860    fn name(&self) -> &'static str {
861        "UpdateCustomKeyStoreEndpointParamsInterceptor"
862    }
863
864    fn read_before_execution(
865        &self,
866        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
867            '_,
868            ::aws_smithy_runtime_api::client::interceptors::context::Input,
869            ::aws_smithy_runtime_api::client::interceptors::context::Output,
870            ::aws_smithy_runtime_api::client::interceptors::context::Error,
871        >,
872        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
873    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
874        let _input = context
875            .input()
876            .downcast_ref::<UpdateCustomKeyStoreInput>()
877            .ok_or("failed to downcast to UpdateCustomKeyStoreInput")?;
878
879        let params = crate::config::endpoint::Params::builder()
880            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
881            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
882            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
883            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
884            .build()
885            .map_err(|err| {
886                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
887            })?;
888        cfg.interceptor_state()
889            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
890        ::std::result::Result::Ok(())
891    }
892}
893
894// The get_* functions below are generated from JMESPath expressions in the
895// operationContextParams trait. They target the operation's input shape.
896
897/// Error type for the `UpdateCustomKeyStoreError` operation.
898#[non_exhaustive]
899#[derive(::std::fmt::Debug)]
900pub enum UpdateCustomKeyStoreError {
901    /// <p>The request was rejected because the associated CloudHSM cluster did not meet the configuration requirements for an CloudHSM key store.</p>
902    /// <ul>
903    /// <li>
904    /// <p>The CloudHSM cluster must be configured with private subnets in at least two different Availability Zones in the Region.</p></li>
905    /// <li>
906    /// <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>
907    /// <li>
908    /// <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>
909    /// <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>
910    /// </ul>
911    /// <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>
912    CloudHsmClusterInvalidConfigurationException(crate::types::error::CloudHsmClusterInvalidConfigurationException),
913    /// <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>
914    CloudHsmClusterNotActiveException(crate::types::error::CloudHsmClusterNotActiveException),
915    /// <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>
916    CloudHsmClusterNotFoundException(crate::types::error::CloudHsmClusterNotFoundException),
917    /// <p>The request was rejected because the specified CloudHSM cluster has a different cluster certificate than the original cluster. You cannot use the operation to specify an unrelated cluster for an CloudHSM key store.</p>
918    /// <p>Specify an CloudHSM cluster that shares a backup history with the original cluster. This includes clusters that were created from a backup of the current cluster, and clusters that were created from the same backup that produced the current cluster.</p>
919    /// <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>
920    CloudHsmClusterNotRelatedException(crate::types::error::CloudHsmClusterNotRelatedException),
921    /// <p>The request was rejected because of the <code>ConnectionState</code> of the custom key store. To get the <code>ConnectionState</code> of a custom key store, use the <code>DescribeCustomKeyStores</code> operation.</p>
922    /// <p>This exception is thrown under the following conditions:</p>
923    /// <ul>
924    /// <li>
925    /// <p>You requested the <code>ConnectCustomKeyStore</code> operation on a custom key store with a <code>ConnectionState</code> of <code>DISCONNECTING</code> or <code>FAILED</code>. This operation is valid for all other <code>ConnectionState</code> values. To reconnect a custom key store in a <code>FAILED</code> state, disconnect it (<code>DisconnectCustomKeyStore</code>), then connect it (<code>ConnectCustomKeyStore</code>).</p></li>
926    /// <li>
927    /// <p>You requested the <code>CreateKey</code> operation in a custom key store that is not connected. This operations is valid only when the custom key store <code>ConnectionState</code> is <code>CONNECTED</code>.</p></li>
928    /// <li>
929    /// <p>You requested the <code>DisconnectCustomKeyStore</code> operation on a custom key store with a <code>ConnectionState</code> of <code>DISCONNECTING</code> or <code>DISCONNECTED</code>. This operation is valid for all other <code>ConnectionState</code> values.</p></li>
930    /// <li>
931    /// <p>You requested the <code>UpdateCustomKeyStore</code> or <code>DeleteCustomKeyStore</code> operation on a custom key store that is not disconnected. <code>UpdateCustomKeyStore</code> can be called on a custom key store in the <code>CONNECTED</code> state only to update <code>NewCustomKeyStoreName</code>. For all other properties, the custom key store <code>ConnectionState</code> must be <code>DISCONNECTED</code>.</p></li>
932    /// <li>
933    /// <p>You requested the <code>GenerateRandom</code> operation in an CloudHSM key store that is not connected. This operation is valid only when the CloudHSM key store <code>ConnectionState</code> is <code>CONNECTED</code>.</p></li>
934    /// </ul>
935    CustomKeyStoreInvalidStateException(crate::types::error::CustomKeyStoreInvalidStateException),
936    /// <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>
937    CustomKeyStoreNameInUseException(crate::types::error::CustomKeyStoreNameInUseException),
938    /// <p>The request was rejected because KMS cannot find a custom key store with the specified key store name or ID.</p>
939    CustomKeyStoreNotFoundException(crate::types::error::CustomKeyStoreNotFoundException),
940    /// <p>The request was rejected because an internal exception occurred. The request can be retried.</p>
941    KmsInternalException(crate::types::error::KmsInternalException),
942    /// <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>
943    XksProxyIncorrectAuthenticationCredentialException(crate::types::error::XksProxyIncorrectAuthenticationCredentialException),
944    /// <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>
945    XksProxyInvalidConfigurationException(crate::types::error::XksProxyInvalidConfigurationException),
946    /// <p></p>
947    /// <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>
948    XksProxyInvalidResponseException(crate::types::error::XksProxyInvalidResponseException),
949    /// <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>
950    XksProxyUriEndpointInUseException(crate::types::error::XksProxyUriEndpointInUseException),
951    /// <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>
952    XksProxyUriInUseException(crate::types::error::XksProxyUriInUseException),
953    /// <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>
954    /// <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>
955    XksProxyUriUnreachableException(crate::types::error::XksProxyUriUnreachableException),
956    /// <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>
957    XksProxyVpcEndpointServiceInUseException(crate::types::error::XksProxyVpcEndpointServiceInUseException),
958    /// <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>
959    XksProxyVpcEndpointServiceInvalidConfigurationException(crate::types::error::XksProxyVpcEndpointServiceInvalidConfigurationException),
960    /// <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>
961    XksProxyVpcEndpointServiceNotFoundException(crate::types::error::XksProxyVpcEndpointServiceNotFoundException),
962    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
963    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
964    variable wildcard pattern and check `.code()`:
965     \
966    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
967     \
968    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateCustomKeyStoreError) for what information is available for the error.")]
969    Unhandled(crate::error::sealed_unhandled::Unhandled),
970}
971impl UpdateCustomKeyStoreError {
972    /// Creates the `UpdateCustomKeyStoreError::Unhandled` variant from any error type.
973    pub fn unhandled(
974        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
975    ) -> Self {
976        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
977            source: err.into(),
978            meta: ::std::default::Default::default(),
979        })
980    }
981
982    /// Creates the `UpdateCustomKeyStoreError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
983    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
984        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
985            source: err.clone().into(),
986            meta: err,
987        })
988    }
989    ///
990    /// Returns error metadata, which includes the error code, message,
991    /// request ID, and potentially additional information.
992    ///
993    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
994        match self {
995            Self::CloudHsmClusterInvalidConfigurationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
996            Self::CloudHsmClusterNotActiveException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
997            Self::CloudHsmClusterNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
998            Self::CloudHsmClusterNotRelatedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
999            Self::CustomKeyStoreInvalidStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
1000            Self::CustomKeyStoreNameInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
1001            Self::CustomKeyStoreNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
1002            Self::KmsInternalException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
1003            Self::XksProxyIncorrectAuthenticationCredentialException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
1004            Self::XksProxyInvalidConfigurationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
1005            Self::XksProxyInvalidResponseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
1006            Self::XksProxyUriEndpointInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
1007            Self::XksProxyUriInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
1008            Self::XksProxyUriUnreachableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
1009            Self::XksProxyVpcEndpointServiceInUseException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
1010            Self::XksProxyVpcEndpointServiceInvalidConfigurationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
1011            Self::XksProxyVpcEndpointServiceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
1012            Self::Unhandled(e) => &e.meta,
1013        }
1014    }
1015    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::CloudHsmClusterInvalidConfigurationException`.
1016    pub fn is_cloud_hsm_cluster_invalid_configuration_exception(&self) -> bool {
1017        matches!(self, Self::CloudHsmClusterInvalidConfigurationException(_))
1018    }
1019    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::CloudHsmClusterNotActiveException`.
1020    pub fn is_cloud_hsm_cluster_not_active_exception(&self) -> bool {
1021        matches!(self, Self::CloudHsmClusterNotActiveException(_))
1022    }
1023    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::CloudHsmClusterNotFoundException`.
1024    pub fn is_cloud_hsm_cluster_not_found_exception(&self) -> bool {
1025        matches!(self, Self::CloudHsmClusterNotFoundException(_))
1026    }
1027    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::CloudHsmClusterNotRelatedException`.
1028    pub fn is_cloud_hsm_cluster_not_related_exception(&self) -> bool {
1029        matches!(self, Self::CloudHsmClusterNotRelatedException(_))
1030    }
1031    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::CustomKeyStoreInvalidStateException`.
1032    pub fn is_custom_key_store_invalid_state_exception(&self) -> bool {
1033        matches!(self, Self::CustomKeyStoreInvalidStateException(_))
1034    }
1035    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::CustomKeyStoreNameInUseException`.
1036    pub fn is_custom_key_store_name_in_use_exception(&self) -> bool {
1037        matches!(self, Self::CustomKeyStoreNameInUseException(_))
1038    }
1039    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::CustomKeyStoreNotFoundException`.
1040    pub fn is_custom_key_store_not_found_exception(&self) -> bool {
1041        matches!(self, Self::CustomKeyStoreNotFoundException(_))
1042    }
1043    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::KmsInternalException`.
1044    pub fn is_kms_internal_exception(&self) -> bool {
1045        matches!(self, Self::KmsInternalException(_))
1046    }
1047    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::XksProxyIncorrectAuthenticationCredentialException`.
1048    pub fn is_xks_proxy_incorrect_authentication_credential_exception(&self) -> bool {
1049        matches!(self, Self::XksProxyIncorrectAuthenticationCredentialException(_))
1050    }
1051    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::XksProxyInvalidConfigurationException`.
1052    pub fn is_xks_proxy_invalid_configuration_exception(&self) -> bool {
1053        matches!(self, Self::XksProxyInvalidConfigurationException(_))
1054    }
1055    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::XksProxyInvalidResponseException`.
1056    pub fn is_xks_proxy_invalid_response_exception(&self) -> bool {
1057        matches!(self, Self::XksProxyInvalidResponseException(_))
1058    }
1059    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::XksProxyUriEndpointInUseException`.
1060    pub fn is_xks_proxy_uri_endpoint_in_use_exception(&self) -> bool {
1061        matches!(self, Self::XksProxyUriEndpointInUseException(_))
1062    }
1063    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::XksProxyUriInUseException`.
1064    pub fn is_xks_proxy_uri_in_use_exception(&self) -> bool {
1065        matches!(self, Self::XksProxyUriInUseException(_))
1066    }
1067    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::XksProxyUriUnreachableException`.
1068    pub fn is_xks_proxy_uri_unreachable_exception(&self) -> bool {
1069        matches!(self, Self::XksProxyUriUnreachableException(_))
1070    }
1071    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::XksProxyVpcEndpointServiceInUseException`.
1072    pub fn is_xks_proxy_vpc_endpoint_service_in_use_exception(&self) -> bool {
1073        matches!(self, Self::XksProxyVpcEndpointServiceInUseException(_))
1074    }
1075    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::XksProxyVpcEndpointServiceInvalidConfigurationException`.
1076    pub fn is_xks_proxy_vpc_endpoint_service_invalid_configuration_exception(&self) -> bool {
1077        matches!(self, Self::XksProxyVpcEndpointServiceInvalidConfigurationException(_))
1078    }
1079    /// Returns `true` if the error kind is `UpdateCustomKeyStoreError::XksProxyVpcEndpointServiceNotFoundException`.
1080    pub fn is_xks_proxy_vpc_endpoint_service_not_found_exception(&self) -> bool {
1081        matches!(self, Self::XksProxyVpcEndpointServiceNotFoundException(_))
1082    }
1083}
1084impl ::std::error::Error for UpdateCustomKeyStoreError {
1085    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
1086        match self {
1087            Self::CloudHsmClusterInvalidConfigurationException(_inner) => ::std::option::Option::Some(_inner),
1088            Self::CloudHsmClusterNotActiveException(_inner) => ::std::option::Option::Some(_inner),
1089            Self::CloudHsmClusterNotFoundException(_inner) => ::std::option::Option::Some(_inner),
1090            Self::CloudHsmClusterNotRelatedException(_inner) => ::std::option::Option::Some(_inner),
1091            Self::CustomKeyStoreInvalidStateException(_inner) => ::std::option::Option::Some(_inner),
1092            Self::CustomKeyStoreNameInUseException(_inner) => ::std::option::Option::Some(_inner),
1093            Self::CustomKeyStoreNotFoundException(_inner) => ::std::option::Option::Some(_inner),
1094            Self::KmsInternalException(_inner) => ::std::option::Option::Some(_inner),
1095            Self::XksProxyIncorrectAuthenticationCredentialException(_inner) => ::std::option::Option::Some(_inner),
1096            Self::XksProxyInvalidConfigurationException(_inner) => ::std::option::Option::Some(_inner),
1097            Self::XksProxyInvalidResponseException(_inner) => ::std::option::Option::Some(_inner),
1098            Self::XksProxyUriEndpointInUseException(_inner) => ::std::option::Option::Some(_inner),
1099            Self::XksProxyUriInUseException(_inner) => ::std::option::Option::Some(_inner),
1100            Self::XksProxyUriUnreachableException(_inner) => ::std::option::Option::Some(_inner),
1101            Self::XksProxyVpcEndpointServiceInUseException(_inner) => ::std::option::Option::Some(_inner),
1102            Self::XksProxyVpcEndpointServiceInvalidConfigurationException(_inner) => ::std::option::Option::Some(_inner),
1103            Self::XksProxyVpcEndpointServiceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
1104            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
1105        }
1106    }
1107}
1108impl ::std::fmt::Display for UpdateCustomKeyStoreError {
1109    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1110        match self {
1111            Self::CloudHsmClusterInvalidConfigurationException(_inner) => _inner.fmt(f),
1112            Self::CloudHsmClusterNotActiveException(_inner) => _inner.fmt(f),
1113            Self::CloudHsmClusterNotFoundException(_inner) => _inner.fmt(f),
1114            Self::CloudHsmClusterNotRelatedException(_inner) => _inner.fmt(f),
1115            Self::CustomKeyStoreInvalidStateException(_inner) => _inner.fmt(f),
1116            Self::CustomKeyStoreNameInUseException(_inner) => _inner.fmt(f),
1117            Self::CustomKeyStoreNotFoundException(_inner) => _inner.fmt(f),
1118            Self::KmsInternalException(_inner) => _inner.fmt(f),
1119            Self::XksProxyIncorrectAuthenticationCredentialException(_inner) => _inner.fmt(f),
1120            Self::XksProxyInvalidConfigurationException(_inner) => _inner.fmt(f),
1121            Self::XksProxyInvalidResponseException(_inner) => _inner.fmt(f),
1122            Self::XksProxyUriEndpointInUseException(_inner) => _inner.fmt(f),
1123            Self::XksProxyUriInUseException(_inner) => _inner.fmt(f),
1124            Self::XksProxyUriUnreachableException(_inner) => _inner.fmt(f),
1125            Self::XksProxyVpcEndpointServiceInUseException(_inner) => _inner.fmt(f),
1126            Self::XksProxyVpcEndpointServiceInvalidConfigurationException(_inner) => _inner.fmt(f),
1127            Self::XksProxyVpcEndpointServiceNotFoundException(_inner) => _inner.fmt(f),
1128            Self::Unhandled(_inner) => {
1129                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
1130                    write!(f, "unhandled error ({code})")
1131                } else {
1132                    f.write_str("unhandled error")
1133                }
1134            }
1135        }
1136    }
1137}
1138impl ::aws_smithy_types::retry::ProvideErrorKind for UpdateCustomKeyStoreError {
1139    fn code(&self) -> ::std::option::Option<&str> {
1140        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
1141    }
1142    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
1143        ::std::option::Option::None
1144    }
1145}
1146impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateCustomKeyStoreError {
1147    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
1148        match self {
1149            Self::CloudHsmClusterInvalidConfigurationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1150            Self::CloudHsmClusterNotActiveException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1151            Self::CloudHsmClusterNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1152            Self::CloudHsmClusterNotRelatedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1153            Self::CustomKeyStoreInvalidStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1154            Self::CustomKeyStoreNameInUseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1155            Self::CustomKeyStoreNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1156            Self::KmsInternalException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1157            Self::XksProxyIncorrectAuthenticationCredentialException(_inner) => {
1158                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
1159            }
1160            Self::XksProxyInvalidConfigurationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1161            Self::XksProxyInvalidResponseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1162            Self::XksProxyUriEndpointInUseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1163            Self::XksProxyUriInUseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1164            Self::XksProxyUriUnreachableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1165            Self::XksProxyVpcEndpointServiceInUseException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1166            Self::XksProxyVpcEndpointServiceInvalidConfigurationException(_inner) => {
1167                ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
1168            }
1169            Self::XksProxyVpcEndpointServiceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
1170            Self::Unhandled(_inner) => &_inner.meta,
1171        }
1172    }
1173}
1174impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateCustomKeyStoreError {
1175    fn create_unhandled_error(
1176        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
1177        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
1178    ) -> Self {
1179        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
1180            source,
1181            meta: meta.unwrap_or_default(),
1182        })
1183    }
1184}
1185impl ::aws_types::request_id::RequestId for crate::operation::update_custom_key_store::UpdateCustomKeyStoreError {
1186    fn request_id(&self) -> Option<&str> {
1187        self.meta().request_id()
1188    }
1189}
1190
1191pub use crate::operation::update_custom_key_store::_update_custom_key_store_input::UpdateCustomKeyStoreInput;
1192
1193pub use crate::operation::update_custom_key_store::_update_custom_key_store_output::UpdateCustomKeyStoreOutput;
1194
1195mod _update_custom_key_store_input;
1196
1197mod _update_custom_key_store_output;
1198
1199/// Builders
1200pub mod builders;