Skip to main content

aws_sdk_sts/
error_meta.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// All possible error types for this service.
3#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6    /// <p>The web identity token that was passed is expired or is not valid. Get a new identity token from the identity provider and then retry the request.</p>
7    ExpiredTokenException(crate::types::error::ExpiredTokenException),
8    /// <p>The trade-in token provided in the request has expired and can no longer be exchanged for credentials. Request a new token and retry the operation.</p>
9    ExpiredTradeInTokenException(crate::types::error::ExpiredTradeInTokenException),
10    /// <p>The request could not be fulfilled because the identity provider (IDP) that was asked to verify the incoming identity token could not be reached. This is often a transient error caused by network conditions. Retry the request a limited number of times so that you don't exceed the request rate. If the error persists, the identity provider might be down or not responding.</p>
11    IdpCommunicationErrorException(crate::types::error::IdpCommunicationErrorException),
12    /// <p>The identity provider (IdP) reported that authentication failed. This might be because the claim is invalid.</p>
13    /// <p>If this error is returned for the <code>AssumeRoleWithWebIdentity</code> operation, it can also mean that the claim has expired or has been explicitly revoked.</p>
14    IdpRejectedClaimException(crate::types::error::IdpRejectedClaimException),
15    /// <p>The request was rejected because the requested <code>DurationSeconds</code> is greater than the remaining lifetime of the calling session. <code>GetScopedCredentials</code> cannot extend a session beyond its original expiration. Request a duration that is less than or equal to the calling session's remaining lifetime, or omit <code>DurationSeconds</code> to inherit it.</p>
16    InsufficientSessionLifetimeException(crate::types::error::InsufficientSessionLifetimeException),
17    /// <p>The error returned if the message passed to <code>DecodeAuthorizationMessage</code> was invalid. This can happen if the token contains invalid characters, such as line breaks, or if the message has expired.</p>
18    InvalidAuthorizationMessageException(crate::types::error::InvalidAuthorizationMessageException),
19    /// <p>The request was rejected because the context assertion that was provided is invalid. This can happen if the context assertion supplied in the <code>ProvidedContexts</code> parameter is malformed, has expired, or does not match a trusted context provider.</p>
20    InvalidContextAssertionException(crate::types::error::InvalidContextAssertionException),
21    /// <p>The web identity token that was passed could not be validated by Amazon Web Services. Get a new identity token from the identity provider and then retry the request.</p>
22    InvalidIdentityTokenException(crate::types::error::InvalidIdentityTokenException),
23    /// <p>The request was rejected because the session used to call <code>GetScopedCredentials</code> is not a valid session. The calling session's credentials could not be validated or resolved.</p>
24    InvalidSubjectCredentialsException(crate::types::error::InvalidSubjectCredentialsException),
25    /// <p>The requested token payload size exceeds the maximum allowed size. Reduce the number of request tags included in the <code>GetWebIdentityToken</code> API call to reduce the token payload size.</p>
26    JwtPayloadSizeExceededException(crate::types::error::JwtPayloadSizeExceededException),
27    /// <p>The request was rejected because the policy document was malformed. The error message describes the specific error.</p>
28    MalformedPolicyDocumentException(crate::types::error::MalformedPolicyDocumentException),
29    /// <p>The outbound web identity federation feature is not enabled for this account. To use this feature, you must first enable it through the Amazon Web Services Management Console or API.</p>
30    OutboundWebIdentityFederationDisabledException(crate::types::error::OutboundWebIdentityFederationDisabledException),
31    /// <p>The request was rejected because the session token exceeded the maximum allowed size. The error message reports the session token size and the maximum allowed size, both in bytes. Session policies and session tags add to the session token size. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html">Passing Session Tags in STS</a> in the <i>IAM User Guide</i>.</p>
32    /// <p>You might receive this error even though you meet the individual session policy and session tag limits. Monitor <code>SessionTokenUtilization</code> to track how close the session token is to the maximum allowed size. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length">IAM and STS Entity Character Limits</a> in the <i>IAM User Guide</i>.</p>
33    PackedPolicyTooLargeException(crate::types::error::PackedPolicyTooLargeException),
34    /// <p>STS is not activated in the requested region for the account that is being asked to generate credentials. The account administrator must use the IAM console to activate STS in that region. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate">Activating and Deactivating STS in an Amazon Web Services Region</a> in the <i>IAM User Guide</i>.</p>
35    RegionDisabledException(crate::types::error::RegionDisabledException),
36    /// <p>The requested token duration would extend the session beyond its original expiration time. You cannot use this operation to extend the lifetime of a session beyond what was granted when the session was originally created.</p>
37    SessionDurationEscalationException(crate::types::error::SessionDurationEscalationException),
38    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
39    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
40    variable wildcard pattern and check `.code()`:
41     \
42    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
43     \
44    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
45    Unhandled(crate::error::sealed_unhandled::Unhandled),
46}
47impl ::std::fmt::Display for Error {
48    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
49        match self {
50            Error::ExpiredTokenException(inner) => inner.fmt(f),
51            Error::ExpiredTradeInTokenException(inner) => inner.fmt(f),
52            Error::IdpCommunicationErrorException(inner) => inner.fmt(f),
53            Error::IdpRejectedClaimException(inner) => inner.fmt(f),
54            Error::InsufficientSessionLifetimeException(inner) => inner.fmt(f),
55            Error::InvalidAuthorizationMessageException(inner) => inner.fmt(f),
56            Error::InvalidContextAssertionException(inner) => inner.fmt(f),
57            Error::InvalidIdentityTokenException(inner) => inner.fmt(f),
58            Error::InvalidSubjectCredentialsException(inner) => inner.fmt(f),
59            Error::JwtPayloadSizeExceededException(inner) => inner.fmt(f),
60            Error::MalformedPolicyDocumentException(inner) => inner.fmt(f),
61            Error::OutboundWebIdentityFederationDisabledException(inner) => inner.fmt(f),
62            Error::PackedPolicyTooLargeException(inner) => inner.fmt(f),
63            Error::RegionDisabledException(inner) => inner.fmt(f),
64            Error::SessionDurationEscalationException(inner) => inner.fmt(f),
65            Error::Unhandled(_) => {
66                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
67                    write!(f, "unhandled error ({code})")
68                } else {
69                    f.write_str("unhandled error")
70                }
71            }
72        }
73    }
74}
75impl From<::aws_smithy_types::error::operation::BuildError> for Error {
76    fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
77        Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
78            source: value.into(),
79            meta: ::std::default::Default::default(),
80        })
81    }
82}
83impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
84    fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
85        match self {
86            Self::ExpiredTokenException(inner) => inner.meta(),
87            Self::ExpiredTradeInTokenException(inner) => inner.meta(),
88            Self::IdpCommunicationErrorException(inner) => inner.meta(),
89            Self::IdpRejectedClaimException(inner) => inner.meta(),
90            Self::InsufficientSessionLifetimeException(inner) => inner.meta(),
91            Self::InvalidAuthorizationMessageException(inner) => inner.meta(),
92            Self::InvalidContextAssertionException(inner) => inner.meta(),
93            Self::InvalidIdentityTokenException(inner) => inner.meta(),
94            Self::InvalidSubjectCredentialsException(inner) => inner.meta(),
95            Self::JwtPayloadSizeExceededException(inner) => inner.meta(),
96            Self::MalformedPolicyDocumentException(inner) => inner.meta(),
97            Self::OutboundWebIdentityFederationDisabledException(inner) => inner.meta(),
98            Self::PackedPolicyTooLargeException(inner) => inner.meta(),
99            Self::RegionDisabledException(inner) => inner.meta(),
100            Self::SessionDurationEscalationException(inner) => inner.meta(),
101            Self::Unhandled(inner) => &inner.meta,
102        }
103    }
104}
105impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::assume_role::AssumeRoleError, R>> for Error
106where
107    R: Send + Sync + std::fmt::Debug + 'static,
108{
109    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::assume_role::AssumeRoleError, R>) -> Self {
110        match err {
111            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
112            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
113                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
114                source: err.into(),
115            }),
116        }
117    }
118}
119impl From<crate::operation::assume_role::AssumeRoleError> for Error {
120    fn from(err: crate::operation::assume_role::AssumeRoleError) -> Self {
121        match err {
122            crate::operation::assume_role::AssumeRoleError::ExpiredTokenException(inner) => Error::ExpiredTokenException(inner),
123            crate::operation::assume_role::AssumeRoleError::InvalidContextAssertionException(inner) => Error::InvalidContextAssertionException(inner),
124            crate::operation::assume_role::AssumeRoleError::MalformedPolicyDocumentException(inner) => Error::MalformedPolicyDocumentException(inner),
125            crate::operation::assume_role::AssumeRoleError::PackedPolicyTooLargeException(inner) => Error::PackedPolicyTooLargeException(inner),
126            crate::operation::assume_role::AssumeRoleError::RegionDisabledException(inner) => Error::RegionDisabledException(inner),
127            crate::operation::assume_role::AssumeRoleError::Unhandled(inner) => Error::Unhandled(inner),
128        }
129    }
130}
131impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::assume_role_with_saml::AssumeRoleWithSAMLError, R>> for Error
132where
133    R: Send + Sync + std::fmt::Debug + 'static,
134{
135    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::assume_role_with_saml::AssumeRoleWithSAMLError, R>) -> Self {
136        match err {
137            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
138            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
139                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
140                source: err.into(),
141            }),
142        }
143    }
144}
145impl From<crate::operation::assume_role_with_saml::AssumeRoleWithSAMLError> for Error {
146    fn from(err: crate::operation::assume_role_with_saml::AssumeRoleWithSAMLError) -> Self {
147        match err {
148            crate::operation::assume_role_with_saml::AssumeRoleWithSAMLError::ExpiredTokenException(inner) => Error::ExpiredTokenException(inner),
149            crate::operation::assume_role_with_saml::AssumeRoleWithSAMLError::IdpRejectedClaimException(inner) => {
150                Error::IdpRejectedClaimException(inner)
151            }
152            crate::operation::assume_role_with_saml::AssumeRoleWithSAMLError::InvalidIdentityTokenException(inner) => {
153                Error::InvalidIdentityTokenException(inner)
154            }
155            crate::operation::assume_role_with_saml::AssumeRoleWithSAMLError::MalformedPolicyDocumentException(inner) => {
156                Error::MalformedPolicyDocumentException(inner)
157            }
158            crate::operation::assume_role_with_saml::AssumeRoleWithSAMLError::PackedPolicyTooLargeException(inner) => {
159                Error::PackedPolicyTooLargeException(inner)
160            }
161            crate::operation::assume_role_with_saml::AssumeRoleWithSAMLError::RegionDisabledException(inner) => Error::RegionDisabledException(inner),
162            crate::operation::assume_role_with_saml::AssumeRoleWithSAMLError::Unhandled(inner) => Error::Unhandled(inner),
163        }
164    }
165}
166impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError, R>>
167    for Error
168where
169    R: Send + Sync + std::fmt::Debug + 'static,
170{
171    fn from(
172        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError, R>,
173    ) -> Self {
174        match err {
175            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
176            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
177                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
178                source: err.into(),
179            }),
180        }
181    }
182}
183impl From<crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError> for Error {
184    fn from(err: crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError) -> Self {
185        match err {
186            crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError::ExpiredTokenException(inner) => {
187                Error::ExpiredTokenException(inner)
188            }
189            crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError::IdpCommunicationErrorException(inner) => {
190                Error::IdpCommunicationErrorException(inner)
191            }
192            crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError::IdpRejectedClaimException(inner) => {
193                Error::IdpRejectedClaimException(inner)
194            }
195            crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError::InvalidIdentityTokenException(inner) => {
196                Error::InvalidIdentityTokenException(inner)
197            }
198            crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError::MalformedPolicyDocumentException(inner) => {
199                Error::MalformedPolicyDocumentException(inner)
200            }
201            crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError::PackedPolicyTooLargeException(inner) => {
202                Error::PackedPolicyTooLargeException(inner)
203            }
204            crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError::RegionDisabledException(inner) => {
205                Error::RegionDisabledException(inner)
206            }
207            crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError::Unhandled(inner) => Error::Unhandled(inner),
208        }
209    }
210}
211impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::assume_root::AssumeRootError, R>> for Error
212where
213    R: Send + Sync + std::fmt::Debug + 'static,
214{
215    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::assume_root::AssumeRootError, R>) -> Self {
216        match err {
217            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
218            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
219                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
220                source: err.into(),
221            }),
222        }
223    }
224}
225impl From<crate::operation::assume_root::AssumeRootError> for Error {
226    fn from(err: crate::operation::assume_root::AssumeRootError) -> Self {
227        match err {
228            crate::operation::assume_root::AssumeRootError::ExpiredTokenException(inner) => Error::ExpiredTokenException(inner),
229            crate::operation::assume_root::AssumeRootError::RegionDisabledException(inner) => Error::RegionDisabledException(inner),
230            crate::operation::assume_root::AssumeRootError::Unhandled(inner) => Error::Unhandled(inner),
231        }
232    }
233}
234impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::decode_authorization_message::DecodeAuthorizationMessageError, R>>
235    for Error
236where
237    R: Send + Sync + std::fmt::Debug + 'static,
238{
239    fn from(
240        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::decode_authorization_message::DecodeAuthorizationMessageError, R>,
241    ) -> Self {
242        match err {
243            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
244            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
245                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
246                source: err.into(),
247            }),
248        }
249    }
250}
251impl From<crate::operation::decode_authorization_message::DecodeAuthorizationMessageError> for Error {
252    fn from(err: crate::operation::decode_authorization_message::DecodeAuthorizationMessageError) -> Self {
253        match err {
254            crate::operation::decode_authorization_message::DecodeAuthorizationMessageError::InvalidAuthorizationMessageException(inner) => {
255                Error::InvalidAuthorizationMessageException(inner)
256            }
257            crate::operation::decode_authorization_message::DecodeAuthorizationMessageError::Unhandled(inner) => Error::Unhandled(inner),
258        }
259    }
260}
261impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_access_key_info::GetAccessKeyInfoError, R>> for Error
262where
263    R: Send + Sync + std::fmt::Debug + 'static,
264{
265    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_access_key_info::GetAccessKeyInfoError, R>) -> Self {
266        match err {
267            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
268            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
269                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
270                source: err.into(),
271            }),
272        }
273    }
274}
275impl From<crate::operation::get_access_key_info::GetAccessKeyInfoError> for Error {
276    fn from(err: crate::operation::get_access_key_info::GetAccessKeyInfoError) -> Self {
277        match err {
278            crate::operation::get_access_key_info::GetAccessKeyInfoError::Unhandled(inner) => Error::Unhandled(inner),
279        }
280    }
281}
282impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_caller_identity::GetCallerIdentityError, R>> for Error
283where
284    R: Send + Sync + std::fmt::Debug + 'static,
285{
286    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_caller_identity::GetCallerIdentityError, R>) -> Self {
287        match err {
288            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
289            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
290                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
291                source: err.into(),
292            }),
293        }
294    }
295}
296impl From<crate::operation::get_caller_identity::GetCallerIdentityError> for Error {
297    fn from(err: crate::operation::get_caller_identity::GetCallerIdentityError) -> Self {
298        match err {
299            crate::operation::get_caller_identity::GetCallerIdentityError::Unhandled(inner) => Error::Unhandled(inner),
300        }
301    }
302}
303impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_delegated_access_token::GetDelegatedAccessTokenError, R>>
304    for Error
305where
306    R: Send + Sync + std::fmt::Debug + 'static,
307{
308    fn from(
309        err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_delegated_access_token::GetDelegatedAccessTokenError, R>,
310    ) -> Self {
311        match err {
312            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
313            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
314                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
315                source: err.into(),
316            }),
317        }
318    }
319}
320impl From<crate::operation::get_delegated_access_token::GetDelegatedAccessTokenError> for Error {
321    fn from(err: crate::operation::get_delegated_access_token::GetDelegatedAccessTokenError) -> Self {
322        match err {
323            crate::operation::get_delegated_access_token::GetDelegatedAccessTokenError::ExpiredTradeInTokenException(inner) => {
324                Error::ExpiredTradeInTokenException(inner)
325            }
326            crate::operation::get_delegated_access_token::GetDelegatedAccessTokenError::PackedPolicyTooLargeException(inner) => {
327                Error::PackedPolicyTooLargeException(inner)
328            }
329            crate::operation::get_delegated_access_token::GetDelegatedAccessTokenError::RegionDisabledException(inner) => {
330                Error::RegionDisabledException(inner)
331            }
332            crate::operation::get_delegated_access_token::GetDelegatedAccessTokenError::Unhandled(inner) => Error::Unhandled(inner),
333        }
334    }
335}
336impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_federation_token::GetFederationTokenError, R>> for Error
337where
338    R: Send + Sync + std::fmt::Debug + 'static,
339{
340    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_federation_token::GetFederationTokenError, R>) -> Self {
341        match err {
342            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
343            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
344                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
345                source: err.into(),
346            }),
347        }
348    }
349}
350impl From<crate::operation::get_federation_token::GetFederationTokenError> for Error {
351    fn from(err: crate::operation::get_federation_token::GetFederationTokenError) -> Self {
352        match err {
353            crate::operation::get_federation_token::GetFederationTokenError::MalformedPolicyDocumentException(inner) => {
354                Error::MalformedPolicyDocumentException(inner)
355            }
356            crate::operation::get_federation_token::GetFederationTokenError::PackedPolicyTooLargeException(inner) => {
357                Error::PackedPolicyTooLargeException(inner)
358            }
359            crate::operation::get_federation_token::GetFederationTokenError::RegionDisabledException(inner) => Error::RegionDisabledException(inner),
360            crate::operation::get_federation_token::GetFederationTokenError::Unhandled(inner) => Error::Unhandled(inner),
361        }
362    }
363}
364impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_scoped_credentials::GetScopedCredentialsError, R>> for Error
365where
366    R: Send + Sync + std::fmt::Debug + 'static,
367{
368    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_scoped_credentials::GetScopedCredentialsError, R>) -> Self {
369        match err {
370            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
371            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
372                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
373                source: err.into(),
374            }),
375        }
376    }
377}
378impl From<crate::operation::get_scoped_credentials::GetScopedCredentialsError> for Error {
379    fn from(err: crate::operation::get_scoped_credentials::GetScopedCredentialsError) -> Self {
380        match err {
381            crate::operation::get_scoped_credentials::GetScopedCredentialsError::InsufficientSessionLifetimeException(inner) => {
382                Error::InsufficientSessionLifetimeException(inner)
383            }
384            crate::operation::get_scoped_credentials::GetScopedCredentialsError::InvalidSubjectCredentialsException(inner) => {
385                Error::InvalidSubjectCredentialsException(inner)
386            }
387            crate::operation::get_scoped_credentials::GetScopedCredentialsError::MalformedPolicyDocumentException(inner) => {
388                Error::MalformedPolicyDocumentException(inner)
389            }
390            crate::operation::get_scoped_credentials::GetScopedCredentialsError::PackedPolicyTooLargeException(inner) => {
391                Error::PackedPolicyTooLargeException(inner)
392            }
393            crate::operation::get_scoped_credentials::GetScopedCredentialsError::Unhandled(inner) => Error::Unhandled(inner),
394        }
395    }
396}
397impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_session_token::GetSessionTokenError, R>> for Error
398where
399    R: Send + Sync + std::fmt::Debug + 'static,
400{
401    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_session_token::GetSessionTokenError, R>) -> Self {
402        match err {
403            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
404            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
405                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
406                source: err.into(),
407            }),
408        }
409    }
410}
411impl From<crate::operation::get_session_token::GetSessionTokenError> for Error {
412    fn from(err: crate::operation::get_session_token::GetSessionTokenError) -> Self {
413        match err {
414            crate::operation::get_session_token::GetSessionTokenError::RegionDisabledException(inner) => Error::RegionDisabledException(inner),
415            crate::operation::get_session_token::GetSessionTokenError::Unhandled(inner) => Error::Unhandled(inner),
416        }
417    }
418}
419impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_web_identity_token::GetWebIdentityTokenError, R>> for Error
420where
421    R: Send + Sync + std::fmt::Debug + 'static,
422{
423    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_web_identity_token::GetWebIdentityTokenError, R>) -> Self {
424        match err {
425            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
426            _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
427                meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
428                source: err.into(),
429            }),
430        }
431    }
432}
433impl From<crate::operation::get_web_identity_token::GetWebIdentityTokenError> for Error {
434    fn from(err: crate::operation::get_web_identity_token::GetWebIdentityTokenError) -> Self {
435        match err {
436            crate::operation::get_web_identity_token::GetWebIdentityTokenError::JwtPayloadSizeExceededException(inner) => {
437                Error::JwtPayloadSizeExceededException(inner)
438            }
439            crate::operation::get_web_identity_token::GetWebIdentityTokenError::OutboundWebIdentityFederationDisabledException(inner) => {
440                Error::OutboundWebIdentityFederationDisabledException(inner)
441            }
442            crate::operation::get_web_identity_token::GetWebIdentityTokenError::SessionDurationEscalationException(inner) => {
443                Error::SessionDurationEscalationException(inner)
444            }
445            crate::operation::get_web_identity_token::GetWebIdentityTokenError::Unhandled(inner) => Error::Unhandled(inner),
446        }
447    }
448}
449impl ::std::error::Error for Error {
450    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
451        match self {
452            Error::ExpiredTokenException(inner) => inner.source(),
453            Error::ExpiredTradeInTokenException(inner) => inner.source(),
454            Error::IdpCommunicationErrorException(inner) => inner.source(),
455            Error::IdpRejectedClaimException(inner) => inner.source(),
456            Error::InsufficientSessionLifetimeException(inner) => inner.source(),
457            Error::InvalidAuthorizationMessageException(inner) => inner.source(),
458            Error::InvalidContextAssertionException(inner) => inner.source(),
459            Error::InvalidIdentityTokenException(inner) => inner.source(),
460            Error::InvalidSubjectCredentialsException(inner) => inner.source(),
461            Error::JwtPayloadSizeExceededException(inner) => inner.source(),
462            Error::MalformedPolicyDocumentException(inner) => inner.source(),
463            Error::OutboundWebIdentityFederationDisabledException(inner) => inner.source(),
464            Error::PackedPolicyTooLargeException(inner) => inner.source(),
465            Error::RegionDisabledException(inner) => inner.source(),
466            Error::SessionDurationEscalationException(inner) => inner.source(),
467            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
468        }
469    }
470}
471impl ::aws_types::request_id::RequestId for Error {
472    fn request_id(&self) -> Option<&str> {
473        match self {
474            Self::ExpiredTokenException(e) => e.request_id(),
475            Self::ExpiredTradeInTokenException(e) => e.request_id(),
476            Self::IdpCommunicationErrorException(e) => e.request_id(),
477            Self::IdpRejectedClaimException(e) => e.request_id(),
478            Self::InsufficientSessionLifetimeException(e) => e.request_id(),
479            Self::InvalidAuthorizationMessageException(e) => e.request_id(),
480            Self::InvalidContextAssertionException(e) => e.request_id(),
481            Self::InvalidIdentityTokenException(e) => e.request_id(),
482            Self::InvalidSubjectCredentialsException(e) => e.request_id(),
483            Self::JwtPayloadSizeExceededException(e) => e.request_id(),
484            Self::MalformedPolicyDocumentException(e) => e.request_id(),
485            Self::OutboundWebIdentityFederationDisabledException(e) => e.request_id(),
486            Self::PackedPolicyTooLargeException(e) => e.request_id(),
487            Self::RegionDisabledException(e) => e.request_id(),
488            Self::SessionDurationEscalationException(e) => e.request_id(),
489            Self::Unhandled(e) => e.meta.request_id(),
490        }
491    }
492}