Skip to main content

aws_sdk_kms/operation/
generate_data_key_without_plaintext.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `GenerateDataKeyWithoutPlaintext`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct GenerateDataKeyWithoutPlaintext;
6impl GenerateDataKeyWithoutPlaintext {
7    /// Creates a new `GenerateDataKeyWithoutPlaintext`
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::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextInput::SCHEMA;
14    /// The schema for this operation's output shape.
15    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
16        crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextOutput::SCHEMA;
17    pub(crate) async fn orchestrate(
18        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
19        input: crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextInput,
20    ) -> ::std::result::Result<
21        crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextOutput,
22        ::aws_smithy_runtime_api::client::result::SdkError<
23            crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError,
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::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError>()
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::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextOutput>()
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::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextInput,
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(
61            "KMS",
62            "GenerateDataKeyWithoutPlaintext",
63            input,
64            runtime_plugins,
65            stop_point,
66        )
67        // Create a parent span for the entire operation. Includes a random, internal-only,
68        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
69        .instrument(::tracing::debug_span!(
70            "KMS.GenerateDataKeyWithoutPlaintext",
71            "rpc.service" = "KMS",
72            "rpc.method" = "GenerateDataKeyWithoutPlaintext",
73            "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
74            "rpc.system" = "aws-api",
75        ))
76        .await
77    }
78
79    pub(crate) fn operation_runtime_plugins(
80        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
81        client_config: &crate::config::Config,
82        config_override: ::std::option::Option<crate::config::Builder>,
83    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
84        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
85
86        if let ::std::option::Option::Some(config_override) = config_override {
87            for plugin in config_override.runtime_plugins.iter().cloned() {
88                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
89            }
90            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
91                config_override,
92                client_config.config.clone(),
93                &client_config.runtime_components,
94            ));
95        }
96        runtime_plugins
97    }
98}
99/// Per-operation error registry. Contains an entry for every modeled
100/// error this operation can throw.
101///
102/// Used by the schema-serde error path as the operation-scoped lookup
103/// for registry-backed error reification: an error code that does not
104/// match one of the operation's modeled errors directly is resolved
105/// against this registry first, then widened to the service-wide error
106/// registry.
107pub(crate) mod error_registry {
108    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
109        ::aws_smithy_schema::registry::TypeRegistry::builder()
110                            .insert_error_shape(
111                        crate::types::error::DependencyTimeoutException::SCHEMA,
112                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
113                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::DependencyTimeoutException::deserialize(d)?))
114                        },
115                        |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> {
116                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::DependencyTimeoutException::deserialize(d)?))
117                        },
118                    )
119.insert_error_shape(
120                        crate::types::error::DisabledException::SCHEMA,
121                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
122                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::DisabledException::deserialize(d)?))
123                        },
124                        |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> {
125                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::DisabledException::deserialize(d)?))
126                        },
127                    )
128.insert_error_shape(
129                        crate::types::error::DryRunOperationException::SCHEMA,
130                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
131                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::DryRunOperationException::deserialize(d)?))
132                        },
133                        |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> {
134                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::DryRunOperationException::deserialize(d)?))
135                        },
136                    )
137.insert_error_shape(
138                        crate::types::error::InvalidGrantTokenException::SCHEMA,
139                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
140                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidGrantTokenException::deserialize(d)?))
141                        },
142                        |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> {
143                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidGrantTokenException::deserialize(d)?))
144                        },
145                    )
146.insert_error_shape(
147                        crate::types::error::InvalidKeyUsageException::SCHEMA,
148                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
149                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidKeyUsageException::deserialize(d)?))
150                        },
151                        |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> {
152                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidKeyUsageException::deserialize(d)?))
153                        },
154                    )
155.insert_error_shape(
156                        crate::types::error::KmsInternalException::SCHEMA,
157                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
158                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::KmsInternalException::deserialize(d)?))
159                        },
160                        |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> {
161                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::KmsInternalException::deserialize(d)?))
162                        },
163                    )
164.insert_error_shape(
165                        crate::types::error::KmsInvalidStateException::SCHEMA,
166                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
167                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::KmsInvalidStateException::deserialize(d)?))
168                        },
169                        |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> {
170                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::KmsInvalidStateException::deserialize(d)?))
171                        },
172                    )
173.insert_error_shape(
174                        crate::types::error::KeyUnavailableException::SCHEMA,
175                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
176                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::KeyUnavailableException::deserialize(d)?))
177                        },
178                        |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> {
179                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::KeyUnavailableException::deserialize(d)?))
180                        },
181                    )
182.insert_error_shape(
183                        crate::types::error::NotFoundException::SCHEMA,
184                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
185                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::NotFoundException::deserialize(d)?))
186                        },
187                        |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> {
188                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::NotFoundException::deserialize(d)?))
189                        },
190                    )
191                            .build()
192    });
193}
194impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GenerateDataKeyWithoutPlaintext {
195    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
196        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GenerateDataKeyWithoutPlaintext");
197
198        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
199            GenerateDataKeyWithoutPlaintextRequestSerializer,
200        ));
201        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
202            GenerateDataKeyWithoutPlaintextResponseDeserializer,
203        ));
204
205        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
206            crate::config::auth::Params::builder()
207                .operation_name("GenerateDataKeyWithoutPlaintext")
208                .build()
209                .expect("required fields set"),
210        ));
211
212        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
213            "GenerateDataKeyWithoutPlaintext",
214            "KMS",
215        ));
216        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
217        signing_options.double_uri_encode = true;
218        signing_options.content_sha256_header = false;
219        signing_options.normalize_uri_path = true;
220        signing_options.payload_override = None;
221
222        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
223            signing_options,
224            ..::std::default::Default::default()
225        });
226
227        ::std::option::Option::Some(cfg.freeze())
228    }
229
230    fn runtime_components(
231        &self,
232        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
233    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
234        #[allow(unused_mut)]
235        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GenerateDataKeyWithoutPlaintext")
236            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
237                GenerateDataKeyWithoutPlaintextTelemetryInputCaptureInterceptor,
238            ))
239            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
240                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
241            ))
242            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
243                GenerateDataKeyWithoutPlaintextEndpointParamsInterceptor,
244            ))
245            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
246                crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError,
247            >::new())
248            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
249                crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError,
250            >::new())
251            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
252                crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError,
253            >::new())
254            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
255                crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError,
256            >::new());
257
258        ::std::borrow::Cow::Owned(rcb)
259    }
260}
261
262#[derive(Debug)]
263struct GenerateDataKeyWithoutPlaintextTelemetryInputCaptureInterceptor;
264
265#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
266impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GenerateDataKeyWithoutPlaintextTelemetryInputCaptureInterceptor {
267    fn name(&self) -> &'static str {
268        "GenerateDataKeyWithoutPlaintextTelemetryInputCaptureInterceptor"
269    }
270
271    fn read_before_execution(
272        &self,
273        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
274            '_,
275            ::aws_smithy_runtime_api::client::interceptors::context::Input,
276            ::aws_smithy_runtime_api::client::interceptors::context::Output,
277            ::aws_smithy_runtime_api::client::interceptors::context::Error,
278        >,
279        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
280    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
281        // Nothing to do unless the customer opted in by naming members to record.
282        let ::std::option::Option::Some(requested) = cfg
283            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
284            .filter(|r| !r.is_empty())
285        else {
286            return ::std::result::Result::Ok(());
287        };
288
289        let ::std::option::Option::Some(input) = context.input().downcast_ref::<GenerateDataKeyWithoutPlaintextInput>() else {
290            // A mismatched input is not this interceptor's concern; skip quietly.
291            return ::std::result::Result::Ok(());
292        };
293
294        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
295        if requested.should_capture("KeyId") {
296            if let ::std::option::Option::Some(value) = input.key_id.as_deref() {
297                captured.insert("KeyId", value);
298            }
299        }
300
301        cfg.interceptor_state().store_put(captured);
302        ::std::result::Result::Ok(())
303    }
304}
305#[derive(Debug)]
306struct GenerateDataKeyWithoutPlaintextResponseDeserializer;
307impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GenerateDataKeyWithoutPlaintextResponseDeserializer {
308    fn deserialize_nonstreaming_with_config(
309        &self,
310        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
311        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
312    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
313        let (success, status) = (response.status().is_success(), response.status().as_u16());
314        // Load body and headers BEFORE BeforeParseResponse so customizations
315        // (e.g., S3's `body_is_error` check that detects errors returned with
316        // HTTP 200) can inspect them. The legacy non-streaming path also
317        // loads `body` before firing this hook.
318        #[allow(unused_variables)]
319        let body = response.body().bytes().expect("body loaded");
320        let headers = response.headers();
321        #[allow(unused_mut)]
322        let mut force_error = false;
323        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
324        if !success && status != 200 || force_error {
325            let protocol = _cfg
326                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
327                .expect("a SharedClientProtocol is required");
328            #[allow(unused_mut)]
329            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
330                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
331            })?;
332            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
333            let generic = generic_builder.build();
334            let error_code = match generic.code() {
335                ::std::option::Option::Some(code) => code,
336                ::std::option::Option::None => {
337                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
338                        ::aws_smithy_runtime_api::box_error::BoxError::from(
339                            crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError::unhandled(generic),
340                        ),
341                    ))
342                }
343            };
344            let _error_message = generic.message().map(|msg| msg.to_owned());
345            let err = match error_code {
346                "DependencyTimeoutException" => {
347                    crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError::DependencyTimeoutException({
348                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
349                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
350                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
351                            )
352                        })?;
353                        let mut tmp = <crate::types::error::builders::DependencyTimeoutExceptionBuilder>::default();
354                        tmp.deserialize_members(&mut *deser).map_err(|e| {
355                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
356                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
357                            )
358                        })?;
359                        if tmp.message.is_none() {
360                            tmp.message = _error_message;
361                        }
362                        let tmp = tmp.meta(generic);
363                        tmp.build()
364                    })
365                }
366                "DisabledException" => {
367                    crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError::DisabledException({
368                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
369                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
370                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
371                            )
372                        })?;
373                        let mut tmp = <crate::types::error::builders::DisabledExceptionBuilder>::default();
374                        tmp.deserialize_members(&mut *deser).map_err(|e| {
375                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
376                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
377                            )
378                        })?;
379                        if tmp.message.is_none() {
380                            tmp.message = _error_message;
381                        }
382                        let tmp = tmp.meta(generic);
383                        tmp.build()
384                    })
385                }
386                "DryRunOperationException" => {
387                    crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError::DryRunOperationException({
388                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
389                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
390                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
391                            )
392                        })?;
393                        let mut tmp = <crate::types::error::builders::DryRunOperationExceptionBuilder>::default();
394                        tmp.deserialize_members(&mut *deser).map_err(|e| {
395                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
396                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
397                            )
398                        })?;
399                        if tmp.message.is_none() {
400                            tmp.message = _error_message;
401                        }
402                        let tmp = tmp.meta(generic);
403                        tmp.build()
404                    })
405                }
406                "InvalidGrantTokenException" => {
407                    crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError::InvalidGrantTokenException({
408                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
409                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
410                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
411                            )
412                        })?;
413                        let mut tmp = <crate::types::error::builders::InvalidGrantTokenExceptionBuilder>::default();
414                        tmp.deserialize_members(&mut *deser).map_err(|e| {
415                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
416                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
417                            )
418                        })?;
419                        if tmp.message.is_none() {
420                            tmp.message = _error_message;
421                        }
422                        let tmp = tmp.meta(generic);
423                        tmp.build()
424                    })
425                }
426                "InvalidKeyUsageException" => {
427                    crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError::InvalidKeyUsageException({
428                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
429                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
430                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
431                            )
432                        })?;
433                        let mut tmp = <crate::types::error::builders::InvalidKeyUsageExceptionBuilder>::default();
434                        tmp.deserialize_members(&mut *deser).map_err(|e| {
435                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
436                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
437                            )
438                        })?;
439                        if tmp.message.is_none() {
440                            tmp.message = _error_message;
441                        }
442                        let tmp = tmp.meta(generic);
443                        tmp.build()
444                    })
445                }
446                "KeyUnavailableException" => {
447                    crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError::KeyUnavailableException({
448                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
449                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
450                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
451                            )
452                        })?;
453                        let mut tmp = <crate::types::error::builders::KeyUnavailableExceptionBuilder>::default();
454                        tmp.deserialize_members(&mut *deser).map_err(|e| {
455                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
456                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
457                            )
458                        })?;
459                        if tmp.message.is_none() {
460                            tmp.message = _error_message;
461                        }
462                        let tmp = tmp.meta(generic);
463                        tmp.build()
464                    })
465                }
466                "KMSInternalException" => {
467                    crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError::KmsInternalException({
468                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
469                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
470                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
471                            )
472                        })?;
473                        let mut tmp = <crate::types::error::builders::KmsInternalExceptionBuilder>::default();
474                        tmp.deserialize_members(&mut *deser).map_err(|e| {
475                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
476                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
477                            )
478                        })?;
479                        if tmp.message.is_none() {
480                            tmp.message = _error_message;
481                        }
482                        let tmp = tmp.meta(generic);
483                        tmp.build()
484                    })
485                }
486                "KMSInvalidStateException" => {
487                    crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError::KmsInvalidStateException({
488                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
489                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
490                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
491                            )
492                        })?;
493                        let mut tmp = <crate::types::error::builders::KmsInvalidStateExceptionBuilder>::default();
494                        tmp.deserialize_members(&mut *deser).map_err(|e| {
495                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
496                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
497                            )
498                        })?;
499                        if tmp.message.is_none() {
500                            tmp.message = _error_message;
501                        }
502                        let tmp = tmp.meta(generic);
503                        tmp.build()
504                    })
505                }
506                "NotFoundException" => {
507                    crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError::NotFoundException({
508                        let mut deser = protocol.deserialize_error_response(response, _cfg).map_err(|e| {
509                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
510                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
511                            )
512                        })?;
513                        let mut tmp = <crate::types::error::builders::NotFoundExceptionBuilder>::default();
514                        tmp.deserialize_members(&mut *deser).map_err(|e| {
515                            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
516                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
517                            )
518                        })?;
519                        if tmp.message.is_none() {
520                            tmp.message = _error_message;
521                        }
522                        let tmp = tmp.meta(generic);
523                        tmp.build()
524                    })
525                }
526                _ => {
527                    // Registry-backed, operation-scoped reification of an error whose
528                    // code this operation does not model directly: the operation's own
529                    // error registry is consulted first, then the lookup widens to the
530                    // service-wide error registry. On a hit, the reified error is attached
531                    // as the source of the returned unhandled error while its metadata
532                    // (code, message, request id) is preserved; on a miss the generic
533                    // error is returned unchanged.
534                    match protocol
535                        .deserialize_error_response(response, _cfg)
536                        .ok()
537                        .and_then(|mut deser| {
538                            ::aws_smithy_schema::registry::reify_error(
539                                crate::operation::generate_data_key_without_plaintext::error_registry::REGISTRY
540                                    .or(&crate::error_type_registry::REGISTRY),
541                                error_code,
542                                &mut *deser,
543                            )
544                        }) {
545                        ::std::option::Option::Some(source) => <crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
546                        ::std::option::Option::None => crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError::generic(generic),
547                    }
548                }
549            };
550            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
551                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
552            ))
553        } else {
554            let protocol = _cfg
555                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
556                .expect("a SharedClientProtocol is required");
557            let mut deser = protocol
558                .deserialize_response(response, GenerateDataKeyWithoutPlaintext::OUTPUT_SCHEMA, _cfg)
559                .map_err(|e| {
560                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
561                })?;
562            // `headers` is already in scope from the top of the function; alias it as
563            // `_response_headers` so MutateOutput customizations have a stable name to
564            // read from.
565            let _response_headers = headers;
566            // `mut` is required because `deserialize_members` and the `MutateOutput`
567            // builder setters take `&mut self`. Marked `allow(unused_mut)` because an
568            // empty output has no members and no customizations to run.
569            #[allow(unused_mut)]
570            let mut output =
571                <crate::operation::generate_data_key_without_plaintext::builders::GenerateDataKeyWithoutPlaintextOutputBuilder>::default();
572            output.deserialize_members(&mut *deser).map_err(|e| {
573                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
574            })?;
575            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
576            let output = output.build();
577            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
578        }
579    }
580}
581#[derive(Debug)]
582struct GenerateDataKeyWithoutPlaintextRequestSerializer;
583impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GenerateDataKeyWithoutPlaintextRequestSerializer {
584    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
585    fn serialize_input(
586        &self,
587        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
588        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
589    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
590        let input = input
591            .downcast::<crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextInput>()
592            .expect("correct type");
593
594        let protocol = _cfg
595            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
596            .expect("a SharedClientProtocol is required");
597        let mut request = protocol
598            .serialize_request(&input, GenerateDataKeyWithoutPlaintext::INPUT_SCHEMA, "/", _cfg)
599            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
600
601        return ::std::result::Result::Ok(request);
602    }
603}
604#[derive(Debug)]
605struct GenerateDataKeyWithoutPlaintextEndpointParamsInterceptor;
606
607#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
608impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GenerateDataKeyWithoutPlaintextEndpointParamsInterceptor {
609    fn name(&self) -> &'static str {
610        "GenerateDataKeyWithoutPlaintextEndpointParamsInterceptor"
611    }
612
613    fn read_before_execution(
614        &self,
615        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
616            '_,
617            ::aws_smithy_runtime_api::client::interceptors::context::Input,
618            ::aws_smithy_runtime_api::client::interceptors::context::Output,
619            ::aws_smithy_runtime_api::client::interceptors::context::Error,
620        >,
621        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
622    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
623        let _input = context
624            .input()
625            .downcast_ref::<GenerateDataKeyWithoutPlaintextInput>()
626            .ok_or("failed to downcast to GenerateDataKeyWithoutPlaintextInput")?;
627
628        let params = crate::config::endpoint::Params::builder()
629            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
630            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
631            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
632            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
633            .build()
634            .map_err(|err| {
635                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
636            })?;
637        cfg.interceptor_state()
638            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
639        ::std::result::Result::Ok(())
640    }
641}
642
643// The get_* functions below are generated from JMESPath expressions in the
644// operationContextParams trait. They target the operation's input shape.
645
646/// Error type for the `GenerateDataKeyWithoutPlaintextError` operation.
647#[non_exhaustive]
648#[derive(::std::fmt::Debug)]
649pub enum GenerateDataKeyWithoutPlaintextError {
650    /// <p>The system timed out while trying to fulfill the request. You can retry the request.</p>
651    DependencyTimeoutException(crate::types::error::DependencyTimeoutException),
652    /// <p>The request was rejected because the specified KMS key is not enabled.</p>
653    DisabledException(crate::types::error::DisabledException),
654    /// <p>The request was rejected because the DryRun parameter was specified.</p>
655    DryRunOperationException(crate::types::error::DryRunOperationException),
656    /// <p>The request was rejected because the specified grant token is not valid.</p>
657    InvalidGrantTokenException(crate::types::error::InvalidGrantTokenException),
658    /// <p>The request was rejected for one of the following reasons:</p>
659    /// <ul>
660    /// <li>
661    /// <p>The <code>KeyUsage</code> value of the KMS key is incompatible with the API operation.</p></li>
662    /// <li>
663    /// <p>The encryption algorithm or signing algorithm specified for the operation is incompatible with the type of key material in the KMS key <code>(KeySpec</code>).</p></li>
664    /// </ul>
665    /// <p>For encrypting, decrypting, re-encrypting, and generating data keys, the <code>KeyUsage</code> must be <code>ENCRYPT_DECRYPT</code>. For signing and verifying messages, the <code>KeyUsage</code> must be <code>SIGN_VERIFY</code>. For generating and verifying message authentication codes (MACs), the <code>KeyUsage</code> must be <code>GENERATE_VERIFY_MAC</code>. For deriving key agreement secrets, the <code>KeyUsage</code> must be <code>KEY_AGREEMENT</code>. For encapsulating and decapsulating shared secrets, the <code>KeyUsage</code> must be <code>ENCAPSULATE_DECAPSULATE</code>. To find the <code>KeyUsage</code> of a KMS key, use the <code>DescribeKey</code> operation.</p>
666    /// <p>To find the encryption or signing algorithms supported for a particular KMS key, use the <code>DescribeKey</code> operation.</p>
667    InvalidKeyUsageException(crate::types::error::InvalidKeyUsageException),
668    /// <p>The request was rejected because the specified KMS key was not available. You can retry the request.</p>
669    KeyUnavailableException(crate::types::error::KeyUnavailableException),
670    /// <p>The request was rejected because an internal exception occurred. The request can be retried.</p>
671    KmsInternalException(crate::types::error::KmsInternalException),
672    /// <p>The request was rejected because the state of the specified resource is not valid for this request.</p>
673    /// <p>This exceptions means one of the following:</p>
674    /// <ul>
675    /// <li>
676    /// <p>The key state of the KMS key is not compatible with the operation.</p>
677    /// <p>To find the key state, use the <code>DescribeKey</code> operation. For more information about which key states are compatible with each KMS operation, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html">Key states of KMS keys</a> in the <i> <i>Key Management Service Developer Guide</i> </i>.</p></li>
678    /// <li>
679    /// <p>For cryptographic operations on KMS keys in custom key stores, this exception represents a general failure with many possible causes. To identify the cause, see the error message that accompanies the exception.</p></li>
680    /// </ul>
681    KmsInvalidStateException(crate::types::error::KmsInvalidStateException),
682    /// <p>The request was rejected because the specified entity or resource could not be found.</p>
683    NotFoundException(crate::types::error::NotFoundException),
684    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
685    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
686    variable wildcard pattern and check `.code()`:
687     \
688    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
689     \
690    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GenerateDataKeyWithoutPlaintextError) for what information is available for the error.")]
691    Unhandled(crate::error::sealed_unhandled::Unhandled),
692}
693impl GenerateDataKeyWithoutPlaintextError {
694    /// Creates the `GenerateDataKeyWithoutPlaintextError::Unhandled` variant from any error type.
695    pub fn unhandled(
696        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
697    ) -> Self {
698        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
699            source: err.into(),
700            meta: ::std::default::Default::default(),
701        })
702    }
703
704    /// Creates the `GenerateDataKeyWithoutPlaintextError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
705    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
706        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
707            source: err.clone().into(),
708            meta: err,
709        })
710    }
711    ///
712    /// Returns error metadata, which includes the error code, message,
713    /// request ID, and potentially additional information.
714    ///
715    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
716        match self {
717            Self::DependencyTimeoutException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
718            Self::DisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
719            Self::DryRunOperationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
720            Self::InvalidGrantTokenException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
721            Self::InvalidKeyUsageException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
722            Self::KeyUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
723            Self::KmsInternalException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
724            Self::KmsInvalidStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
725            Self::NotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
726            Self::Unhandled(e) => &e.meta,
727        }
728    }
729    /// Returns `true` if the error kind is `GenerateDataKeyWithoutPlaintextError::DependencyTimeoutException`.
730    pub fn is_dependency_timeout_exception(&self) -> bool {
731        matches!(self, Self::DependencyTimeoutException(_))
732    }
733    /// Returns `true` if the error kind is `GenerateDataKeyWithoutPlaintextError::DisabledException`.
734    pub fn is_disabled_exception(&self) -> bool {
735        matches!(self, Self::DisabledException(_))
736    }
737    /// Returns `true` if the error kind is `GenerateDataKeyWithoutPlaintextError::DryRunOperationException`.
738    pub fn is_dry_run_operation_exception(&self) -> bool {
739        matches!(self, Self::DryRunOperationException(_))
740    }
741    /// Returns `true` if the error kind is `GenerateDataKeyWithoutPlaintextError::InvalidGrantTokenException`.
742    pub fn is_invalid_grant_token_exception(&self) -> bool {
743        matches!(self, Self::InvalidGrantTokenException(_))
744    }
745    /// Returns `true` if the error kind is `GenerateDataKeyWithoutPlaintextError::InvalidKeyUsageException`.
746    pub fn is_invalid_key_usage_exception(&self) -> bool {
747        matches!(self, Self::InvalidKeyUsageException(_))
748    }
749    /// Returns `true` if the error kind is `GenerateDataKeyWithoutPlaintextError::KeyUnavailableException`.
750    pub fn is_key_unavailable_exception(&self) -> bool {
751        matches!(self, Self::KeyUnavailableException(_))
752    }
753    /// Returns `true` if the error kind is `GenerateDataKeyWithoutPlaintextError::KmsInternalException`.
754    pub fn is_kms_internal_exception(&self) -> bool {
755        matches!(self, Self::KmsInternalException(_))
756    }
757    /// Returns `true` if the error kind is `GenerateDataKeyWithoutPlaintextError::KmsInvalidStateException`.
758    pub fn is_kms_invalid_state_exception(&self) -> bool {
759        matches!(self, Self::KmsInvalidStateException(_))
760    }
761    /// Returns `true` if the error kind is `GenerateDataKeyWithoutPlaintextError::NotFoundException`.
762    pub fn is_not_found_exception(&self) -> bool {
763        matches!(self, Self::NotFoundException(_))
764    }
765}
766impl ::std::error::Error for GenerateDataKeyWithoutPlaintextError {
767    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
768        match self {
769            Self::DependencyTimeoutException(_inner) => ::std::option::Option::Some(_inner),
770            Self::DisabledException(_inner) => ::std::option::Option::Some(_inner),
771            Self::DryRunOperationException(_inner) => ::std::option::Option::Some(_inner),
772            Self::InvalidGrantTokenException(_inner) => ::std::option::Option::Some(_inner),
773            Self::InvalidKeyUsageException(_inner) => ::std::option::Option::Some(_inner),
774            Self::KeyUnavailableException(_inner) => ::std::option::Option::Some(_inner),
775            Self::KmsInternalException(_inner) => ::std::option::Option::Some(_inner),
776            Self::KmsInvalidStateException(_inner) => ::std::option::Option::Some(_inner),
777            Self::NotFoundException(_inner) => ::std::option::Option::Some(_inner),
778            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
779        }
780    }
781}
782impl ::std::fmt::Display for GenerateDataKeyWithoutPlaintextError {
783    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
784        match self {
785            Self::DependencyTimeoutException(_inner) => _inner.fmt(f),
786            Self::DisabledException(_inner) => _inner.fmt(f),
787            Self::DryRunOperationException(_inner) => _inner.fmt(f),
788            Self::InvalidGrantTokenException(_inner) => _inner.fmt(f),
789            Self::InvalidKeyUsageException(_inner) => _inner.fmt(f),
790            Self::KeyUnavailableException(_inner) => _inner.fmt(f),
791            Self::KmsInternalException(_inner) => _inner.fmt(f),
792            Self::KmsInvalidStateException(_inner) => _inner.fmt(f),
793            Self::NotFoundException(_inner) => _inner.fmt(f),
794            Self::Unhandled(_inner) => {
795                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
796                    write!(f, "unhandled error ({code})")
797                } else {
798                    f.write_str("unhandled error")
799                }
800            }
801        }
802    }
803}
804impl ::aws_smithy_types::retry::ProvideErrorKind for GenerateDataKeyWithoutPlaintextError {
805    fn code(&self) -> ::std::option::Option<&str> {
806        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
807    }
808    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
809        ::std::option::Option::None
810    }
811}
812impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GenerateDataKeyWithoutPlaintextError {
813    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
814        match self {
815            Self::DependencyTimeoutException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
816            Self::DisabledException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
817            Self::DryRunOperationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
818            Self::InvalidGrantTokenException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
819            Self::InvalidKeyUsageException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
820            Self::KeyUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
821            Self::KmsInternalException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
822            Self::KmsInvalidStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
823            Self::NotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
824            Self::Unhandled(_inner) => &_inner.meta,
825        }
826    }
827}
828impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GenerateDataKeyWithoutPlaintextError {
829    fn create_unhandled_error(
830        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
831        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
832    ) -> Self {
833        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
834            source,
835            meta: meta.unwrap_or_default(),
836        })
837    }
838}
839impl ::aws_types::request_id::RequestId for crate::operation::generate_data_key_without_plaintext::GenerateDataKeyWithoutPlaintextError {
840    fn request_id(&self) -> Option<&str> {
841        self.meta().request_id()
842    }
843}
844
845pub use crate::operation::generate_data_key_without_plaintext::_generate_data_key_without_plaintext_input::GenerateDataKeyWithoutPlaintextInput;
846
847pub use crate::operation::generate_data_key_without_plaintext::_generate_data_key_without_plaintext_output::GenerateDataKeyWithoutPlaintextOutput;
848
849mod _generate_data_key_without_plaintext_input;
850
851mod _generate_data_key_without_plaintext_output;
852
853/// Builders
854pub mod builders;