aws_sdk_cloudhsmv2/
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>The request was rejected because the requester does not have permission to perform the requested operation.</p>
7    CloudHsmAccessDeniedException(crate::types::error::CloudHsmAccessDeniedException),
8    /// <p>The request was rejected because of an CloudHSM internal failure. The request can be retried.</p>
9    CloudHsmInternalFailureException(crate::types::error::CloudHsmInternalFailureException),
10    /// <p>The request was rejected because it is not a valid request.</p>
11    CloudHsmInvalidRequestException(crate::types::error::CloudHsmInvalidRequestException),
12    /// <p>The request was rejected because it exceeds an CloudHSM limit.</p>
13    CloudHsmResourceLimitExceededException(crate::types::error::CloudHsmResourceLimitExceededException),
14    /// <p>The request was rejected because it refers to a resource that cannot be found.</p>
15    CloudHsmResourceNotFoundException(crate::types::error::CloudHsmResourceNotFoundException),
16    /// <p>The request was rejected because an error occurred.</p>
17    CloudHsmServiceException(crate::types::error::CloudHsmServiceException),
18    /// <p>The request was rejected because of a tagging failure. Verify the tag conditions in all applicable policies, and then retry the request.</p>
19    CloudHsmTagException(crate::types::error::CloudHsmTagException),
20    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
21    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
22    variable wildcard pattern and check `.code()`:
23     \
24    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
25     \
26    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
27    Unhandled(crate::error::sealed_unhandled::Unhandled),
28}
29impl ::std::fmt::Display for Error {
30    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
31        match self {
32            Error::CloudHsmAccessDeniedException(inner) => inner.fmt(f),
33            Error::CloudHsmInternalFailureException(inner) => inner.fmt(f),
34            Error::CloudHsmInvalidRequestException(inner) => inner.fmt(f),
35            Error::CloudHsmResourceLimitExceededException(inner) => inner.fmt(f),
36            Error::CloudHsmResourceNotFoundException(inner) => inner.fmt(f),
37            Error::CloudHsmServiceException(inner) => inner.fmt(f),
38            Error::CloudHsmTagException(inner) => inner.fmt(f),
39            Error::Unhandled(_) => {
40                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
41                    write!(f, "unhandled error ({code})")
42                } else {
43                    f.write_str("unhandled error")
44                }
45            }
46        }
47    }
48}
49impl From<::aws_smithy_types::error::operation::BuildError> for Error {
50    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
51        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
52            source: value.into(),
53            meta: ::std::default::Default::default(),
54        })
55    }
56}
57impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
58    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
59        match self {
60            Self::CloudHsmAccessDeniedException(inner) => inner.meta(),
61            Self::CloudHsmInternalFailureException(inner) => inner.meta(),
62            Self::CloudHsmInvalidRequestException(inner) => inner.meta(),
63            Self::CloudHsmResourceLimitExceededException(inner) => inner.meta(),
64            Self::CloudHsmResourceNotFoundException(inner) => inner.meta(),
65            Self::CloudHsmServiceException(inner) => inner.meta(),
66            Self::CloudHsmTagException(inner) => inner.meta(),
67            Self::Unhandled(inner) => &inner.meta,
68        }
69    }
70}
71impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::copy_backup_to_region::CopyBackupToRegionError, R>> for Error
72where
73    R: Send + Sync + std::fmt::Debug + 'static,
74{
75    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::copy_backup_to_region::CopyBackupToRegionError, R>) -> Self {
76        match err {
77            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
78            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
79                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
80                source: err.into(),
81            }),
82        }
83    }
84}
85impl From<crate::operation::copy_backup_to_region::CopyBackupToRegionError> for Error {
86    fn from(err: crate::operation::copy_backup_to_region::CopyBackupToRegionError) -> Self {
87        match err {
88            crate::operation::copy_backup_to_region::CopyBackupToRegionError::CloudHsmAccessDeniedException(inner) => {
89                Error::CloudHsmAccessDeniedException(inner)
90            }
91            crate::operation::copy_backup_to_region::CopyBackupToRegionError::CloudHsmInternalFailureException(inner) => {
92                Error::CloudHsmInternalFailureException(inner)
93            }
94            crate::operation::copy_backup_to_region::CopyBackupToRegionError::CloudHsmInvalidRequestException(inner) => {
95                Error::CloudHsmInvalidRequestException(inner)
96            }
97            crate::operation::copy_backup_to_region::CopyBackupToRegionError::CloudHsmResourceNotFoundException(inner) => {
98                Error::CloudHsmResourceNotFoundException(inner)
99            }
100            crate::operation::copy_backup_to_region::CopyBackupToRegionError::CloudHsmServiceException(inner) => {
101                Error::CloudHsmServiceException(inner)
102            }
103            crate::operation::copy_backup_to_region::CopyBackupToRegionError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
104            crate::operation::copy_backup_to_region::CopyBackupToRegionError::Unhandled(inner) => Error::Unhandled(inner),
105        }
106    }
107}
108impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_cluster::CreateClusterError, R>> for Error
109where
110    R: Send + Sync + std::fmt::Debug + 'static,
111{
112    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_cluster::CreateClusterError, R>) -> Self {
113        match err {
114            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
115            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
116                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
117                source: err.into(),
118            }),
119        }
120    }
121}
122impl From<crate::operation::create_cluster::CreateClusterError> for Error {
123    fn from(err: crate::operation::create_cluster::CreateClusterError) -> Self {
124        match err {
125            crate::operation::create_cluster::CreateClusterError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
126            crate::operation::create_cluster::CreateClusterError::CloudHsmInternalFailureException(inner) => {
127                Error::CloudHsmInternalFailureException(inner)
128            }
129            crate::operation::create_cluster::CreateClusterError::CloudHsmInvalidRequestException(inner) => {
130                Error::CloudHsmInvalidRequestException(inner)
131            }
132            crate::operation::create_cluster::CreateClusterError::CloudHsmResourceNotFoundException(inner) => {
133                Error::CloudHsmResourceNotFoundException(inner)
134            }
135            crate::operation::create_cluster::CreateClusterError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
136            crate::operation::create_cluster::CreateClusterError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
137            crate::operation::create_cluster::CreateClusterError::Unhandled(inner) => Error::Unhandled(inner),
138        }
139    }
140}
141impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_hsm::CreateHsmError, R>> for Error
142where
143    R: Send + Sync + std::fmt::Debug + 'static,
144{
145    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_hsm::CreateHsmError, R>) -> Self {
146        match err {
147            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
148            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
149                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
150                source: err.into(),
151            }),
152        }
153    }
154}
155impl From<crate::operation::create_hsm::CreateHsmError> for Error {
156    fn from(err: crate::operation::create_hsm::CreateHsmError) -> Self {
157        match err {
158            crate::operation::create_hsm::CreateHsmError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
159            crate::operation::create_hsm::CreateHsmError::CloudHsmInternalFailureException(inner) => Error::CloudHsmInternalFailureException(inner),
160            crate::operation::create_hsm::CreateHsmError::CloudHsmInvalidRequestException(inner) => Error::CloudHsmInvalidRequestException(inner),
161            crate::operation::create_hsm::CreateHsmError::CloudHsmResourceNotFoundException(inner) => Error::CloudHsmResourceNotFoundException(inner),
162            crate::operation::create_hsm::CreateHsmError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
163            crate::operation::create_hsm::CreateHsmError::Unhandled(inner) => Error::Unhandled(inner),
164        }
165    }
166}
167impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_backup::DeleteBackupError, R>> for Error
168where
169    R: Send + Sync + std::fmt::Debug + 'static,
170{
171    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_backup::DeleteBackupError, R>) -> Self {
172        match err {
173            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
174            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
175                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
176                source: err.into(),
177            }),
178        }
179    }
180}
181impl From<crate::operation::delete_backup::DeleteBackupError> for Error {
182    fn from(err: crate::operation::delete_backup::DeleteBackupError) -> Self {
183        match err {
184            crate::operation::delete_backup::DeleteBackupError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
185            crate::operation::delete_backup::DeleteBackupError::CloudHsmInternalFailureException(inner) => {
186                Error::CloudHsmInternalFailureException(inner)
187            }
188            crate::operation::delete_backup::DeleteBackupError::CloudHsmInvalidRequestException(inner) => {
189                Error::CloudHsmInvalidRequestException(inner)
190            }
191            crate::operation::delete_backup::DeleteBackupError::CloudHsmResourceNotFoundException(inner) => {
192                Error::CloudHsmResourceNotFoundException(inner)
193            }
194            crate::operation::delete_backup::DeleteBackupError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
195            crate::operation::delete_backup::DeleteBackupError::Unhandled(inner) => Error::Unhandled(inner),
196        }
197    }
198}
199impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_cluster::DeleteClusterError, R>> for Error
200where
201    R: Send + Sync + std::fmt::Debug + 'static,
202{
203    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_cluster::DeleteClusterError, R>) -> Self {
204        match err {
205            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
206            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
207                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
208                source: err.into(),
209            }),
210        }
211    }
212}
213impl From<crate::operation::delete_cluster::DeleteClusterError> for Error {
214    fn from(err: crate::operation::delete_cluster::DeleteClusterError) -> Self {
215        match err {
216            crate::operation::delete_cluster::DeleteClusterError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
217            crate::operation::delete_cluster::DeleteClusterError::CloudHsmInternalFailureException(inner) => {
218                Error::CloudHsmInternalFailureException(inner)
219            }
220            crate::operation::delete_cluster::DeleteClusterError::CloudHsmInvalidRequestException(inner) => {
221                Error::CloudHsmInvalidRequestException(inner)
222            }
223            crate::operation::delete_cluster::DeleteClusterError::CloudHsmResourceNotFoundException(inner) => {
224                Error::CloudHsmResourceNotFoundException(inner)
225            }
226            crate::operation::delete_cluster::DeleteClusterError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
227            crate::operation::delete_cluster::DeleteClusterError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
228            crate::operation::delete_cluster::DeleteClusterError::Unhandled(inner) => Error::Unhandled(inner),
229        }
230    }
231}
232impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_hsm::DeleteHsmError, R>> for Error
233where
234    R: Send + Sync + std::fmt::Debug + 'static,
235{
236    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_hsm::DeleteHsmError, R>) -> Self {
237        match err {
238            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
239            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
240                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
241                source: err.into(),
242            }),
243        }
244    }
245}
246impl From<crate::operation::delete_hsm::DeleteHsmError> for Error {
247    fn from(err: crate::operation::delete_hsm::DeleteHsmError) -> Self {
248        match err {
249            crate::operation::delete_hsm::DeleteHsmError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
250            crate::operation::delete_hsm::DeleteHsmError::CloudHsmInternalFailureException(inner) => Error::CloudHsmInternalFailureException(inner),
251            crate::operation::delete_hsm::DeleteHsmError::CloudHsmInvalidRequestException(inner) => Error::CloudHsmInvalidRequestException(inner),
252            crate::operation::delete_hsm::DeleteHsmError::CloudHsmResourceNotFoundException(inner) => Error::CloudHsmResourceNotFoundException(inner),
253            crate::operation::delete_hsm::DeleteHsmError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
254            crate::operation::delete_hsm::DeleteHsmError::Unhandled(inner) => Error::Unhandled(inner),
255        }
256    }
257}
258impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_resource_policy::DeleteResourcePolicyError, R>> for Error
259where
260    R: Send + Sync + std::fmt::Debug + 'static,
261{
262    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_resource_policy::DeleteResourcePolicyError, R>) -> Self {
263        match err {
264            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
265            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
266                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
267                source: err.into(),
268            }),
269        }
270    }
271}
272impl From<crate::operation::delete_resource_policy::DeleteResourcePolicyError> for Error {
273    fn from(err: crate::operation::delete_resource_policy::DeleteResourcePolicyError) -> Self {
274        match err {
275            crate::operation::delete_resource_policy::DeleteResourcePolicyError::CloudHsmAccessDeniedException(inner) => {
276                Error::CloudHsmAccessDeniedException(inner)
277            }
278            crate::operation::delete_resource_policy::DeleteResourcePolicyError::CloudHsmInternalFailureException(inner) => {
279                Error::CloudHsmInternalFailureException(inner)
280            }
281            crate::operation::delete_resource_policy::DeleteResourcePolicyError::CloudHsmInvalidRequestException(inner) => {
282                Error::CloudHsmInvalidRequestException(inner)
283            }
284            crate::operation::delete_resource_policy::DeleteResourcePolicyError::CloudHsmResourceNotFoundException(inner) => {
285                Error::CloudHsmResourceNotFoundException(inner)
286            }
287            crate::operation::delete_resource_policy::DeleteResourcePolicyError::CloudHsmServiceException(inner) => {
288                Error::CloudHsmServiceException(inner)
289            }
290            crate::operation::delete_resource_policy::DeleteResourcePolicyError::Unhandled(inner) => Error::Unhandled(inner),
291        }
292    }
293}
294impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_backups::DescribeBackupsError, R>> for Error
295where
296    R: Send + Sync + std::fmt::Debug + 'static,
297{
298    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_backups::DescribeBackupsError, R>) -> Self {
299        match err {
300            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
301            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
302                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
303                source: err.into(),
304            }),
305        }
306    }
307}
308impl From<crate::operation::describe_backups::DescribeBackupsError> for Error {
309    fn from(err: crate::operation::describe_backups::DescribeBackupsError) -> Self {
310        match err {
311            crate::operation::describe_backups::DescribeBackupsError::CloudHsmAccessDeniedException(inner) => {
312                Error::CloudHsmAccessDeniedException(inner)
313            }
314            crate::operation::describe_backups::DescribeBackupsError::CloudHsmInternalFailureException(inner) => {
315                Error::CloudHsmInternalFailureException(inner)
316            }
317            crate::operation::describe_backups::DescribeBackupsError::CloudHsmInvalidRequestException(inner) => {
318                Error::CloudHsmInvalidRequestException(inner)
319            }
320            crate::operation::describe_backups::DescribeBackupsError::CloudHsmResourceNotFoundException(inner) => {
321                Error::CloudHsmResourceNotFoundException(inner)
322            }
323            crate::operation::describe_backups::DescribeBackupsError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
324            crate::operation::describe_backups::DescribeBackupsError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
325            crate::operation::describe_backups::DescribeBackupsError::Unhandled(inner) => Error::Unhandled(inner),
326        }
327    }
328}
329impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_clusters::DescribeClustersError, R>> for Error
330where
331    R: Send + Sync + std::fmt::Debug + 'static,
332{
333    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_clusters::DescribeClustersError, R>) -> Self {
334        match err {
335            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
336            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
337                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
338                source: err.into(),
339            }),
340        }
341    }
342}
343impl From<crate::operation::describe_clusters::DescribeClustersError> for Error {
344    fn from(err: crate::operation::describe_clusters::DescribeClustersError) -> Self {
345        match err {
346            crate::operation::describe_clusters::DescribeClustersError::CloudHsmAccessDeniedException(inner) => {
347                Error::CloudHsmAccessDeniedException(inner)
348            }
349            crate::operation::describe_clusters::DescribeClustersError::CloudHsmInternalFailureException(inner) => {
350                Error::CloudHsmInternalFailureException(inner)
351            }
352            crate::operation::describe_clusters::DescribeClustersError::CloudHsmInvalidRequestException(inner) => {
353                Error::CloudHsmInvalidRequestException(inner)
354            }
355            crate::operation::describe_clusters::DescribeClustersError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
356            crate::operation::describe_clusters::DescribeClustersError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
357            crate::operation::describe_clusters::DescribeClustersError::Unhandled(inner) => Error::Unhandled(inner),
358        }
359    }
360}
361impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_resource_policy::GetResourcePolicyError, R>> for Error
362where
363    R: Send + Sync + std::fmt::Debug + 'static,
364{
365    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_resource_policy::GetResourcePolicyError, R>) -> Self {
366        match err {
367            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
368            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
369                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
370                source: err.into(),
371            }),
372        }
373    }
374}
375impl From<crate::operation::get_resource_policy::GetResourcePolicyError> for Error {
376    fn from(err: crate::operation::get_resource_policy::GetResourcePolicyError) -> Self {
377        match err {
378            crate::operation::get_resource_policy::GetResourcePolicyError::CloudHsmAccessDeniedException(inner) => {
379                Error::CloudHsmAccessDeniedException(inner)
380            }
381            crate::operation::get_resource_policy::GetResourcePolicyError::CloudHsmInternalFailureException(inner) => {
382                Error::CloudHsmInternalFailureException(inner)
383            }
384            crate::operation::get_resource_policy::GetResourcePolicyError::CloudHsmInvalidRequestException(inner) => {
385                Error::CloudHsmInvalidRequestException(inner)
386            }
387            crate::operation::get_resource_policy::GetResourcePolicyError::CloudHsmResourceNotFoundException(inner) => {
388                Error::CloudHsmResourceNotFoundException(inner)
389            }
390            crate::operation::get_resource_policy::GetResourcePolicyError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
391            crate::operation::get_resource_policy::GetResourcePolicyError::Unhandled(inner) => Error::Unhandled(inner),
392        }
393    }
394}
395impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::initialize_cluster::InitializeClusterError, R>> for Error
396where
397    R: Send + Sync + std::fmt::Debug + 'static,
398{
399    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::initialize_cluster::InitializeClusterError, R>) -> Self {
400        match err {
401            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
402            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
403                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
404                source: err.into(),
405            }),
406        }
407    }
408}
409impl From<crate::operation::initialize_cluster::InitializeClusterError> for Error {
410    fn from(err: crate::operation::initialize_cluster::InitializeClusterError) -> Self {
411        match err {
412            crate::operation::initialize_cluster::InitializeClusterError::CloudHsmAccessDeniedException(inner) => {
413                Error::CloudHsmAccessDeniedException(inner)
414            }
415            crate::operation::initialize_cluster::InitializeClusterError::CloudHsmInternalFailureException(inner) => {
416                Error::CloudHsmInternalFailureException(inner)
417            }
418            crate::operation::initialize_cluster::InitializeClusterError::CloudHsmInvalidRequestException(inner) => {
419                Error::CloudHsmInvalidRequestException(inner)
420            }
421            crate::operation::initialize_cluster::InitializeClusterError::CloudHsmResourceNotFoundException(inner) => {
422                Error::CloudHsmResourceNotFoundException(inner)
423            }
424            crate::operation::initialize_cluster::InitializeClusterError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
425            crate::operation::initialize_cluster::InitializeClusterError::Unhandled(inner) => Error::Unhandled(inner),
426        }
427    }
428}
429impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags::ListTagsError, R>> for Error
430where
431    R: Send + Sync + std::fmt::Debug + 'static,
432{
433    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags::ListTagsError, R>) -> Self {
434        match err {
435            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
436            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
437                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
438                source: err.into(),
439            }),
440        }
441    }
442}
443impl From<crate::operation::list_tags::ListTagsError> for Error {
444    fn from(err: crate::operation::list_tags::ListTagsError) -> Self {
445        match err {
446            crate::operation::list_tags::ListTagsError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
447            crate::operation::list_tags::ListTagsError::CloudHsmInternalFailureException(inner) => Error::CloudHsmInternalFailureException(inner),
448            crate::operation::list_tags::ListTagsError::CloudHsmInvalidRequestException(inner) => Error::CloudHsmInvalidRequestException(inner),
449            crate::operation::list_tags::ListTagsError::CloudHsmResourceNotFoundException(inner) => Error::CloudHsmResourceNotFoundException(inner),
450            crate::operation::list_tags::ListTagsError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
451            crate::operation::list_tags::ListTagsError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
452            crate::operation::list_tags::ListTagsError::Unhandled(inner) => Error::Unhandled(inner),
453        }
454    }
455}
456impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_backup_attributes::ModifyBackupAttributesError, R>> for Error
457where
458    R: Send + Sync + std::fmt::Debug + 'static,
459{
460    fn from(
461        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_backup_attributes::ModifyBackupAttributesError, R>,
462    ) -> Self {
463        match err {
464            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
465            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
466                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
467                source: err.into(),
468            }),
469        }
470    }
471}
472impl From<crate::operation::modify_backup_attributes::ModifyBackupAttributesError> for Error {
473    fn from(err: crate::operation::modify_backup_attributes::ModifyBackupAttributesError) -> Self {
474        match err {
475            crate::operation::modify_backup_attributes::ModifyBackupAttributesError::CloudHsmAccessDeniedException(inner) => {
476                Error::CloudHsmAccessDeniedException(inner)
477            }
478            crate::operation::modify_backup_attributes::ModifyBackupAttributesError::CloudHsmInternalFailureException(inner) => {
479                Error::CloudHsmInternalFailureException(inner)
480            }
481            crate::operation::modify_backup_attributes::ModifyBackupAttributesError::CloudHsmInvalidRequestException(inner) => {
482                Error::CloudHsmInvalidRequestException(inner)
483            }
484            crate::operation::modify_backup_attributes::ModifyBackupAttributesError::CloudHsmResourceNotFoundException(inner) => {
485                Error::CloudHsmResourceNotFoundException(inner)
486            }
487            crate::operation::modify_backup_attributes::ModifyBackupAttributesError::CloudHsmServiceException(inner) => {
488                Error::CloudHsmServiceException(inner)
489            }
490            crate::operation::modify_backup_attributes::ModifyBackupAttributesError::Unhandled(inner) => Error::Unhandled(inner),
491        }
492    }
493}
494impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_cluster::ModifyClusterError, R>> for Error
495where
496    R: Send + Sync + std::fmt::Debug + 'static,
497{
498    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_cluster::ModifyClusterError, R>) -> Self {
499        match err {
500            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
501            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
502                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
503                source: err.into(),
504            }),
505        }
506    }
507}
508impl From<crate::operation::modify_cluster::ModifyClusterError> for Error {
509    fn from(err: crate::operation::modify_cluster::ModifyClusterError) -> Self {
510        match err {
511            crate::operation::modify_cluster::ModifyClusterError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
512            crate::operation::modify_cluster::ModifyClusterError::CloudHsmInternalFailureException(inner) => {
513                Error::CloudHsmInternalFailureException(inner)
514            }
515            crate::operation::modify_cluster::ModifyClusterError::CloudHsmInvalidRequestException(inner) => {
516                Error::CloudHsmInvalidRequestException(inner)
517            }
518            crate::operation::modify_cluster::ModifyClusterError::CloudHsmResourceNotFoundException(inner) => {
519                Error::CloudHsmResourceNotFoundException(inner)
520            }
521            crate::operation::modify_cluster::ModifyClusterError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
522            crate::operation::modify_cluster::ModifyClusterError::Unhandled(inner) => Error::Unhandled(inner),
523        }
524    }
525}
526impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_resource_policy::PutResourcePolicyError, R>> for Error
527where
528    R: Send + Sync + std::fmt::Debug + 'static,
529{
530    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_resource_policy::PutResourcePolicyError, R>) -> Self {
531        match err {
532            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
533            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
534                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
535                source: err.into(),
536            }),
537        }
538    }
539}
540impl From<crate::operation::put_resource_policy::PutResourcePolicyError> for Error {
541    fn from(err: crate::operation::put_resource_policy::PutResourcePolicyError) -> Self {
542        match err {
543            crate::operation::put_resource_policy::PutResourcePolicyError::CloudHsmAccessDeniedException(inner) => {
544                Error::CloudHsmAccessDeniedException(inner)
545            }
546            crate::operation::put_resource_policy::PutResourcePolicyError::CloudHsmInternalFailureException(inner) => {
547                Error::CloudHsmInternalFailureException(inner)
548            }
549            crate::operation::put_resource_policy::PutResourcePolicyError::CloudHsmInvalidRequestException(inner) => {
550                Error::CloudHsmInvalidRequestException(inner)
551            }
552            crate::operation::put_resource_policy::PutResourcePolicyError::CloudHsmResourceNotFoundException(inner) => {
553                Error::CloudHsmResourceNotFoundException(inner)
554            }
555            crate::operation::put_resource_policy::PutResourcePolicyError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
556            crate::operation::put_resource_policy::PutResourcePolicyError::Unhandled(inner) => Error::Unhandled(inner),
557        }
558    }
559}
560impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::restore_backup::RestoreBackupError, R>> for Error
561where
562    R: Send + Sync + std::fmt::Debug + 'static,
563{
564    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::restore_backup::RestoreBackupError, R>) -> Self {
565        match err {
566            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
567            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
568                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
569                source: err.into(),
570            }),
571        }
572    }
573}
574impl From<crate::operation::restore_backup::RestoreBackupError> for Error {
575    fn from(err: crate::operation::restore_backup::RestoreBackupError) -> Self {
576        match err {
577            crate::operation::restore_backup::RestoreBackupError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
578            crate::operation::restore_backup::RestoreBackupError::CloudHsmInternalFailureException(inner) => {
579                Error::CloudHsmInternalFailureException(inner)
580            }
581            crate::operation::restore_backup::RestoreBackupError::CloudHsmInvalidRequestException(inner) => {
582                Error::CloudHsmInvalidRequestException(inner)
583            }
584            crate::operation::restore_backup::RestoreBackupError::CloudHsmResourceNotFoundException(inner) => {
585                Error::CloudHsmResourceNotFoundException(inner)
586            }
587            crate::operation::restore_backup::RestoreBackupError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
588            crate::operation::restore_backup::RestoreBackupError::Unhandled(inner) => Error::Unhandled(inner),
589        }
590    }
591}
592impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
593where
594    R: Send + Sync + std::fmt::Debug + 'static,
595{
596    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
597        match err {
598            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
599            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
600                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
601                source: err.into(),
602            }),
603        }
604    }
605}
606impl From<crate::operation::tag_resource::TagResourceError> for Error {
607    fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
608        match err {
609            crate::operation::tag_resource::TagResourceError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
610            crate::operation::tag_resource::TagResourceError::CloudHsmInternalFailureException(inner) => {
611                Error::CloudHsmInternalFailureException(inner)
612            }
613            crate::operation::tag_resource::TagResourceError::CloudHsmInvalidRequestException(inner) => Error::CloudHsmInvalidRequestException(inner),
614            crate::operation::tag_resource::TagResourceError::CloudHsmResourceLimitExceededException(inner) => {
615                Error::CloudHsmResourceLimitExceededException(inner)
616            }
617            crate::operation::tag_resource::TagResourceError::CloudHsmResourceNotFoundException(inner) => {
618                Error::CloudHsmResourceNotFoundException(inner)
619            }
620            crate::operation::tag_resource::TagResourceError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
621            crate::operation::tag_resource::TagResourceError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
622            crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
623        }
624    }
625}
626impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
627where
628    R: Send + Sync + std::fmt::Debug + 'static,
629{
630    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
631        match err {
632            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
633            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
634                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
635                source: err.into(),
636            }),
637        }
638    }
639}
640impl From<crate::operation::untag_resource::UntagResourceError> for Error {
641    fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
642        match err {
643            crate::operation::untag_resource::UntagResourceError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
644            crate::operation::untag_resource::UntagResourceError::CloudHsmInternalFailureException(inner) => {
645                Error::CloudHsmInternalFailureException(inner)
646            }
647            crate::operation::untag_resource::UntagResourceError::CloudHsmInvalidRequestException(inner) => {
648                Error::CloudHsmInvalidRequestException(inner)
649            }
650            crate::operation::untag_resource::UntagResourceError::CloudHsmResourceNotFoundException(inner) => {
651                Error::CloudHsmResourceNotFoundException(inner)
652            }
653            crate::operation::untag_resource::UntagResourceError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
654            crate::operation::untag_resource::UntagResourceError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
655            crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
656        }
657    }
658}
659impl ::std::error::Error for Error {
660    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
661        match self {
662            Error::CloudHsmAccessDeniedException(inner) => inner.source(),
663            Error::CloudHsmInternalFailureException(inner) => inner.source(),
664            Error::CloudHsmInvalidRequestException(inner) => inner.source(),
665            Error::CloudHsmResourceLimitExceededException(inner) => inner.source(),
666            Error::CloudHsmResourceNotFoundException(inner) => inner.source(),
667            Error::CloudHsmServiceException(inner) => inner.source(),
668            Error::CloudHsmTagException(inner) => inner.source(),
669            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
670        }
671    }
672}
673impl ::aws_types::request_id::RequestId for Error {
674    fn request_id(&self) -> Option<&str> {
675        match self {
676            Self::CloudHsmAccessDeniedException(e) => e.request_id(),
677            Self::CloudHsmInternalFailureException(e) => e.request_id(),
678            Self::CloudHsmInvalidRequestException(e) => e.request_id(),
679            Self::CloudHsmResourceLimitExceededException(e) => e.request_id(),
680            Self::CloudHsmResourceNotFoundException(e) => e.request_id(),
681            Self::CloudHsmServiceException(e) => e.request_id(),
682            Self::CloudHsmTagException(e) => e.request_id(),
683            Self::Unhandled(e) => e.meta.request_id(),
684        }
685    }
686}