Skip to main content

aws_sdk_sts/operation/
assume_role_with_web_identity.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `AssumeRoleWithWebIdentity`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct AssumeRoleWithWebIdentity;
6impl AssumeRoleWithWebIdentity {
7    /// Creates a new `AssumeRoleWithWebIdentity`
8    pub fn new() -> Self {
9        Self
10    }
11    pub(crate) async fn orchestrate(
12                        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
13                        input: crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityInput,
14                    ) -> ::std::result::Result<crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
15                        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<::aws_smithy_runtime_api::client::interceptors::context::Error, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>| {
16                            err.map_service_error(|err| {
17                                err.downcast::<crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError>().expect("correct error type")
18                            })
19                        };
20                        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
21                            .await
22                            .map_err(map_err)?;
23                        let output = context.finalize().map_err(map_err)?;
24                        ::std::result::Result::Ok(output.downcast::<crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityOutput>().expect("correct output type"))
25                    }
26
27                    pub(crate) async fn orchestrate_with_stop_point(
28                        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
29                        input: crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityInput,
30                        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
31                    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, ::aws_smithy_runtime_api::client::result::SdkError<::aws_smithy_runtime_api::client::interceptors::context::Error, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
32                        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
33                        use ::tracing::Instrument;
34                        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
35                            "STS",
36                            "AssumeRoleWithWebIdentity",
37                            input,
38                            runtime_plugins,
39                            stop_point
40                        )
41                        // Create a parent span for the entire operation. Includes a random, internal-only,
42                        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
43                        .instrument(::tracing::debug_span!(
44                                "STS.AssumeRoleWithWebIdentity",
45                                "rpc.service" = "STS",
46                                "rpc.method" = "AssumeRoleWithWebIdentity",
47                                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
48                                "rpc.system" = "aws-api",
49                            ))
50                        .await
51                    }
52
53                    pub(crate) fn operation_runtime_plugins(
54                        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
55                        client_config: &crate::config::Config,
56                        config_override: ::std::option::Option<crate::config::Builder>,
57                    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
58                        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
59
60                        if let ::std::option::Option::Some(config_override) = config_override {
61                            for plugin in config_override.runtime_plugins.iter().cloned() {
62                                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
63                            }
64                            runtime_plugins = runtime_plugins.with_operation_plugin(
65                                crate::config::ConfigOverrideRuntimePlugin::new(config_override, client_config.config.clone(), &client_config.runtime_components)
66                            );
67                        }
68                        runtime_plugins
69                    }
70}
71impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for AssumeRoleWithWebIdentity {
72                fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
73                    let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AssumeRoleWithWebIdentity");
74
75                    cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(AssumeRoleWithWebIdentityRequestSerializer));
76                    cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(AssumeRoleWithWebIdentityResponseDeserializer));
77
78                    cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
79                        crate::config::auth::Params::builder()
80                            .operation_name("AssumeRoleWithWebIdentity")
81                            .build()
82                            .expect("required fields set")
83                    ));
84
85                    cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
86cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
87                            "AssumeRoleWithWebIdentity",
88                            "STS",
89                        ));
90
91                    ::std::option::Option::Some(cfg.freeze())
92                }
93
94                fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
95                    #[allow(unused_mut)]
96                    let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("AssumeRoleWithWebIdentity")
97                            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(AssumeRoleWithWebIdentityTelemetryInputCaptureInterceptor))
98.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()))
99.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(AssumeRoleWithWebIdentityEndpointParamsInterceptor))
100                            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError>::new())
101.with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError>::new())
102.with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError>::builder().transient_errors({
103                                            let mut transient_errors: Vec<&'static str> = ::aws_runtime::retries::classifiers::TRANSIENT_ERRORS.into();
104                                            transient_errors.push("IDPCommunicationError");
105                                            ::std::borrow::Cow::Owned(transient_errors)
106                                            }).build());
107
108                    ::std::borrow::Cow::Owned(rcb)
109                }
110            }
111
112            #[derive(Debug)]
113            struct AssumeRoleWithWebIdentityTelemetryInputCaptureInterceptor;
114
115            #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
116            impl ::aws_smithy_runtime_api::client::interceptors::Intercept for AssumeRoleWithWebIdentityTelemetryInputCaptureInterceptor {
117                fn name(&self) -> &'static str {
118                    "AssumeRoleWithWebIdentityTelemetryInputCaptureInterceptor"
119                }
120
121                fn read_before_execution(
122                    &self,
123                    context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<'_, ::aws_smithy_runtime_api::client::interceptors::context::Input, ::aws_smithy_runtime_api::client::interceptors::context::Output, ::aws_smithy_runtime_api::client::interceptors::context::Error>,
124                    cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
125                ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
126                    // Nothing to do unless the customer opted in by naming members to record.
127                    let ::std::option::Option::Some(requested) = cfg.load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>().filter(|r| !r.is_empty()) else {
128                        return ::std::result::Result::Ok(());
129                    };
130
131                    let ::std::option::Option::Some(input) = context.input().downcast_ref::<AssumeRoleWithWebIdentityInput>() else {
132                        // A mismatched input is not this interceptor's concern; skip quietly.
133                        return ::std::result::Result::Ok(());
134                    };
135
136                    let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
137                    if requested.should_capture("RoleArn") {
138                        if let ::std::option::Option::Some(value) = input.role_arn.as_deref() {
139                            captured.insert("RoleArn", value);
140                        }
141                    }
142if requested.should_capture("RoleSessionName") {
143                        if let ::std::option::Option::Some(value) = input.role_session_name.as_deref() {
144                            captured.insert("RoleSessionName", value);
145                        }
146                    }
147if requested.should_capture("ProviderId") {
148                        if let ::std::option::Option::Some(value) = input.provider_id.as_deref() {
149                            captured.insert("ProviderId", value);
150                        }
151                    }
152if requested.should_capture("Policy") {
153                        if let ::std::option::Option::Some(value) = input.policy.as_deref() {
154                            captured.insert("Policy", value);
155                        }
156                    }
157
158                    cfg.interceptor_state().store_put(captured);
159                    ::std::result::Result::Ok(())
160                }
161            }
162#[derive(Debug)]
163            struct AssumeRoleWithWebIdentityResponseDeserializer;
164            impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for AssumeRoleWithWebIdentityResponseDeserializer {
165
166
167                fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
168                    let (success, status) = (response.status().is_success(), response.status().as_u16());
169            let headers = response.headers();
170            let body = response.body().bytes().expect("body loaded");
171            #[allow(unused_mut)]
172            let mut force_error = false;
173            ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
174            let parse_result = if !success && status != 200 || force_error {
175                crate::protocol_serde::shape_assume_role_with_web_identity::de_assume_role_with_web_identity_http_error(status, headers, body)
176            } else {
177                crate::protocol_serde::shape_assume_role_with_web_identity::de_assume_role_with_web_identity_http_response(status, headers, body)
178            };
179            crate::protocol_serde::type_erase_result(parse_result)
180                }
181            }
182#[derive(Debug)]
183            struct AssumeRoleWithWebIdentityRequestSerializer;
184            impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for AssumeRoleWithWebIdentityRequestSerializer {
185                #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
186                fn serialize_input(&self, input: ::aws_smithy_runtime_api::client::interceptors::context::Input, _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
187                    let input = input.downcast::<crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityInput>().expect("correct type");
188                    let _header_serialization_settings = _cfg.load::<crate::serialization_settings::HeaderSerializationSettings>().cloned().unwrap_or_default();
189                    let mut request_builder = {
190                        #[allow(clippy::uninlined_format_args)]
191fn uri_base(_input: &crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
192    use ::std::fmt::Write as _;
193    ::std::write!(output, "/").expect("formatting should succeed");
194    ::std::result::Result::Ok(())
195}
196#[allow(clippy::unnecessary_wraps)]
197fn update_http_builder(
198                input: &crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityInput,
199                builder: ::http_1x::request::Builder
200            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
201    let mut uri = ::std::string::String::new();
202    uri_base(input, &mut uri)?;
203    ::std::result::Result::Ok(builder.method("POST").uri(uri))
204}
205let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
206builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-www-form-urlencoded");
207builder
208                    };
209                    let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_assume_role_with_web_identity_input::ser_assume_role_with_web_identity_input_input_input(&input)?);
210                    if let Some(content_length) = body.content_length() {
211                                let content_length = content_length.to_string();
212                                request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
213                            }
214                    ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
215                }
216            }
217#[derive(Debug)]
218            struct AssumeRoleWithWebIdentityEndpointParamsInterceptor;
219
220            #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
221            impl ::aws_smithy_runtime_api::client::interceptors::Intercept for AssumeRoleWithWebIdentityEndpointParamsInterceptor {
222                fn name(&self) -> &'static str {
223                    "AssumeRoleWithWebIdentityEndpointParamsInterceptor"
224                }
225
226                fn read_before_execution(
227                    &self,
228                    context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<'_, ::aws_smithy_runtime_api::client::interceptors::context::Input, ::aws_smithy_runtime_api::client::interceptors::context::Output, ::aws_smithy_runtime_api::client::interceptors::context::Error>,
229                    cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
230                ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
231                    let _input = context.input()
232                        .downcast_ref::<AssumeRoleWithWebIdentityInput>()
233                        .ok_or("failed to downcast to AssumeRoleWithWebIdentityInput")?;
234
235
236
237                    let params = crate::config::endpoint::Params::builder()
238                        .set_region(cfg.load::<::aws_types::region::Region>().map(|r|r.as_ref().to_owned()))
239.set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
240.set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
241.set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
242                        .build()
243                        .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?;
244                    cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
245                    ::std::result::Result::Ok(())
246                }
247            }
248
249            // The get_* functions below are generated from JMESPath expressions in the
250            // operationContextParams trait. They target the operation's input shape.
251
252
253
254/// Error type for the `AssumeRoleWithWebIdentityError` operation.
255#[non_exhaustive]
256#[derive(::std::fmt::Debug)]
257pub enum AssumeRoleWithWebIdentityError {
258    /// <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>
259    ExpiredTokenException(crate::types::error::ExpiredTokenException),
260    /// <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>
261    IdpCommunicationErrorException(crate::types::error::IdpCommunicationErrorException),
262    /// <p>The identity provider (IdP) reported that authentication failed. This might be because the claim is invalid.</p>
263    /// <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>
264    IdpRejectedClaimException(crate::types::error::IdpRejectedClaimException),
265    /// <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>
266    InvalidIdentityTokenException(crate::types::error::InvalidIdentityTokenException),
267    /// <p>The request was rejected because the policy document was malformed. The error message describes the specific error.</p>
268    MalformedPolicyDocumentException(crate::types::error::MalformedPolicyDocumentException),
269    /// <p>The request was rejected because the total packed size of the session policies and session tags combined was too large. An Amazon Web Services conversion compresses the session policy document, session policy ARNs, and session tags into a packed binary format that has a separate limit. The error message indicates by percentage how close the policies and tags are to the upper size limit. 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>
270    /// <p>You could receive this error even though you meet other defined session policy and session tag limits. 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>
271    PackedPolicyTooLargeException(crate::types::error::PackedPolicyTooLargeException),
272    /// <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>
273    RegionDisabledException(crate::types::error::RegionDisabledException),
274    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
275                    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
276    variable wildcard pattern and check `.code()`:
277     \
278    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
279     \
280    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-AssumeRoleWithWebIdentityError) for what information is available for the error.")]
281                    Unhandled(crate::error::sealed_unhandled::Unhandled),
282}
283impl AssumeRoleWithWebIdentityError {
284    /// Creates the `AssumeRoleWithWebIdentityError::Unhandled` variant from any error type.
285                    pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>) -> Self {
286                        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() })
287                    }
288
289                    /// Creates the `AssumeRoleWithWebIdentityError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
290                    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
291                        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err })
292                    }
293    ///
294    /// Returns error metadata, which includes the error code, message,
295    /// request ID, and potentially additional information.
296    ///
297    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
298        match self {
299            Self::ExpiredTokenException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
300            Self::IdpCommunicationErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
301            Self::IdpRejectedClaimException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
302            Self::InvalidIdentityTokenException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
303            Self::MalformedPolicyDocumentException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
304            Self::PackedPolicyTooLargeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
305            Self::RegionDisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
306            Self::Unhandled(e) => &e.meta,
307        }
308    }
309    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::ExpiredTokenException`.
310    pub fn is_expired_token_exception(&self) -> bool {
311        matches!(self, Self::ExpiredTokenException(_))
312    }
313    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::IdpCommunicationErrorException`.
314    pub fn is_idp_communication_error_exception(&self) -> bool {
315        matches!(self, Self::IdpCommunicationErrorException(_))
316    }
317    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::IdpRejectedClaimException`.
318    pub fn is_idp_rejected_claim_exception(&self) -> bool {
319        matches!(self, Self::IdpRejectedClaimException(_))
320    }
321    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::InvalidIdentityTokenException`.
322    pub fn is_invalid_identity_token_exception(&self) -> bool {
323        matches!(self, Self::InvalidIdentityTokenException(_))
324    }
325    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::MalformedPolicyDocumentException`.
326    pub fn is_malformed_policy_document_exception(&self) -> bool {
327        matches!(self, Self::MalformedPolicyDocumentException(_))
328    }
329    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::PackedPolicyTooLargeException`.
330    pub fn is_packed_policy_too_large_exception(&self) -> bool {
331        matches!(self, Self::PackedPolicyTooLargeException(_))
332    }
333    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::RegionDisabledException`.
334    pub fn is_region_disabled_exception(&self) -> bool {
335        matches!(self, Self::RegionDisabledException(_))
336    }
337}
338impl ::std::error::Error for AssumeRoleWithWebIdentityError {
339    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
340        match self {
341            Self::ExpiredTokenException(_inner) =>
342            ::std::option::Option::Some(_inner)
343            ,
344            Self::IdpCommunicationErrorException(_inner) =>
345            ::std::option::Option::Some(_inner)
346            ,
347            Self::IdpRejectedClaimException(_inner) =>
348            ::std::option::Option::Some(_inner)
349            ,
350            Self::InvalidIdentityTokenException(_inner) =>
351            ::std::option::Option::Some(_inner)
352            ,
353            Self::MalformedPolicyDocumentException(_inner) =>
354            ::std::option::Option::Some(_inner)
355            ,
356            Self::PackedPolicyTooLargeException(_inner) =>
357            ::std::option::Option::Some(_inner)
358            ,
359            Self::RegionDisabledException(_inner) =>
360            ::std::option::Option::Some(_inner)
361            ,
362            Self::Unhandled(_inner) => {
363                ::std::option::Option::Some(&*_inner.source)
364            }
365        }
366    }
367}
368impl ::std::fmt::Display for AssumeRoleWithWebIdentityError {
369    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
370        match self {
371            Self::ExpiredTokenException(_inner) =>
372            _inner.fmt(f)
373            ,
374            Self::IdpCommunicationErrorException(_inner) =>
375            _inner.fmt(f)
376            ,
377            Self::IdpRejectedClaimException(_inner) =>
378            _inner.fmt(f)
379            ,
380            Self::InvalidIdentityTokenException(_inner) =>
381            _inner.fmt(f)
382            ,
383            Self::MalformedPolicyDocumentException(_inner) =>
384            _inner.fmt(f)
385            ,
386            Self::PackedPolicyTooLargeException(_inner) =>
387            _inner.fmt(f)
388            ,
389            Self::RegionDisabledException(_inner) =>
390            _inner.fmt(f)
391            ,
392            Self::Unhandled(_inner) => {
393                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
394                                                        write!(f, "unhandled error ({code})")
395                                                    } else {
396                                                        f.write_str("unhandled error")
397                                                    }
398            }
399        }
400    }
401}
402impl ::aws_smithy_types::retry::ProvideErrorKind for AssumeRoleWithWebIdentityError {
403    fn code(&self) -> ::std::option::Option<&str> {
404        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
405    }
406    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
407        match self {
408            Self::IdpCommunicationErrorException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()),
409            _ => ::std::option::Option::None
410        }
411    }
412}
413impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for AssumeRoleWithWebIdentityError {
414    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
415        match self {
416            Self::ExpiredTokenException(_inner) =>
417            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
418            ,
419            Self::IdpCommunicationErrorException(_inner) =>
420            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
421            ,
422            Self::IdpRejectedClaimException(_inner) =>
423            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
424            ,
425            Self::InvalidIdentityTokenException(_inner) =>
426            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
427            ,
428            Self::MalformedPolicyDocumentException(_inner) =>
429            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
430            ,
431            Self::PackedPolicyTooLargeException(_inner) =>
432            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
433            ,
434            Self::RegionDisabledException(_inner) =>
435            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
436            ,
437            Self::Unhandled(_inner) => {
438                &_inner.meta
439            }
440        }
441    }
442}
443impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for AssumeRoleWithWebIdentityError {
444    fn create_unhandled_error(
445                        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
446                        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>
447                    ) -> Self {
448        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source, meta: meta.unwrap_or_default() })
449    }
450}
451impl ::aws_types::request_id::RequestId for crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError {
452                                fn request_id(&self) -> Option<&str> {
453                                    self.meta().request_id()
454                                }
455                            }
456
457pub use crate::operation::assume_role_with_web_identity::_assume_role_with_web_identity_input::AssumeRoleWithWebIdentityInput;
458
459pub use crate::operation::assume_role_with_web_identity::_assume_role_with_web_identity_output::AssumeRoleWithWebIdentityOutput;
460
461mod _assume_role_with_web_identity_input;
462
463mod _assume_role_with_web_identity_output;
464
465/// Builders
466pub mod builders;
467