#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
CloudHsmAccessDeniedException(crate::types::error::CloudHsmAccessDeniedException),
CloudHsmInternalFailureException(crate::types::error::CloudHsmInternalFailureException),
CloudHsmInvalidRequestException(crate::types::error::CloudHsmInvalidRequestException),
CloudHsmResourceNotFoundException(crate::types::error::CloudHsmResourceNotFoundException),
CloudHsmServiceException(crate::types::error::CloudHsmServiceException),
CloudHsmTagException(crate::types::error::CloudHsmTagException),
Unhandled(::aws_smithy_types::error::Unhandled),
}
impl ::std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::CloudHsmAccessDeniedException(inner) => inner.fmt(f),
Error::CloudHsmInternalFailureException(inner) => inner.fmt(f),
Error::CloudHsmInvalidRequestException(inner) => inner.fmt(f),
Error::CloudHsmResourceNotFoundException(inner) => inner.fmt(f),
Error::CloudHsmServiceException(inner) => inner.fmt(f),
Error::CloudHsmTagException(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl From<::aws_smithy_types::error::operation::BuildError> for Error {
fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
Error::Unhandled(::aws_smithy_types::error::Unhandled::builder().source(value).build())
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::copy_backup_to_region::CopyBackupToRegionError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::copy_backup_to_region::CopyBackupToRegionError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::copy_backup_to_region::CopyBackupToRegionError> for Error {
fn from(err: crate::operation::copy_backup_to_region::CopyBackupToRegionError) -> Self {
match err {
crate::operation::copy_backup_to_region::CopyBackupToRegionError::CloudHsmAccessDeniedException(inner) => {
Error::CloudHsmAccessDeniedException(inner)
}
crate::operation::copy_backup_to_region::CopyBackupToRegionError::CloudHsmInternalFailureException(inner) => {
Error::CloudHsmInternalFailureException(inner)
}
crate::operation::copy_backup_to_region::CopyBackupToRegionError::CloudHsmInvalidRequestException(inner) => {
Error::CloudHsmInvalidRequestException(inner)
}
crate::operation::copy_backup_to_region::CopyBackupToRegionError::CloudHsmResourceNotFoundException(inner) => {
Error::CloudHsmResourceNotFoundException(inner)
}
crate::operation::copy_backup_to_region::CopyBackupToRegionError::CloudHsmServiceException(inner) => {
Error::CloudHsmServiceException(inner)
}
crate::operation::copy_backup_to_region::CopyBackupToRegionError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
crate::operation::copy_backup_to_region::CopyBackupToRegionError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_cluster::CreateClusterError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_cluster::CreateClusterError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::create_cluster::CreateClusterError> for Error {
fn from(err: crate::operation::create_cluster::CreateClusterError) -> Self {
match err {
crate::operation::create_cluster::CreateClusterError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
crate::operation::create_cluster::CreateClusterError::CloudHsmInternalFailureException(inner) => {
Error::CloudHsmInternalFailureException(inner)
}
crate::operation::create_cluster::CreateClusterError::CloudHsmInvalidRequestException(inner) => {
Error::CloudHsmInvalidRequestException(inner)
}
crate::operation::create_cluster::CreateClusterError::CloudHsmResourceNotFoundException(inner) => {
Error::CloudHsmResourceNotFoundException(inner)
}
crate::operation::create_cluster::CreateClusterError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::create_cluster::CreateClusterError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
crate::operation::create_cluster::CreateClusterError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_hsm::CreateHsmError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_hsm::CreateHsmError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::create_hsm::CreateHsmError> for Error {
fn from(err: crate::operation::create_hsm::CreateHsmError) -> Self {
match err {
crate::operation::create_hsm::CreateHsmError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
crate::operation::create_hsm::CreateHsmError::CloudHsmInternalFailureException(inner) => Error::CloudHsmInternalFailureException(inner),
crate::operation::create_hsm::CreateHsmError::CloudHsmInvalidRequestException(inner) => Error::CloudHsmInvalidRequestException(inner),
crate::operation::create_hsm::CreateHsmError::CloudHsmResourceNotFoundException(inner) => Error::CloudHsmResourceNotFoundException(inner),
crate::operation::create_hsm::CreateHsmError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::create_hsm::CreateHsmError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_backup::DeleteBackupError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_backup::DeleteBackupError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::delete_backup::DeleteBackupError> for Error {
fn from(err: crate::operation::delete_backup::DeleteBackupError) -> Self {
match err {
crate::operation::delete_backup::DeleteBackupError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
crate::operation::delete_backup::DeleteBackupError::CloudHsmInternalFailureException(inner) => {
Error::CloudHsmInternalFailureException(inner)
}
crate::operation::delete_backup::DeleteBackupError::CloudHsmInvalidRequestException(inner) => {
Error::CloudHsmInvalidRequestException(inner)
}
crate::operation::delete_backup::DeleteBackupError::CloudHsmResourceNotFoundException(inner) => {
Error::CloudHsmResourceNotFoundException(inner)
}
crate::operation::delete_backup::DeleteBackupError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::delete_backup::DeleteBackupError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_cluster::DeleteClusterError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_cluster::DeleteClusterError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::delete_cluster::DeleteClusterError> for Error {
fn from(err: crate::operation::delete_cluster::DeleteClusterError) -> Self {
match err {
crate::operation::delete_cluster::DeleteClusterError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
crate::operation::delete_cluster::DeleteClusterError::CloudHsmInternalFailureException(inner) => {
Error::CloudHsmInternalFailureException(inner)
}
crate::operation::delete_cluster::DeleteClusterError::CloudHsmInvalidRequestException(inner) => {
Error::CloudHsmInvalidRequestException(inner)
}
crate::operation::delete_cluster::DeleteClusterError::CloudHsmResourceNotFoundException(inner) => {
Error::CloudHsmResourceNotFoundException(inner)
}
crate::operation::delete_cluster::DeleteClusterError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::delete_cluster::DeleteClusterError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
crate::operation::delete_cluster::DeleteClusterError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_hsm::DeleteHsmError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_hsm::DeleteHsmError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::delete_hsm::DeleteHsmError> for Error {
fn from(err: crate::operation::delete_hsm::DeleteHsmError) -> Self {
match err {
crate::operation::delete_hsm::DeleteHsmError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
crate::operation::delete_hsm::DeleteHsmError::CloudHsmInternalFailureException(inner) => Error::CloudHsmInternalFailureException(inner),
crate::operation::delete_hsm::DeleteHsmError::CloudHsmInvalidRequestException(inner) => Error::CloudHsmInvalidRequestException(inner),
crate::operation::delete_hsm::DeleteHsmError::CloudHsmResourceNotFoundException(inner) => Error::CloudHsmResourceNotFoundException(inner),
crate::operation::delete_hsm::DeleteHsmError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::delete_hsm::DeleteHsmError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_backups::DescribeBackupsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_backups::DescribeBackupsError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::describe_backups::DescribeBackupsError> for Error {
fn from(err: crate::operation::describe_backups::DescribeBackupsError) -> Self {
match err {
crate::operation::describe_backups::DescribeBackupsError::CloudHsmAccessDeniedException(inner) => {
Error::CloudHsmAccessDeniedException(inner)
}
crate::operation::describe_backups::DescribeBackupsError::CloudHsmInternalFailureException(inner) => {
Error::CloudHsmInternalFailureException(inner)
}
crate::operation::describe_backups::DescribeBackupsError::CloudHsmInvalidRequestException(inner) => {
Error::CloudHsmInvalidRequestException(inner)
}
crate::operation::describe_backups::DescribeBackupsError::CloudHsmResourceNotFoundException(inner) => {
Error::CloudHsmResourceNotFoundException(inner)
}
crate::operation::describe_backups::DescribeBackupsError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::describe_backups::DescribeBackupsError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
crate::operation::describe_backups::DescribeBackupsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_clusters::DescribeClustersError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_clusters::DescribeClustersError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::describe_clusters::DescribeClustersError> for Error {
fn from(err: crate::operation::describe_clusters::DescribeClustersError) -> Self {
match err {
crate::operation::describe_clusters::DescribeClustersError::CloudHsmAccessDeniedException(inner) => {
Error::CloudHsmAccessDeniedException(inner)
}
crate::operation::describe_clusters::DescribeClustersError::CloudHsmInternalFailureException(inner) => {
Error::CloudHsmInternalFailureException(inner)
}
crate::operation::describe_clusters::DescribeClustersError::CloudHsmInvalidRequestException(inner) => {
Error::CloudHsmInvalidRequestException(inner)
}
crate::operation::describe_clusters::DescribeClustersError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::describe_clusters::DescribeClustersError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
crate::operation::describe_clusters::DescribeClustersError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::initialize_cluster::InitializeClusterError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::initialize_cluster::InitializeClusterError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::initialize_cluster::InitializeClusterError> for Error {
fn from(err: crate::operation::initialize_cluster::InitializeClusterError) -> Self {
match err {
crate::operation::initialize_cluster::InitializeClusterError::CloudHsmAccessDeniedException(inner) => {
Error::CloudHsmAccessDeniedException(inner)
}
crate::operation::initialize_cluster::InitializeClusterError::CloudHsmInternalFailureException(inner) => {
Error::CloudHsmInternalFailureException(inner)
}
crate::operation::initialize_cluster::InitializeClusterError::CloudHsmInvalidRequestException(inner) => {
Error::CloudHsmInvalidRequestException(inner)
}
crate::operation::initialize_cluster::InitializeClusterError::CloudHsmResourceNotFoundException(inner) => {
Error::CloudHsmResourceNotFoundException(inner)
}
crate::operation::initialize_cluster::InitializeClusterError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::initialize_cluster::InitializeClusterError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags::ListTagsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags::ListTagsError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::list_tags::ListTagsError> for Error {
fn from(err: crate::operation::list_tags::ListTagsError) -> Self {
match err {
crate::operation::list_tags::ListTagsError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
crate::operation::list_tags::ListTagsError::CloudHsmInternalFailureException(inner) => Error::CloudHsmInternalFailureException(inner),
crate::operation::list_tags::ListTagsError::CloudHsmInvalidRequestException(inner) => Error::CloudHsmInvalidRequestException(inner),
crate::operation::list_tags::ListTagsError::CloudHsmResourceNotFoundException(inner) => Error::CloudHsmResourceNotFoundException(inner),
crate::operation::list_tags::ListTagsError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::list_tags::ListTagsError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
crate::operation::list_tags::ListTagsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_backup_attributes::ModifyBackupAttributesError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_backup_attributes::ModifyBackupAttributesError, R>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::modify_backup_attributes::ModifyBackupAttributesError> for Error {
fn from(err: crate::operation::modify_backup_attributes::ModifyBackupAttributesError) -> Self {
match err {
crate::operation::modify_backup_attributes::ModifyBackupAttributesError::CloudHsmAccessDeniedException(inner) => {
Error::CloudHsmAccessDeniedException(inner)
}
crate::operation::modify_backup_attributes::ModifyBackupAttributesError::CloudHsmInternalFailureException(inner) => {
Error::CloudHsmInternalFailureException(inner)
}
crate::operation::modify_backup_attributes::ModifyBackupAttributesError::CloudHsmInvalidRequestException(inner) => {
Error::CloudHsmInvalidRequestException(inner)
}
crate::operation::modify_backup_attributes::ModifyBackupAttributesError::CloudHsmResourceNotFoundException(inner) => {
Error::CloudHsmResourceNotFoundException(inner)
}
crate::operation::modify_backup_attributes::ModifyBackupAttributesError::CloudHsmServiceException(inner) => {
Error::CloudHsmServiceException(inner)
}
crate::operation::modify_backup_attributes::ModifyBackupAttributesError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_cluster::ModifyClusterError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_cluster::ModifyClusterError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::modify_cluster::ModifyClusterError> for Error {
fn from(err: crate::operation::modify_cluster::ModifyClusterError) -> Self {
match err {
crate::operation::modify_cluster::ModifyClusterError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
crate::operation::modify_cluster::ModifyClusterError::CloudHsmInternalFailureException(inner) => {
Error::CloudHsmInternalFailureException(inner)
}
crate::operation::modify_cluster::ModifyClusterError::CloudHsmInvalidRequestException(inner) => {
Error::CloudHsmInvalidRequestException(inner)
}
crate::operation::modify_cluster::ModifyClusterError::CloudHsmResourceNotFoundException(inner) => {
Error::CloudHsmResourceNotFoundException(inner)
}
crate::operation::modify_cluster::ModifyClusterError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::modify_cluster::ModifyClusterError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::restore_backup::RestoreBackupError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::restore_backup::RestoreBackupError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::restore_backup::RestoreBackupError> for Error {
fn from(err: crate::operation::restore_backup::RestoreBackupError) -> Self {
match err {
crate::operation::restore_backup::RestoreBackupError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
crate::operation::restore_backup::RestoreBackupError::CloudHsmInternalFailureException(inner) => {
Error::CloudHsmInternalFailureException(inner)
}
crate::operation::restore_backup::RestoreBackupError::CloudHsmInvalidRequestException(inner) => {
Error::CloudHsmInvalidRequestException(inner)
}
crate::operation::restore_backup::RestoreBackupError::CloudHsmResourceNotFoundException(inner) => {
Error::CloudHsmResourceNotFoundException(inner)
}
crate::operation::restore_backup::RestoreBackupError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::restore_backup::RestoreBackupError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::tag_resource::TagResourceError> for Error {
fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
match err {
crate::operation::tag_resource::TagResourceError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
crate::operation::tag_resource::TagResourceError::CloudHsmInternalFailureException(inner) => {
Error::CloudHsmInternalFailureException(inner)
}
crate::operation::tag_resource::TagResourceError::CloudHsmInvalidRequestException(inner) => Error::CloudHsmInvalidRequestException(inner),
crate::operation::tag_resource::TagResourceError::CloudHsmResourceNotFoundException(inner) => {
Error::CloudHsmResourceNotFoundException(inner)
}
crate::operation::tag_resource::TagResourceError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::tag_resource::TagResourceError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
::aws_smithy_types::error::Unhandled::builder()
.meta(::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::untag_resource::UntagResourceError> for Error {
fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
match err {
crate::operation::untag_resource::UntagResourceError::CloudHsmAccessDeniedException(inner) => Error::CloudHsmAccessDeniedException(inner),
crate::operation::untag_resource::UntagResourceError::CloudHsmInternalFailureException(inner) => {
Error::CloudHsmInternalFailureException(inner)
}
crate::operation::untag_resource::UntagResourceError::CloudHsmInvalidRequestException(inner) => {
Error::CloudHsmInvalidRequestException(inner)
}
crate::operation::untag_resource::UntagResourceError::CloudHsmResourceNotFoundException(inner) => {
Error::CloudHsmResourceNotFoundException(inner)
}
crate::operation::untag_resource::UntagResourceError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::untag_resource::UntagResourceError::CloudHsmTagException(inner) => Error::CloudHsmTagException(inner),
crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl ::std::error::Error for Error {
fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
match self {
Error::CloudHsmAccessDeniedException(inner) => inner.source(),
Error::CloudHsmInternalFailureException(inner) => inner.source(),
Error::CloudHsmInvalidRequestException(inner) => inner.source(),
Error::CloudHsmResourceNotFoundException(inner) => inner.source(),
Error::CloudHsmServiceException(inner) => inner.source(),
Error::CloudHsmTagException(inner) => inner.source(),
Error::Unhandled(inner) => inner.source(),
}
}
}
impl ::aws_http::request_id::RequestId for Error {
fn request_id(&self) -> Option<&str> {
match self {
Self::CloudHsmAccessDeniedException(e) => e.request_id(),
Self::CloudHsmInternalFailureException(e) => e.request_id(),
Self::CloudHsmInvalidRequestException(e) => e.request_id(),
Self::CloudHsmResourceNotFoundException(e) => e.request_id(),
Self::CloudHsmServiceException(e) => e.request_id(),
Self::CloudHsmTagException(e) => e.request_id(),
Self::Unhandled(e) => e.request_id(),
}
}
}