aws_sdk_cloudhsm/
error_meta.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// All possible error types for this service.
3#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6    /// <p>Indicates that an internal error occurred.</p>
7    CloudHsmInternalException(crate::types::error::CloudHsmInternalException),
8    /// <p>Indicates that an exception occurred in the AWS CloudHSM service.</p>
9    CloudHsmServiceException(crate::types::error::CloudHsmServiceException),
10    /// <p>Indicates that one or more of the request parameters are not valid.</p>
11    InvalidRequestException(crate::types::error::InvalidRequestException),
12    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
13    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
14    variable wildcard pattern and check `.code()`:
15     \
16    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
17     \
18    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
19    Unhandled(crate::error::sealed_unhandled::Unhandled),
20}
21impl ::std::fmt::Display for Error {
22    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23        match self {
24            Error::CloudHsmInternalException(inner) => inner.fmt(f),
25            Error::CloudHsmServiceException(inner) => inner.fmt(f),
26            Error::InvalidRequestException(inner) => inner.fmt(f),
27            Error::Unhandled(_) => {
28                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
29                    write!(f, "unhandled error ({code})")
30                } else {
31                    f.write_str("unhandled error")
32                }
33            }
34        }
35    }
36}
37impl From<::aws_smithy_types::error::operation::BuildError> for Error {
38    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
39        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
40            source: value.into(),
41            meta: ::std::default::Default::default(),
42        })
43    }
44}
45impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
46    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
47        match self {
48            Self::CloudHsmInternalException(inner) => inner.meta(),
49            Self::CloudHsmServiceException(inner) => inner.meta(),
50            Self::InvalidRequestException(inner) => inner.meta(),
51            Self::Unhandled(inner) => &inner.meta,
52        }
53    }
54}
55impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::add_tags_to_resource::AddTagsToResourceError, R>> for Error
56where
57    R: Send + Sync + std::fmt::Debug + 'static,
58{
59    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::add_tags_to_resource::AddTagsToResourceError, R>) -> Self {
60        match err {
61            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
62            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
63                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
64                source: err.into(),
65            }),
66        }
67    }
68}
69impl From<crate::operation::add_tags_to_resource::AddTagsToResourceError> for Error {
70    fn from(err: crate::operation::add_tags_to_resource::AddTagsToResourceError) -> Self {
71        match err {
72            crate::operation::add_tags_to_resource::AddTagsToResourceError::CloudHsmInternalException(inner) => {
73                Error::CloudHsmInternalException(inner)
74            }
75            crate::operation::add_tags_to_resource::AddTagsToResourceError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
76            crate::operation::add_tags_to_resource::AddTagsToResourceError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
77            crate::operation::add_tags_to_resource::AddTagsToResourceError::Unhandled(inner) => Error::Unhandled(inner),
78        }
79    }
80}
81impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_hapg::CreateHapgError, R>> for Error
82where
83    R: Send + Sync + std::fmt::Debug + 'static,
84{
85    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_hapg::CreateHapgError, R>) -> Self {
86        match err {
87            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
88            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
89                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
90                source: err.into(),
91            }),
92        }
93    }
94}
95impl From<crate::operation::create_hapg::CreateHapgError> for Error {
96    fn from(err: crate::operation::create_hapg::CreateHapgError) -> Self {
97        match err {
98            crate::operation::create_hapg::CreateHapgError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
99            crate::operation::create_hapg::CreateHapgError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
100            crate::operation::create_hapg::CreateHapgError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
101            crate::operation::create_hapg::CreateHapgError::Unhandled(inner) => Error::Unhandled(inner),
102        }
103    }
104}
105impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_hsm::CreateHsmError, R>> for Error
106where
107    R: Send + Sync + std::fmt::Debug + 'static,
108{
109    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_hsm::CreateHsmError, R>) -> Self {
110        match err {
111            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
112            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
113                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
114                source: err.into(),
115            }),
116        }
117    }
118}
119impl From<crate::operation::create_hsm::CreateHsmError> for Error {
120    fn from(err: crate::operation::create_hsm::CreateHsmError) -> Self {
121        match err {
122            crate::operation::create_hsm::CreateHsmError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
123            crate::operation::create_hsm::CreateHsmError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
124            crate::operation::create_hsm::CreateHsmError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
125            crate::operation::create_hsm::CreateHsmError::Unhandled(inner) => Error::Unhandled(inner),
126        }
127    }
128}
129impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_luna_client::CreateLunaClientError, R>> for Error
130where
131    R: Send + Sync + std::fmt::Debug + 'static,
132{
133    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_luna_client::CreateLunaClientError, R>) -> Self {
134        match err {
135            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
136            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
137                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
138                source: err.into(),
139            }),
140        }
141    }
142}
143impl From<crate::operation::create_luna_client::CreateLunaClientError> for Error {
144    fn from(err: crate::operation::create_luna_client::CreateLunaClientError) -> Self {
145        match err {
146            crate::operation::create_luna_client::CreateLunaClientError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
147            crate::operation::create_luna_client::CreateLunaClientError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
148            crate::operation::create_luna_client::CreateLunaClientError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
149            crate::operation::create_luna_client::CreateLunaClientError::Unhandled(inner) => Error::Unhandled(inner),
150        }
151    }
152}
153impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_hapg::DeleteHapgError, R>> for Error
154where
155    R: Send + Sync + std::fmt::Debug + 'static,
156{
157    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_hapg::DeleteHapgError, R>) -> Self {
158        match err {
159            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
160            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
161                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
162                source: err.into(),
163            }),
164        }
165    }
166}
167impl From<crate::operation::delete_hapg::DeleteHapgError> for Error {
168    fn from(err: crate::operation::delete_hapg::DeleteHapgError) -> Self {
169        match err {
170            crate::operation::delete_hapg::DeleteHapgError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
171            crate::operation::delete_hapg::DeleteHapgError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
172            crate::operation::delete_hapg::DeleteHapgError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
173            crate::operation::delete_hapg::DeleteHapgError::Unhandled(inner) => Error::Unhandled(inner),
174        }
175    }
176}
177impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_hsm::DeleteHsmError, R>> for Error
178where
179    R: Send + Sync + std::fmt::Debug + 'static,
180{
181    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_hsm::DeleteHsmError, R>) -> Self {
182        match err {
183            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
184            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
185                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
186                source: err.into(),
187            }),
188        }
189    }
190}
191impl From<crate::operation::delete_hsm::DeleteHsmError> for Error {
192    fn from(err: crate::operation::delete_hsm::DeleteHsmError) -> Self {
193        match err {
194            crate::operation::delete_hsm::DeleteHsmError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
195            crate::operation::delete_hsm::DeleteHsmError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
196            crate::operation::delete_hsm::DeleteHsmError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
197            crate::operation::delete_hsm::DeleteHsmError::Unhandled(inner) => Error::Unhandled(inner),
198        }
199    }
200}
201impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_luna_client::DeleteLunaClientError, R>> for Error
202where
203    R: Send + Sync + std::fmt::Debug + 'static,
204{
205    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_luna_client::DeleteLunaClientError, R>) -> Self {
206        match err {
207            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
208            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
209                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
210                source: err.into(),
211            }),
212        }
213    }
214}
215impl From<crate::operation::delete_luna_client::DeleteLunaClientError> for Error {
216    fn from(err: crate::operation::delete_luna_client::DeleteLunaClientError) -> Self {
217        match err {
218            crate::operation::delete_luna_client::DeleteLunaClientError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
219            crate::operation::delete_luna_client::DeleteLunaClientError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
220            crate::operation::delete_luna_client::DeleteLunaClientError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
221            crate::operation::delete_luna_client::DeleteLunaClientError::Unhandled(inner) => Error::Unhandled(inner),
222        }
223    }
224}
225impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_hapg::DescribeHapgError, R>> for Error
226where
227    R: Send + Sync + std::fmt::Debug + 'static,
228{
229    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_hapg::DescribeHapgError, R>) -> Self {
230        match err {
231            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
232            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
233                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
234                source: err.into(),
235            }),
236        }
237    }
238}
239impl From<crate::operation::describe_hapg::DescribeHapgError> for Error {
240    fn from(err: crate::operation::describe_hapg::DescribeHapgError) -> Self {
241        match err {
242            crate::operation::describe_hapg::DescribeHapgError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
243            crate::operation::describe_hapg::DescribeHapgError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
244            crate::operation::describe_hapg::DescribeHapgError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
245            crate::operation::describe_hapg::DescribeHapgError::Unhandled(inner) => Error::Unhandled(inner),
246        }
247    }
248}
249impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_hsm::DescribeHsmError, R>> for Error
250where
251    R: Send + Sync + std::fmt::Debug + 'static,
252{
253    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_hsm::DescribeHsmError, R>) -> Self {
254        match err {
255            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
256            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
257                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
258                source: err.into(),
259            }),
260        }
261    }
262}
263impl From<crate::operation::describe_hsm::DescribeHsmError> for Error {
264    fn from(err: crate::operation::describe_hsm::DescribeHsmError) -> Self {
265        match err {
266            crate::operation::describe_hsm::DescribeHsmError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
267            crate::operation::describe_hsm::DescribeHsmError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
268            crate::operation::describe_hsm::DescribeHsmError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
269            crate::operation::describe_hsm::DescribeHsmError::Unhandled(inner) => Error::Unhandled(inner),
270        }
271    }
272}
273impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_luna_client::DescribeLunaClientError, R>> for Error
274where
275    R: Send + Sync + std::fmt::Debug + 'static,
276{
277    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_luna_client::DescribeLunaClientError, R>) -> Self {
278        match err {
279            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
280            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
281                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
282                source: err.into(),
283            }),
284        }
285    }
286}
287impl From<crate::operation::describe_luna_client::DescribeLunaClientError> for Error {
288    fn from(err: crate::operation::describe_luna_client::DescribeLunaClientError) -> Self {
289        match err {
290            crate::operation::describe_luna_client::DescribeLunaClientError::CloudHsmInternalException(inner) => {
291                Error::CloudHsmInternalException(inner)
292            }
293            crate::operation::describe_luna_client::DescribeLunaClientError::CloudHsmServiceException(inner) => {
294                Error::CloudHsmServiceException(inner)
295            }
296            crate::operation::describe_luna_client::DescribeLunaClientError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
297            crate::operation::describe_luna_client::DescribeLunaClientError::Unhandled(inner) => Error::Unhandled(inner),
298        }
299    }
300}
301impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_config::GetConfigError, R>> for Error
302where
303    R: Send + Sync + std::fmt::Debug + 'static,
304{
305    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_config::GetConfigError, R>) -> Self {
306        match err {
307            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
308            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
309                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
310                source: err.into(),
311            }),
312        }
313    }
314}
315impl From<crate::operation::get_config::GetConfigError> for Error {
316    fn from(err: crate::operation::get_config::GetConfigError) -> Self {
317        match err {
318            crate::operation::get_config::GetConfigError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
319            crate::operation::get_config::GetConfigError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
320            crate::operation::get_config::GetConfigError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
321            crate::operation::get_config::GetConfigError::Unhandled(inner) => Error::Unhandled(inner),
322        }
323    }
324}
325impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_available_zones::ListAvailableZonesError, R>> for Error
326where
327    R: Send + Sync + std::fmt::Debug + 'static,
328{
329    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_available_zones::ListAvailableZonesError, R>) -> Self {
330        match err {
331            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
332            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
333                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
334                source: err.into(),
335            }),
336        }
337    }
338}
339impl From<crate::operation::list_available_zones::ListAvailableZonesError> for Error {
340    fn from(err: crate::operation::list_available_zones::ListAvailableZonesError) -> Self {
341        match err {
342            crate::operation::list_available_zones::ListAvailableZonesError::CloudHsmInternalException(inner) => {
343                Error::CloudHsmInternalException(inner)
344            }
345            crate::operation::list_available_zones::ListAvailableZonesError::CloudHsmServiceException(inner) => {
346                Error::CloudHsmServiceException(inner)
347            }
348            crate::operation::list_available_zones::ListAvailableZonesError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
349            crate::operation::list_available_zones::ListAvailableZonesError::Unhandled(inner) => Error::Unhandled(inner),
350        }
351    }
352}
353impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_hapgs::ListHapgsError, R>> for Error
354where
355    R: Send + Sync + std::fmt::Debug + 'static,
356{
357    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_hapgs::ListHapgsError, R>) -> Self {
358        match err {
359            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
360            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
361                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
362                source: err.into(),
363            }),
364        }
365    }
366}
367impl From<crate::operation::list_hapgs::ListHapgsError> for Error {
368    fn from(err: crate::operation::list_hapgs::ListHapgsError) -> Self {
369        match err {
370            crate::operation::list_hapgs::ListHapgsError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
371            crate::operation::list_hapgs::ListHapgsError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
372            crate::operation::list_hapgs::ListHapgsError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
373            crate::operation::list_hapgs::ListHapgsError::Unhandled(inner) => Error::Unhandled(inner),
374        }
375    }
376}
377impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_hsms::ListHsmsError, R>> for Error
378where
379    R: Send + Sync + std::fmt::Debug + 'static,
380{
381    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_hsms::ListHsmsError, R>) -> Self {
382        match err {
383            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
384            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
385                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
386                source: err.into(),
387            }),
388        }
389    }
390}
391impl From<crate::operation::list_hsms::ListHsmsError> for Error {
392    fn from(err: crate::operation::list_hsms::ListHsmsError) -> Self {
393        match err {
394            crate::operation::list_hsms::ListHsmsError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
395            crate::operation::list_hsms::ListHsmsError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
396            crate::operation::list_hsms::ListHsmsError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
397            crate::operation::list_hsms::ListHsmsError::Unhandled(inner) => Error::Unhandled(inner),
398        }
399    }
400}
401impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_luna_clients::ListLunaClientsError, R>> for Error
402where
403    R: Send + Sync + std::fmt::Debug + 'static,
404{
405    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_luna_clients::ListLunaClientsError, R>) -> Self {
406        match err {
407            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
408            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
409                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
410                source: err.into(),
411            }),
412        }
413    }
414}
415impl From<crate::operation::list_luna_clients::ListLunaClientsError> for Error {
416    fn from(err: crate::operation::list_luna_clients::ListLunaClientsError) -> Self {
417        match err {
418            crate::operation::list_luna_clients::ListLunaClientsError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
419            crate::operation::list_luna_clients::ListLunaClientsError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
420            crate::operation::list_luna_clients::ListLunaClientsError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
421            crate::operation::list_luna_clients::ListLunaClientsError::Unhandled(inner) => Error::Unhandled(inner),
422        }
423    }
424}
425impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
426where
427    R: Send + Sync + std::fmt::Debug + 'static,
428{
429    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
430        match err {
431            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
432            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
433                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
434                source: err.into(),
435            }),
436        }
437    }
438}
439impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
440    fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
441        match err {
442            crate::operation::list_tags_for_resource::ListTagsForResourceError::CloudHsmInternalException(inner) => {
443                Error::CloudHsmInternalException(inner)
444            }
445            crate::operation::list_tags_for_resource::ListTagsForResourceError::CloudHsmServiceException(inner) => {
446                Error::CloudHsmServiceException(inner)
447            }
448            crate::operation::list_tags_for_resource::ListTagsForResourceError::InvalidRequestException(inner) => {
449                Error::InvalidRequestException(inner)
450            }
451            crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
452        }
453    }
454}
455impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_hapg::ModifyHapgError, R>> for Error
456where
457    R: Send + Sync + std::fmt::Debug + 'static,
458{
459    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_hapg::ModifyHapgError, R>) -> Self {
460        match err {
461            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
462            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
463                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
464                source: err.into(),
465            }),
466        }
467    }
468}
469impl From<crate::operation::modify_hapg::ModifyHapgError> for Error {
470    fn from(err: crate::operation::modify_hapg::ModifyHapgError) -> Self {
471        match err {
472            crate::operation::modify_hapg::ModifyHapgError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
473            crate::operation::modify_hapg::ModifyHapgError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
474            crate::operation::modify_hapg::ModifyHapgError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
475            crate::operation::modify_hapg::ModifyHapgError::Unhandled(inner) => Error::Unhandled(inner),
476        }
477    }
478}
479impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_hsm::ModifyHsmError, R>> for Error
480where
481    R: Send + Sync + std::fmt::Debug + 'static,
482{
483    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_hsm::ModifyHsmError, R>) -> Self {
484        match err {
485            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
486            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
487                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
488                source: err.into(),
489            }),
490        }
491    }
492}
493impl From<crate::operation::modify_hsm::ModifyHsmError> for Error {
494    fn from(err: crate::operation::modify_hsm::ModifyHsmError) -> Self {
495        match err {
496            crate::operation::modify_hsm::ModifyHsmError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
497            crate::operation::modify_hsm::ModifyHsmError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
498            crate::operation::modify_hsm::ModifyHsmError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
499            crate::operation::modify_hsm::ModifyHsmError::Unhandled(inner) => Error::Unhandled(inner),
500        }
501    }
502}
503impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_luna_client::ModifyLunaClientError, R>> for Error
504where
505    R: Send + Sync + std::fmt::Debug + 'static,
506{
507    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_luna_client::ModifyLunaClientError, R>) -> Self {
508        match err {
509            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
510            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
511                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
512                source: err.into(),
513            }),
514        }
515    }
516}
517impl From<crate::operation::modify_luna_client::ModifyLunaClientError> for Error {
518    fn from(err: crate::operation::modify_luna_client::ModifyLunaClientError) -> Self {
519        match err {
520            crate::operation::modify_luna_client::ModifyLunaClientError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
521            crate::operation::modify_luna_client::ModifyLunaClientError::Unhandled(inner) => Error::Unhandled(inner),
522        }
523    }
524}
525impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError, R>>
526    for Error
527where
528    R: Send + Sync + std::fmt::Debug + 'static,
529{
530    fn from(
531        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError, R>,
532    ) -> Self {
533        match err {
534            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
535            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
536                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
537                source: err.into(),
538            }),
539        }
540    }
541}
542impl From<crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError> for Error {
543    fn from(err: crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError) -> Self {
544        match err {
545            crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError::CloudHsmInternalException(inner) => {
546                Error::CloudHsmInternalException(inner)
547            }
548            crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError::CloudHsmServiceException(inner) => {
549                Error::CloudHsmServiceException(inner)
550            }
551            crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError::InvalidRequestException(inner) => {
552                Error::InvalidRequestException(inner)
553            }
554            crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError::Unhandled(inner) => Error::Unhandled(inner),
555        }
556    }
557}
558impl ::std::error::Error for Error {
559    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
560        match self {
561            Error::CloudHsmInternalException(inner) => inner.source(),
562            Error::CloudHsmServiceException(inner) => inner.source(),
563            Error::InvalidRequestException(inner) => inner.source(),
564            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
565        }
566    }
567}
568impl ::aws_types::request_id::RequestId for Error {
569    fn request_id(&self) -> Option<&str> {
570        match self {
571            Self::CloudHsmInternalException(e) => e.request_id(),
572            Self::CloudHsmServiceException(e) => e.request_id(),
573            Self::InvalidRequestException(e) => e.request_id(),
574            Self::Unhandled(e) => e.meta.request_id(),
575        }
576    }
577}