aws-sdk-pricing 1.104.0

AWS SDK for AWS Price List Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// All possible error types for this service.
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
    /// <p>General authentication failure. The request wasn't signed correctly.</p>
    AccessDeniedException(crate::types::error::AccessDeniedException),
    /// <p>The pagination token expired. Try again without a pagination token.</p>
    ExpiredNextTokenException(crate::types::error::ExpiredNextTokenException),
    /// <p>An error on the server occurred during the processing of your request. Try again later.</p>
    InternalErrorException(crate::types::error::InternalErrorException),
    /// <p>The pagination token is invalid. Try again without a pagination token.</p>
    InvalidNextTokenException(crate::types::error::InvalidNextTokenException),
    /// <p>One or more parameters had an invalid value.</p>
    InvalidParameterException(crate::types::error::InvalidParameterException),
    /// <p>The requested resource can't be found.</p>
    NotFoundException(crate::types::error::NotFoundException),
    /// <p>The requested resource can't be found.</p>
    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
    /// <p>You've made too many requests exceeding service quotas.</p>
    ThrottlingException(crate::types::error::ThrottlingException),
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
    variable wildcard pattern and check `.code()`:
     \
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
     \
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
    Unhandled(crate::error::sealed_unhandled::Unhandled),
}
impl ::std::fmt::Display for Error {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            Error::AccessDeniedException(inner) => inner.fmt(f),
            Error::ExpiredNextTokenException(inner) => inner.fmt(f),
            Error::InternalErrorException(inner) => inner.fmt(f),
            Error::InvalidNextTokenException(inner) => inner.fmt(f),
            Error::InvalidParameterException(inner) => inner.fmt(f),
            Error::NotFoundException(inner) => inner.fmt(f),
            Error::ResourceNotFoundException(inner) => inner.fmt(f),
            Error::ThrottlingException(inner) => inner.fmt(f),
            Error::Unhandled(_) => {
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
                    write!(f, "unhandled error ({code})")
                } else {
                    f.write_str("unhandled error")
                }
            }
        }
    }
}
impl From<::aws_smithy_types::error::operation::BuildError> for Error {
    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
            source: value.into(),
            meta: ::std::default::Default::default(),
        })
    }
}
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
        match self {
            Self::AccessDeniedException(inner) => inner.meta(),
            Self::ExpiredNextTokenException(inner) => inner.meta(),
            Self::InternalErrorException(inner) => inner.meta(),
            Self::InvalidNextTokenException(inner) => inner.meta(),
            Self::InvalidParameterException(inner) => inner.meta(),
            Self::NotFoundException(inner) => inner.meta(),
            Self::ResourceNotFoundException(inner) => inner.meta(),
            Self::ThrottlingException(inner) => inner.meta(),
            Self::Unhandled(inner) => &inner.meta,
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_services::DescribeServicesError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_services::DescribeServicesError, R>) -> Self {
        match err {
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
                source: err.into(),
            }),
        }
    }
}
impl From<crate::operation::describe_services::DescribeServicesError> for Error {
    fn from(err: crate::operation::describe_services::DescribeServicesError) -> Self {
        match err {
            crate::operation::describe_services::DescribeServicesError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
            crate::operation::describe_services::DescribeServicesError::ExpiredNextTokenException(inner) => Error::ExpiredNextTokenException(inner),
            crate::operation::describe_services::DescribeServicesError::InternalErrorException(inner) => Error::InternalErrorException(inner),
            crate::operation::describe_services::DescribeServicesError::InvalidNextTokenException(inner) => Error::InvalidNextTokenException(inner),
            crate::operation::describe_services::DescribeServicesError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
            crate::operation::describe_services::DescribeServicesError::NotFoundException(inner) => Error::NotFoundException(inner),
            crate::operation::describe_services::DescribeServicesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::describe_services::DescribeServicesError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_attribute_values::GetAttributeValuesError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_attribute_values::GetAttributeValuesError, R>) -> Self {
        match err {
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
                source: err.into(),
            }),
        }
    }
}
impl From<crate::operation::get_attribute_values::GetAttributeValuesError> for Error {
    fn from(err: crate::operation::get_attribute_values::GetAttributeValuesError) -> Self {
        match err {
            crate::operation::get_attribute_values::GetAttributeValuesError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
            crate::operation::get_attribute_values::GetAttributeValuesError::ExpiredNextTokenException(inner) => {
                Error::ExpiredNextTokenException(inner)
            }
            crate::operation::get_attribute_values::GetAttributeValuesError::InternalErrorException(inner) => Error::InternalErrorException(inner),
            crate::operation::get_attribute_values::GetAttributeValuesError::InvalidNextTokenException(inner) => {
                Error::InvalidNextTokenException(inner)
            }
            crate::operation::get_attribute_values::GetAttributeValuesError::InvalidParameterException(inner) => {
                Error::InvalidParameterException(inner)
            }
            crate::operation::get_attribute_values::GetAttributeValuesError::NotFoundException(inner) => Error::NotFoundException(inner),
            crate::operation::get_attribute_values::GetAttributeValuesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::get_attribute_values::GetAttributeValuesError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_price_list_file_url::GetPriceListFileUrlError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_price_list_file_url::GetPriceListFileUrlError, R>) -> Self {
        match err {
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
                source: err.into(),
            }),
        }
    }
}
impl From<crate::operation::get_price_list_file_url::GetPriceListFileUrlError> for Error {
    fn from(err: crate::operation::get_price_list_file_url::GetPriceListFileUrlError) -> Self {
        match err {
            crate::operation::get_price_list_file_url::GetPriceListFileUrlError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
            crate::operation::get_price_list_file_url::GetPriceListFileUrlError::InternalErrorException(inner) => {
                Error::InternalErrorException(inner)
            }
            crate::operation::get_price_list_file_url::GetPriceListFileUrlError::InvalidParameterException(inner) => {
                Error::InvalidParameterException(inner)
            }
            crate::operation::get_price_list_file_url::GetPriceListFileUrlError::NotFoundException(inner) => Error::NotFoundException(inner),
            crate::operation::get_price_list_file_url::GetPriceListFileUrlError::ResourceNotFoundException(inner) => {
                Error::ResourceNotFoundException(inner)
            }
            crate::operation::get_price_list_file_url::GetPriceListFileUrlError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::get_price_list_file_url::GetPriceListFileUrlError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_products::GetProductsError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_products::GetProductsError, R>) -> Self {
        match err {
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
                source: err.into(),
            }),
        }
    }
}
impl From<crate::operation::get_products::GetProductsError> for Error {
    fn from(err: crate::operation::get_products::GetProductsError) -> Self {
        match err {
            crate::operation::get_products::GetProductsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
            crate::operation::get_products::GetProductsError::ExpiredNextTokenException(inner) => Error::ExpiredNextTokenException(inner),
            crate::operation::get_products::GetProductsError::InternalErrorException(inner) => Error::InternalErrorException(inner),
            crate::operation::get_products::GetProductsError::InvalidNextTokenException(inner) => Error::InvalidNextTokenException(inner),
            crate::operation::get_products::GetProductsError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
            crate::operation::get_products::GetProductsError::NotFoundException(inner) => Error::NotFoundException(inner),
            crate::operation::get_products::GetProductsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::get_products::GetProductsError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_price_lists::ListPriceListsError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_price_lists::ListPriceListsError, R>) -> Self {
        match err {
            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
                source: err.into(),
            }),
        }
    }
}
impl From<crate::operation::list_price_lists::ListPriceListsError> for Error {
    fn from(err: crate::operation::list_price_lists::ListPriceListsError) -> Self {
        match err {
            crate::operation::list_price_lists::ListPriceListsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
            crate::operation::list_price_lists::ListPriceListsError::ExpiredNextTokenException(inner) => Error::ExpiredNextTokenException(inner),
            crate::operation::list_price_lists::ListPriceListsError::InternalErrorException(inner) => Error::InternalErrorException(inner),
            crate::operation::list_price_lists::ListPriceListsError::InvalidNextTokenException(inner) => Error::InvalidNextTokenException(inner),
            crate::operation::list_price_lists::ListPriceListsError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
            crate::operation::list_price_lists::ListPriceListsError::NotFoundException(inner) => Error::NotFoundException(inner),
            crate::operation::list_price_lists::ListPriceListsError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
            crate::operation::list_price_lists::ListPriceListsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::list_price_lists::ListPriceListsError::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::AccessDeniedException(inner) => inner.source(),
            Error::ExpiredNextTokenException(inner) => inner.source(),
            Error::InternalErrorException(inner) => inner.source(),
            Error::InvalidNextTokenException(inner) => inner.source(),
            Error::InvalidParameterException(inner) => inner.source(),
            Error::NotFoundException(inner) => inner.source(),
            Error::ResourceNotFoundException(inner) => inner.source(),
            Error::ThrottlingException(inner) => inner.source(),
            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
        }
    }
}
impl ::aws_types::request_id::RequestId for Error {
    fn request_id(&self) -> Option<&str> {
        match self {
            Self::AccessDeniedException(e) => e.request_id(),
            Self::ExpiredNextTokenException(e) => e.request_id(),
            Self::InternalErrorException(e) => e.request_id(),
            Self::InvalidNextTokenException(e) => e.request_id(),
            Self::InvalidParameterException(e) => e.request_id(),
            Self::NotFoundException(e) => e.request_id(),
            Self::ResourceNotFoundException(e) => e.request_id(),
            Self::ThrottlingException(e) => e.request_id(),
            Self::Unhandled(e) => e.meta.request_id(),
        }
    }
}