#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
AccessDeniedException(crate::types::error::AccessDeniedException),
ConcurrentModificationException(crate::types::error::ConcurrentModificationException),
ConfigurationException(crate::types::error::ConfigurationException),
InvalidNextTokenException(crate::types::error::InvalidNextTokenException),
LimitExceededException(crate::types::error::LimitExceededException),
ResourceAlreadyExistsException(crate::types::error::ResourceAlreadyExistsException),
ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
ValidationException(crate::types::error::ValidationException),
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::AccessDeniedException(inner) => inner.fmt(f),
Error::ConcurrentModificationException(inner) => inner.fmt(f),
Error::ConfigurationException(inner) => inner.fmt(f),
Error::InvalidNextTokenException(inner) => inner.fmt(f),
Error::LimitExceededException(inner) => inner.fmt(f),
Error::ResourceAlreadyExistsException(inner) => inner.fmt(f),
Error::ResourceNotFoundException(inner) => inner.fmt(f),
Error::ValidationException(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::create_notification_rule::CreateNotificationRuleError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::create_notification_rule::CreateNotificationRuleError, R>) -> Self {
match err {
::aws_smithy_http::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_notification_rule::CreateNotificationRuleError> for Error {
fn from(err: crate::operation::create_notification_rule::CreateNotificationRuleError) -> Self {
match err {
crate::operation::create_notification_rule::CreateNotificationRuleError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::create_notification_rule::CreateNotificationRuleError::ConcurrentModificationException(inner) => {
Error::ConcurrentModificationException(inner)
}
crate::operation::create_notification_rule::CreateNotificationRuleError::ConfigurationException(inner) => {
Error::ConfigurationException(inner)
}
crate::operation::create_notification_rule::CreateNotificationRuleError::LimitExceededException(inner) => {
Error::LimitExceededException(inner)
}
crate::operation::create_notification_rule::CreateNotificationRuleError::ResourceAlreadyExistsException(inner) => {
Error::ResourceAlreadyExistsException(inner)
}
crate::operation::create_notification_rule::CreateNotificationRuleError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::create_notification_rule::CreateNotificationRuleError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::delete_notification_rule::DeleteNotificationRuleError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::delete_notification_rule::DeleteNotificationRuleError, R>) -> Self {
match err {
::aws_smithy_http::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_notification_rule::DeleteNotificationRuleError> for Error {
fn from(err: crate::operation::delete_notification_rule::DeleteNotificationRuleError) -> Self {
match err {
crate::operation::delete_notification_rule::DeleteNotificationRuleError::ConcurrentModificationException(inner) => {
Error::ConcurrentModificationException(inner)
}
crate::operation::delete_notification_rule::DeleteNotificationRuleError::LimitExceededException(inner) => {
Error::LimitExceededException(inner)
}
crate::operation::delete_notification_rule::DeleteNotificationRuleError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::delete_notification_rule::DeleteNotificationRuleError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::delete_target::DeleteTargetError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::delete_target::DeleteTargetError, R>) -> Self {
match err {
::aws_smithy_http::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_target::DeleteTargetError> for Error {
fn from(err: crate::operation::delete_target::DeleteTargetError) -> Self {
match err {
crate::operation::delete_target::DeleteTargetError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::delete_target::DeleteTargetError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::describe_notification_rule::DescribeNotificationRuleError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::describe_notification_rule::DescribeNotificationRuleError, R>) -> Self {
match err {
::aws_smithy_http::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_notification_rule::DescribeNotificationRuleError> for Error {
fn from(err: crate::operation::describe_notification_rule::DescribeNotificationRuleError) -> Self {
match err {
crate::operation::describe_notification_rule::DescribeNotificationRuleError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::describe_notification_rule::DescribeNotificationRuleError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::describe_notification_rule::DescribeNotificationRuleError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::list_event_types::ListEventTypesError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::list_event_types::ListEventTypesError, R>) -> Self {
match err {
::aws_smithy_http::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_event_types::ListEventTypesError> for Error {
fn from(err: crate::operation::list_event_types::ListEventTypesError) -> Self {
match err {
crate::operation::list_event_types::ListEventTypesError::InvalidNextTokenException(inner) => Error::InvalidNextTokenException(inner),
crate::operation::list_event_types::ListEventTypesError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::list_event_types::ListEventTypesError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::list_notification_rules::ListNotificationRulesError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::list_notification_rules::ListNotificationRulesError, R>) -> Self {
match err {
::aws_smithy_http::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_notification_rules::ListNotificationRulesError> for Error {
fn from(err: crate::operation::list_notification_rules::ListNotificationRulesError) -> Self {
match err {
crate::operation::list_notification_rules::ListNotificationRulesError::InvalidNextTokenException(inner) => {
Error::InvalidNextTokenException(inner)
}
crate::operation::list_notification_rules::ListNotificationRulesError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::list_notification_rules::ListNotificationRulesError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
match err {
::aws_smithy_http::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_for_resource::ListTagsForResourceError> for Error {
fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
match err {
crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::list_tags_for_resource::ListTagsForResourceError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::list_targets::ListTargetsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::list_targets::ListTargetsError, R>) -> Self {
match err {
::aws_smithy_http::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_targets::ListTargetsError> for Error {
fn from(err: crate::operation::list_targets::ListTargetsError) -> Self {
match err {
crate::operation::list_targets::ListTargetsError::InvalidNextTokenException(inner) => Error::InvalidNextTokenException(inner),
crate::operation::list_targets::ListTargetsError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::list_targets::ListTargetsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::subscribe::SubscribeError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::subscribe::SubscribeError, R>) -> Self {
match err {
::aws_smithy_http::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::subscribe::SubscribeError> for Error {
fn from(err: crate::operation::subscribe::SubscribeError) -> Self {
match err {
crate::operation::subscribe::SubscribeError::ConfigurationException(inner) => Error::ConfigurationException(inner),
crate::operation::subscribe::SubscribeError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::subscribe::SubscribeError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::subscribe::SubscribeError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
match err {
::aws_smithy_http::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::ConcurrentModificationException(inner) => Error::ConcurrentModificationException(inner),
crate::operation::tag_resource::TagResourceError::LimitExceededException(inner) => Error::LimitExceededException(inner),
crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::tag_resource::TagResourceError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::unsubscribe::UnsubscribeError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::unsubscribe::UnsubscribeError, R>) -> Self {
match err {
::aws_smithy_http::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::unsubscribe::UnsubscribeError> for Error {
fn from(err: crate::operation::unsubscribe::UnsubscribeError) -> Self {
match err {
crate::operation::unsubscribe::UnsubscribeError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::unsubscribe::UnsubscribeError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
match err {
::aws_smithy_http::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::ConcurrentModificationException(inner) => {
Error::ConcurrentModificationException(inner)
}
crate::operation::untag_resource::UntagResourceError::LimitExceededException(inner) => Error::LimitExceededException(inner),
crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::untag_resource::UntagResourceError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::update_notification_rule::UpdateNotificationRuleError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::update_notification_rule::UpdateNotificationRuleError, R>) -> Self {
match err {
::aws_smithy_http::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::update_notification_rule::UpdateNotificationRuleError> for Error {
fn from(err: crate::operation::update_notification_rule::UpdateNotificationRuleError) -> Self {
match err {
crate::operation::update_notification_rule::UpdateNotificationRuleError::ConfigurationException(inner) => {
Error::ConfigurationException(inner)
}
crate::operation::update_notification_rule::UpdateNotificationRuleError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::update_notification_rule::UpdateNotificationRuleError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::update_notification_rule::UpdateNotificationRuleError::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::ConcurrentModificationException(inner) => inner.source(),
Error::ConfigurationException(inner) => inner.source(),
Error::InvalidNextTokenException(inner) => inner.source(),
Error::LimitExceededException(inner) => inner.source(),
Error::ResourceAlreadyExistsException(inner) => inner.source(),
Error::ResourceNotFoundException(inner) => inner.source(),
Error::ValidationException(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::AccessDeniedException(e) => e.request_id(),
Self::ConcurrentModificationException(e) => e.request_id(),
Self::ConfigurationException(e) => e.request_id(),
Self::InvalidNextTokenException(e) => e.request_id(),
Self::LimitExceededException(e) => e.request_id(),
Self::ResourceAlreadyExistsException(e) => e.request_id(),
Self::ResourceNotFoundException(e) => e.request_id(),
Self::ValidationException(e) => e.request_id(),
Self::Unhandled(e) => e.request_id(),
}
}
}