1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// 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 {
    /// The server response for authorization failure.
    AccessDeniedError(crate::error::AccessDeniedError),
    /// The server cannot process the request due to an apparent client error.
    BadRequestError(crate::error::BadRequestError),
    /// The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
    GatewayTimeoutError(crate::error::GatewayTimeoutError),
    /// The server response when an unexpected error occurred while processing request.
    InternalFailureError(crate::error::InternalFailureError),
    /// The server response when the requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.
    NotAcceptableError(crate::error::NotAcceptableError),
    /// The server response for the usage plan quota exceeded error.
    QuotaExceededError(crate::error::QuotaExceededError),
    /// The server response for the request too large error.
    RequestTooLargeError(crate::error::RequestTooLargeError),
    /// The server could not process the request because of conflict in the current state of the resource.
    ResourceConflictError(crate::error::ResourceConflictError),
    /// The server response when the specified resource cannot be found after an API request passes authentication and authorization.
    ResourceNotFoundError(crate::error::ResourceNotFoundError),
    /// The server response when attempting to serialize the request.
    SerializationError(crate::error::SerializationError),
    /// The server cannot handle the request due to technical reasons.
    ServiceUnavailableError(crate::error::ServiceUnavailableError),
    /// The server response when usage plan or account-level throttling limits exceeded.
    ThrottlingError(crate::error::ThrottlingError),
    /// The server response when the authorizer failed to authenticate the caller.
    UnauthorizedError(crate::error::UnauthorizedError),
    /// The server response when the operation specified could not be found.
    UnknownOperationError(crate::error::UnknownOperationError),
    /// The Stedi account has not been granted permission for this particular service.
    UnmappedError(crate::error::UnmappedError),
    /// The server response when a payload is of an unsupported media type.
    UnsupportedMediaTypeError(crate::error::UnsupportedMediaTypeError),
    /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
    ValidationError(crate::error::ValidationError),
    ///
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
    ///
    /// When logging an error from the SDK, it is recommended that you either wrap the error in
    /// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
    /// error reporter library that visits the error's cause/source chain, or call
    /// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
    ///
    Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for Error {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            Error::AccessDeniedError(inner) => inner.fmt(f),
            Error::BadRequestError(inner) => inner.fmt(f),
            Error::GatewayTimeoutError(inner) => inner.fmt(f),
            Error::InternalFailureError(inner) => inner.fmt(f),
            Error::NotAcceptableError(inner) => inner.fmt(f),
            Error::QuotaExceededError(inner) => inner.fmt(f),
            Error::RequestTooLargeError(inner) => inner.fmt(f),
            Error::ResourceConflictError(inner) => inner.fmt(f),
            Error::ResourceNotFoundError(inner) => inner.fmt(f),
            Error::SerializationError(inner) => inner.fmt(f),
            Error::ServiceUnavailableError(inner) => inner.fmt(f),
            Error::ThrottlingError(inner) => inner.fmt(f),
            Error::UnauthorizedError(inner) => inner.fmt(f),
            Error::UnknownOperationError(inner) => inner.fmt(f),
            Error::UnmappedError(inner) => inner.fmt(f),
            Error::UnsupportedMediaTypeError(inner) => inner.fmt(f),
            Error::ValidationError(inner) => inner.fmt(f),
            Error::Unhandled(inner) => inner.fmt(f),
        }
    }
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::GetTokenForIAMError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: aws_smithy_http::result::SdkError<crate::error::GetTokenForIAMError, R>) -> Self {
        match err {
            aws_smithy_http::result::SdkError::ServiceError(context) => {
                Self::from(context.into_err())
            }
            _ => Error::Unhandled(crate::error::Unhandled::new(err.into())),
        }
    }
}
impl From<crate::error::GetTokenForIAMError> for Error {
    fn from(err: crate::error::GetTokenForIAMError) -> Self {
        match err.kind {
            crate::error::GetTokenForIAMErrorKind::AccessDeniedError(inner) => {
                Error::AccessDeniedError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::BadRequestError(inner) => {
                Error::BadRequestError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::GatewayTimeoutError(inner) => {
                Error::GatewayTimeoutError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::InternalFailureError(inner) => {
                Error::InternalFailureError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::NotAcceptableError(inner) => {
                Error::NotAcceptableError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::QuotaExceededError(inner) => {
                Error::QuotaExceededError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::RequestTooLargeError(inner) => {
                Error::RequestTooLargeError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::ResourceConflictError(inner) => {
                Error::ResourceConflictError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::ResourceNotFoundError(inner) => {
                Error::ResourceNotFoundError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::SerializationError(inner) => {
                Error::SerializationError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::ServiceUnavailableError(inner) => {
                Error::ServiceUnavailableError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::ThrottlingError(inner) => {
                Error::ThrottlingError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::UnauthorizedError(inner) => {
                Error::UnauthorizedError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::UnknownOperationError(inner) => {
                Error::UnknownOperationError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::UnmappedError(inner) => {
                Error::UnmappedError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::UnsupportedMediaTypeError(inner) => {
                Error::UnsupportedMediaTypeError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::ValidationError(inner) => {
                Error::ValidationError(inner)
            }
            crate::error::GetTokenForIAMErrorKind::Unhandled(inner) => {
                Error::Unhandled(crate::error::Unhandled::new(inner.into()))
            }
        }
    }
}
impl std::error::Error for Error {}