aws-sdk-resourcegroupstagging 1.101.0

AWS SDK for AWS Resource Groups Tagging API
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>The request failed because the target of the operation is currently being modified by a different request. Try again later.</p>
    ConcurrentModificationException(crate::types::error::ConcurrentModificationException),
    /// <p>The request failed because performing the operation would violate a constraint.</p>
    /// <p>Some of the reasons in the following list might not apply to this specific operation.</p>
    /// <ul>
    /// <li>
    /// <p>You must meet the prerequisites for using tag policies. For information, see <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tag-policies-orgs.html#tag-policies-prereqs">Prerequisites and permissions</a> in the <i>Tagging Amazon Web Services resources and Tag Editor</i> user guide.</p></li>
    /// <li>
    /// <p>You must enable the tag policies service principal (<code>tagpolicies.tag.amazonaws.com</code>) to integrate with Organizations For information, see <a href="https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html">EnableAWSServiceAccess</a>.</p></li>
    /// <li>
    /// <p>You must have a tag policy attached to the organization root, an OU, or an account.</p></li>
    /// </ul>
    ConstraintViolationException(crate::types::error::ConstraintViolationException),
    /// <p>The request processing failed because of an unknown error, exception, or failure. You can retry the request.</p>
    InternalServiceException(crate::types::error::InternalServiceException),
    /// <p>The request failed because of one of the following reasons:</p>
    /// <ul>
    /// <li>
    /// <p>A required parameter is missing.</p></li>
    /// <li>
    /// <p>A provided string parameter is malformed.</p></li>
    /// <li>
    /// <p>An provided parameter value is out of range.</p></li>
    /// <li>
    /// <p>The target ID is invalid, unsupported, or doesn't exist.</p></li>
    /// <li>
    /// <p>You can't access the Amazon S3 bucket for report storage. For more information, see <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/tag-policies-orgs.html#bucket-policy">Amazon S3 bucket policy for report storage</a> in the <i>Tagging Amazon Web Services resources and Tag Editor</i> user guide.</p></li>
    /// <li>
    /// <p>The partition specified in an ARN parameter in the request doesn't match the partition where you invoked the operation. The partition is specified by the second field of the ARN.</p></li>
    /// </ul>
    InvalidParameterException(crate::types::error::InvalidParameterException),
    /// <p>The request failed because the specified <code>PaginationToken</code> has expired. A <code>PaginationToken</code> is valid for a maximum of 15 minutes.</p>
    PaginationTokenExpiredException(crate::types::error::PaginationTokenExpiredException),
    /// <p>The request failed because it exceeded the allowed frequency of submitted requests.</p>
    ThrottledException(crate::types::error::ThrottledException),
    /// 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::ConcurrentModificationException(inner) => inner.fmt(f),
            Error::ConstraintViolationException(inner) => inner.fmt(f),
            Error::InternalServiceException(inner) => inner.fmt(f),
            Error::InvalidParameterException(inner) => inner.fmt(f),
            Error::PaginationTokenExpiredException(inner) => inner.fmt(f),
            Error::ThrottledException(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::ConcurrentModificationException(inner) => inner.meta(),
            Self::ConstraintViolationException(inner) => inner.meta(),
            Self::InternalServiceException(inner) => inner.meta(),
            Self::InvalidParameterException(inner) => inner.meta(),
            Self::PaginationTokenExpiredException(inner) => inner.meta(),
            Self::ThrottledException(inner) => inner.meta(),
            Self::Unhandled(inner) => &inner.meta,
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_report_creation::DescribeReportCreationError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(
        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_report_creation::DescribeReportCreationError, 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_report_creation::DescribeReportCreationError> for Error {
    fn from(err: crate::operation::describe_report_creation::DescribeReportCreationError) -> Self {
        match err {
            crate::operation::describe_report_creation::DescribeReportCreationError::ConstraintViolationException(inner) => {
                Error::ConstraintViolationException(inner)
            }
            crate::operation::describe_report_creation::DescribeReportCreationError::InternalServiceException(inner) => {
                Error::InternalServiceException(inner)
            }
            crate::operation::describe_report_creation::DescribeReportCreationError::InvalidParameterException(inner) => {
                Error::InvalidParameterException(inner)
            }
            crate::operation::describe_report_creation::DescribeReportCreationError::ThrottledException(inner) => Error::ThrottledException(inner),
            crate::operation::describe_report_creation::DescribeReportCreationError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_compliance_summary::GetComplianceSummaryError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_compliance_summary::GetComplianceSummaryError, 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_compliance_summary::GetComplianceSummaryError> for Error {
    fn from(err: crate::operation::get_compliance_summary::GetComplianceSummaryError) -> Self {
        match err {
            crate::operation::get_compliance_summary::GetComplianceSummaryError::ConstraintViolationException(inner) => {
                Error::ConstraintViolationException(inner)
            }
            crate::operation::get_compliance_summary::GetComplianceSummaryError::InternalServiceException(inner) => {
                Error::InternalServiceException(inner)
            }
            crate::operation::get_compliance_summary::GetComplianceSummaryError::InvalidParameterException(inner) => {
                Error::InvalidParameterException(inner)
            }
            crate::operation::get_compliance_summary::GetComplianceSummaryError::ThrottledException(inner) => Error::ThrottledException(inner),
            crate::operation::get_compliance_summary::GetComplianceSummaryError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_resources::GetResourcesError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_resources::GetResourcesError, 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_resources::GetResourcesError> for Error {
    fn from(err: crate::operation::get_resources::GetResourcesError) -> Self {
        match err {
            crate::operation::get_resources::GetResourcesError::InternalServiceException(inner) => Error::InternalServiceException(inner),
            crate::operation::get_resources::GetResourcesError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
            crate::operation::get_resources::GetResourcesError::PaginationTokenExpiredException(inner) => {
                Error::PaginationTokenExpiredException(inner)
            }
            crate::operation::get_resources::GetResourcesError::ThrottledException(inner) => Error::ThrottledException(inner),
            crate::operation::get_resources::GetResourcesError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_tag_keys::GetTagKeysError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_tag_keys::GetTagKeysError, 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_tag_keys::GetTagKeysError> for Error {
    fn from(err: crate::operation::get_tag_keys::GetTagKeysError) -> Self {
        match err {
            crate::operation::get_tag_keys::GetTagKeysError::InternalServiceException(inner) => Error::InternalServiceException(inner),
            crate::operation::get_tag_keys::GetTagKeysError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
            crate::operation::get_tag_keys::GetTagKeysError::PaginationTokenExpiredException(inner) => Error::PaginationTokenExpiredException(inner),
            crate::operation::get_tag_keys::GetTagKeysError::ThrottledException(inner) => Error::ThrottledException(inner),
            crate::operation::get_tag_keys::GetTagKeysError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_tag_values::GetTagValuesError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_tag_values::GetTagValuesError, 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_tag_values::GetTagValuesError> for Error {
    fn from(err: crate::operation::get_tag_values::GetTagValuesError) -> Self {
        match err {
            crate::operation::get_tag_values::GetTagValuesError::InternalServiceException(inner) => Error::InternalServiceException(inner),
            crate::operation::get_tag_values::GetTagValuesError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
            crate::operation::get_tag_values::GetTagValuesError::PaginationTokenExpiredException(inner) => {
                Error::PaginationTokenExpiredException(inner)
            }
            crate::operation::get_tag_values::GetTagValuesError::ThrottledException(inner) => Error::ThrottledException(inner),
            crate::operation::get_tag_values::GetTagValuesError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_required_tags::ListRequiredTagsError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_required_tags::ListRequiredTagsError, 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_required_tags::ListRequiredTagsError> for Error {
    fn from(err: crate::operation::list_required_tags::ListRequiredTagsError) -> Self {
        match err {
            crate::operation::list_required_tags::ListRequiredTagsError::InternalServiceException(inner) => Error::InternalServiceException(inner),
            crate::operation::list_required_tags::ListRequiredTagsError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
            crate::operation::list_required_tags::ListRequiredTagsError::PaginationTokenExpiredException(inner) => {
                Error::PaginationTokenExpiredException(inner)
            }
            crate::operation::list_required_tags::ListRequiredTagsError::ThrottledException(inner) => Error::ThrottledException(inner),
            crate::operation::list_required_tags::ListRequiredTagsError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_report_creation::StartReportCreationError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_report_creation::StartReportCreationError, 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::start_report_creation::StartReportCreationError> for Error {
    fn from(err: crate::operation::start_report_creation::StartReportCreationError) -> Self {
        match err {
            crate::operation::start_report_creation::StartReportCreationError::ConcurrentModificationException(inner) => {
                Error::ConcurrentModificationException(inner)
            }
            crate::operation::start_report_creation::StartReportCreationError::ConstraintViolationException(inner) => {
                Error::ConstraintViolationException(inner)
            }
            crate::operation::start_report_creation::StartReportCreationError::InternalServiceException(inner) => {
                Error::InternalServiceException(inner)
            }
            crate::operation::start_report_creation::StartReportCreationError::InvalidParameterException(inner) => {
                Error::InvalidParameterException(inner)
            }
            crate::operation::start_report_creation::StartReportCreationError::ThrottledException(inner) => Error::ThrottledException(inner),
            crate::operation::start_report_creation::StartReportCreationError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resources::TagResourcesError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resources::TagResourcesError, 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::tag_resources::TagResourcesError> for Error {
    fn from(err: crate::operation::tag_resources::TagResourcesError) -> Self {
        match err {
            crate::operation::tag_resources::TagResourcesError::InternalServiceException(inner) => Error::InternalServiceException(inner),
            crate::operation::tag_resources::TagResourcesError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
            crate::operation::tag_resources::TagResourcesError::ThrottledException(inner) => Error::ThrottledException(inner),
            crate::operation::tag_resources::TagResourcesError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resources::UntagResourcesError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resources::UntagResourcesError, 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::untag_resources::UntagResourcesError> for Error {
    fn from(err: crate::operation::untag_resources::UntagResourcesError) -> Self {
        match err {
            crate::operation::untag_resources::UntagResourcesError::InternalServiceException(inner) => Error::InternalServiceException(inner),
            crate::operation::untag_resources::UntagResourcesError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
            crate::operation::untag_resources::UntagResourcesError::ThrottledException(inner) => Error::ThrottledException(inner),
            crate::operation::untag_resources::UntagResourcesError::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::ConcurrentModificationException(inner) => inner.source(),
            Error::ConstraintViolationException(inner) => inner.source(),
            Error::InternalServiceException(inner) => inner.source(),
            Error::InvalidParameterException(inner) => inner.source(),
            Error::PaginationTokenExpiredException(inner) => inner.source(),
            Error::ThrottledException(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::ConcurrentModificationException(e) => e.request_id(),
            Self::ConstraintViolationException(e) => e.request_id(),
            Self::InternalServiceException(e) => e.request_id(),
            Self::InvalidParameterException(e) => e.request_id(),
            Self::PaginationTokenExpiredException(e) => e.request_id(),
            Self::ThrottledException(e) => e.request_id(),
            Self::Unhandled(e) => e.meta.request_id(),
        }
    }
}