#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
AccessDeniedException(crate::types::error::AccessDeniedException),
ConflictException(crate::types::error::ConflictException),
InternalServerException(crate::types::error::InternalServerException),
ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
ThrottlingException(crate::types::error::ThrottlingException),
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::ConflictException(inner) => inner.fmt(f),
Error::InternalServerException(inner) => inner.fmt(f),
Error::ResourceNotFoundException(inner) => inner.fmt(f),
Error::ThrottlingException(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::batch_get_findings::BatchGetFindingsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::batch_get_findings::BatchGetFindingsError, 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::batch_get_findings::BatchGetFindingsError> for Error {
fn from(err: crate::operation::batch_get_findings::BatchGetFindingsError) -> Self {
match err {
crate::operation::batch_get_findings::BatchGetFindingsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::batch_get_findings::BatchGetFindingsError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::batch_get_findings::BatchGetFindingsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::batch_get_findings::BatchGetFindingsError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::batch_get_findings::BatchGetFindingsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::create_scan::CreateScanError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::create_scan::CreateScanError, 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_scan::CreateScanError> for Error {
fn from(err: crate::operation::create_scan::CreateScanError) -> Self {
match err {
crate::operation::create_scan::CreateScanError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::create_scan::CreateScanError::ConflictException(inner) => Error::ConflictException(inner),
crate::operation::create_scan::CreateScanError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::create_scan::CreateScanError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::create_scan::CreateScanError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::create_scan::CreateScanError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::create_scan::CreateScanError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::create_upload_url::CreateUploadUrlError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::create_upload_url::CreateUploadUrlError, 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_upload_url::CreateUploadUrlError> for Error {
fn from(err: crate::operation::create_upload_url::CreateUploadUrlError) -> Self {
match err {
crate::operation::create_upload_url::CreateUploadUrlError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::create_upload_url::CreateUploadUrlError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::create_upload_url::CreateUploadUrlError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::create_upload_url::CreateUploadUrlError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::create_upload_url::CreateUploadUrlError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::get_account_configuration::GetAccountConfigurationError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::get_account_configuration::GetAccountConfigurationError, 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::get_account_configuration::GetAccountConfigurationError> for Error {
fn from(err: crate::operation::get_account_configuration::GetAccountConfigurationError) -> Self {
match err {
crate::operation::get_account_configuration::GetAccountConfigurationError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::get_account_configuration::GetAccountConfigurationError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::get_account_configuration::GetAccountConfigurationError::ThrottlingException(inner) => {
Error::ThrottlingException(inner)
}
crate::operation::get_account_configuration::GetAccountConfigurationError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::get_account_configuration::GetAccountConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::get_findings::GetFindingsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::get_findings::GetFindingsError, 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::get_findings::GetFindingsError> for Error {
fn from(err: crate::operation::get_findings::GetFindingsError) -> Self {
match err {
crate::operation::get_findings::GetFindingsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::get_findings::GetFindingsError::ConflictException(inner) => Error::ConflictException(inner),
crate::operation::get_findings::GetFindingsError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::get_findings::GetFindingsError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::get_findings::GetFindingsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::get_findings::GetFindingsError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::get_findings::GetFindingsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::get_metrics_summary::GetMetricsSummaryError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::get_metrics_summary::GetMetricsSummaryError, 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::get_metrics_summary::GetMetricsSummaryError> for Error {
fn from(err: crate::operation::get_metrics_summary::GetMetricsSummaryError) -> Self {
match err {
crate::operation::get_metrics_summary::GetMetricsSummaryError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::get_metrics_summary::GetMetricsSummaryError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::get_metrics_summary::GetMetricsSummaryError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::get_metrics_summary::GetMetricsSummaryError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::get_metrics_summary::GetMetricsSummaryError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::get_scan::GetScanError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::get_scan::GetScanError, 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::get_scan::GetScanError> for Error {
fn from(err: crate::operation::get_scan::GetScanError) -> Self {
match err {
crate::operation::get_scan::GetScanError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::get_scan::GetScanError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::get_scan::GetScanError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::get_scan::GetScanError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::get_scan::GetScanError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::list_findings_metrics::ListFindingsMetricsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::list_findings_metrics::ListFindingsMetricsError, 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_findings_metrics::ListFindingsMetricsError> for Error {
fn from(err: crate::operation::list_findings_metrics::ListFindingsMetricsError) -> Self {
match err {
crate::operation::list_findings_metrics::ListFindingsMetricsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::list_findings_metrics::ListFindingsMetricsError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::list_findings_metrics::ListFindingsMetricsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::list_findings_metrics::ListFindingsMetricsError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::list_findings_metrics::ListFindingsMetricsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::list_scans::ListScansError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::list_scans::ListScansError, 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_scans::ListScansError> for Error {
fn from(err: crate::operation::list_scans::ListScansError) -> Self {
match err {
crate::operation::list_scans::ListScansError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::list_scans::ListScansError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::list_scans::ListScansError::ThrottlingException(inner) => Error::ThrottlingException(inner),
crate::operation::list_scans::ListScansError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::list_scans::ListScansError::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::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::list_tags_for_resource::ListTagsForResourceError::ConflictException(inner) => Error::ConflictException(inner),
crate::operation::list_tags_for_resource::ListTagsForResourceError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::list_tags_for_resource::ListTagsForResourceError::ThrottlingException(inner) => Error::ThrottlingException(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::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::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::tag_resource::TagResourceError::ConflictException(inner) => Error::ConflictException(inner),
crate::operation::tag_resource::TagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::tag_resource::TagResourceError::ThrottlingException(inner) => Error::ThrottlingException(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::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::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::untag_resource::UntagResourceError::ConflictException(inner) => Error::ConflictException(inner),
crate::operation::untag_resource::UntagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::untag_resource::UntagResourceError::ThrottlingException(inner) => Error::ThrottlingException(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_account_configuration::UpdateAccountConfigurationError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::update_account_configuration::UpdateAccountConfigurationError, 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_account_configuration::UpdateAccountConfigurationError> for Error {
fn from(err: crate::operation::update_account_configuration::UpdateAccountConfigurationError) -> Self {
match err {
crate::operation::update_account_configuration::UpdateAccountConfigurationError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::update_account_configuration::UpdateAccountConfigurationError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::update_account_configuration::UpdateAccountConfigurationError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::update_account_configuration::UpdateAccountConfigurationError::ThrottlingException(inner) => {
Error::ThrottlingException(inner)
}
crate::operation::update_account_configuration::UpdateAccountConfigurationError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::update_account_configuration::UpdateAccountConfigurationError::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::ConflictException(inner) => inner.source(),
Error::InternalServerException(inner) => inner.source(),
Error::ResourceNotFoundException(inner) => inner.source(),
Error::ThrottlingException(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::ConflictException(e) => e.request_id(),
Self::InternalServerException(e) => e.request_id(),
Self::ResourceNotFoundException(e) => e.request_id(),
Self::ThrottlingException(e) => e.request_id(),
Self::ValidationException(e) => e.request_id(),
Self::Unhandled(e) => e.request_id(),
}
}
}