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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
// 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 Amazon Web Services account doesn’t have access to this resource. </p>
    AccessDeniedException(crate::types::error::AccessDeniedException),
    /// <p>The request processing has failed because of an internal error in the service.</p>
    InternalServerException(crate::types::error::InternalServerException),
    /// <p>The resource was not found.</p>
    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
    /// <p>The service quota has been exceeded for this resource.</p>
    ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
    /// <p>The request or operation couldn't be performed because a service is throttling requests. The most common source of throttling errors is when you create resources that exceed your service limit for this resource type. Request a limit increase or delete unused resources, if possible.</p>
    ThrottlingException(crate::types::error::ThrottlingException),
    /// <p>The resource passed is invalid.</p>
    ValidationException(crate::types::error::ValidationException),
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
    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::InternalServerException(inner) => inner.fmt(f),
            Error::ResourceNotFoundException(inner) => inner.fmt(f),
            Error::ServiceQuotaExceededException(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_token_balance::BatchGetTokenBalanceError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::batch_get_token_balance::BatchGetTokenBalanceError, 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_token_balance::BatchGetTokenBalanceError> for Error {
    fn from(err: crate::operation::batch_get_token_balance::BatchGetTokenBalanceError) -> Self {
        match err {
            crate::operation::batch_get_token_balance::BatchGetTokenBalanceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
            crate::operation::batch_get_token_balance::BatchGetTokenBalanceError::InternalServerException(inner) => {
                Error::InternalServerException(inner)
            }
            crate::operation::batch_get_token_balance::BatchGetTokenBalanceError::ResourceNotFoundException(inner) => {
                Error::ResourceNotFoundException(inner)
            }
            crate::operation::batch_get_token_balance::BatchGetTokenBalanceError::ServiceQuotaExceededException(inner) => {
                Error::ServiceQuotaExceededException(inner)
            }
            crate::operation::batch_get_token_balance::BatchGetTokenBalanceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::batch_get_token_balance::BatchGetTokenBalanceError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::batch_get_token_balance::BatchGetTokenBalanceError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::get_token_balance::GetTokenBalanceError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::get_token_balance::GetTokenBalanceError, 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_token_balance::GetTokenBalanceError> for Error {
    fn from(err: crate::operation::get_token_balance::GetTokenBalanceError) -> Self {
        match err {
            crate::operation::get_token_balance::GetTokenBalanceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
            crate::operation::get_token_balance::GetTokenBalanceError::InternalServerException(inner) => Error::InternalServerException(inner),
            crate::operation::get_token_balance::GetTokenBalanceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
            crate::operation::get_token_balance::GetTokenBalanceError::ServiceQuotaExceededException(inner) => {
                Error::ServiceQuotaExceededException(inner)
            }
            crate::operation::get_token_balance::GetTokenBalanceError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::get_token_balance::GetTokenBalanceError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::get_token_balance::GetTokenBalanceError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::get_transaction::GetTransactionError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::get_transaction::GetTransactionError, 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_transaction::GetTransactionError> for Error {
    fn from(err: crate::operation::get_transaction::GetTransactionError) -> Self {
        match err {
            crate::operation::get_transaction::GetTransactionError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
            crate::operation::get_transaction::GetTransactionError::InternalServerException(inner) => Error::InternalServerException(inner),
            crate::operation::get_transaction::GetTransactionError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
            crate::operation::get_transaction::GetTransactionError::ServiceQuotaExceededException(inner) => {
                Error::ServiceQuotaExceededException(inner)
            }
            crate::operation::get_transaction::GetTransactionError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::get_transaction::GetTransactionError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::get_transaction::GetTransactionError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::list_token_balances::ListTokenBalancesError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::list_token_balances::ListTokenBalancesError, 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_token_balances::ListTokenBalancesError> for Error {
    fn from(err: crate::operation::list_token_balances::ListTokenBalancesError) -> Self {
        match err {
            crate::operation::list_token_balances::ListTokenBalancesError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
            crate::operation::list_token_balances::ListTokenBalancesError::InternalServerException(inner) => Error::InternalServerException(inner),
            crate::operation::list_token_balances::ListTokenBalancesError::ServiceQuotaExceededException(inner) => {
                Error::ServiceQuotaExceededException(inner)
            }
            crate::operation::list_token_balances::ListTokenBalancesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::list_token_balances::ListTokenBalancesError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::list_token_balances::ListTokenBalancesError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::list_transaction_events::ListTransactionEventsError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::list_transaction_events::ListTransactionEventsError, 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_transaction_events::ListTransactionEventsError> for Error {
    fn from(err: crate::operation::list_transaction_events::ListTransactionEventsError) -> Self {
        match err {
            crate::operation::list_transaction_events::ListTransactionEventsError::AccessDeniedException(inner) => {
                Error::AccessDeniedException(inner)
            }
            crate::operation::list_transaction_events::ListTransactionEventsError::InternalServerException(inner) => {
                Error::InternalServerException(inner)
            }
            crate::operation::list_transaction_events::ListTransactionEventsError::ServiceQuotaExceededException(inner) => {
                Error::ServiceQuotaExceededException(inner)
            }
            crate::operation::list_transaction_events::ListTransactionEventsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::list_transaction_events::ListTransactionEventsError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::list_transaction_events::ListTransactionEventsError::Unhandled(inner) => Error::Unhandled(inner),
        }
    }
}
impl<R> From<::aws_smithy_http::result::SdkError<crate::operation::list_transactions::ListTransactionsError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: ::aws_smithy_http::result::SdkError<crate::operation::list_transactions::ListTransactionsError, 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_transactions::ListTransactionsError> for Error {
    fn from(err: crate::operation::list_transactions::ListTransactionsError) -> Self {
        match err {
            crate::operation::list_transactions::ListTransactionsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
            crate::operation::list_transactions::ListTransactionsError::InternalServerException(inner) => Error::InternalServerException(inner),
            crate::operation::list_transactions::ListTransactionsError::ServiceQuotaExceededException(inner) => {
                Error::ServiceQuotaExceededException(inner)
            }
            crate::operation::list_transactions::ListTransactionsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
            crate::operation::list_transactions::ListTransactionsError::ValidationException(inner) => Error::ValidationException(inner),
            crate::operation::list_transactions::ListTransactionsError::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::InternalServerException(inner) => inner.source(),
            Error::ResourceNotFoundException(inner) => inner.source(),
            Error::ServiceQuotaExceededException(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::InternalServerException(e) => e.request_id(),
            Self::ResourceNotFoundException(e) => e.request_id(),
            Self::ServiceQuotaExceededException(e) => e.request_id(),
            Self::ThrottlingException(e) => e.request_id(),
            Self::ValidationException(e) => e.request_id(),
            Self::Unhandled(e) => e.request_id(),
        }
    }
}