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.with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError>::new());
108
109                    ::std::borrow::Cow::Owned(rcb)
110                }
111            }
112
113            #[derive(Debug)]
114            struct AssumeRoleWithWebIdentityTelemetryInputCaptureInterceptor;
115
116            #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
117            impl ::aws_smithy_runtime_api::client::interceptors::Intercept for AssumeRoleWithWebIdentityTelemetryInputCaptureInterceptor {
118                fn name(&self) -> &'static str {
119                    "AssumeRoleWithWebIdentityTelemetryInputCaptureInterceptor"
120                }
121
122                fn read_before_execution(
123                    &self,
124                    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>,
125                    cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
126                ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
127                    // Nothing to do unless the customer opted in by naming members to record.
128                    let ::std::option::Option::Some(requested) = cfg.load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>().filter(|r| !r.is_empty()) else {
129                        return ::std::result::Result::Ok(());
130                    };
131
132                    let ::std::option::Option::Some(input) = context.input().downcast_ref::<AssumeRoleWithWebIdentityInput>() else {
133                        // A mismatched input is not this interceptor's concern; skip quietly.
134                        return ::std::result::Result::Ok(());
135                    };
136
137                    let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
138                    if requested.should_capture("RoleArn") {
139                            if let ::std::option::Option::Some(value) = input.role_arn.as_deref() {
140                                captured.insert("RoleArn", value);
141                            }
142                        }
143if requested.should_capture("RoleSessionName") {
144                            if let ::std::option::Option::Some(value) = input.role_session_name.as_deref() {
145                                captured.insert("RoleSessionName", value);
146                            }
147                        }
148if requested.should_capture("ProviderId") {
149                            if let ::std::option::Option::Some(value) = input.provider_id.as_deref() {
150                                captured.insert("ProviderId", value);
151                            }
152                        }
153if requested.should_capture("Policy") {
154                            if let ::std::option::Option::Some(value) = input.policy.as_deref() {
155                                captured.insert("Policy", value);
156                            }
157                        }
158
159                    cfg.interceptor_state().store_put(captured);
160                    ::std::result::Result::Ok(())
161                }
162            }
163#[derive(Debug)]
164            struct AssumeRoleWithWebIdentityResponseDeserializer;
165            impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for AssumeRoleWithWebIdentityResponseDeserializer {
166
167
168                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 {
169                    let (success, status) = (response.status().is_success(), response.status().as_u16());
170            let headers = response.headers();
171            let body = response.body().bytes().expect("body loaded");
172            #[allow(unused_mut)]
173            let mut force_error = false;
174            ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
175            let parse_result = if !success && status != 200 || force_error {
176                crate::protocol_serde::shape_assume_role_with_web_identity::de_assume_role_with_web_identity_http_error(status, headers, body, _cfg)
177            } else {
178                crate::protocol_serde::shape_assume_role_with_web_identity::de_assume_role_with_web_identity_http_response(status, headers, body, _cfg)
179            };
180            crate::protocol_serde::type_erase_result(parse_result)
181                }
182            }
183#[derive(Debug)]
184            struct AssumeRoleWithWebIdentityRequestSerializer;
185            impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for AssumeRoleWithWebIdentityRequestSerializer {
186                #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
187                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> {
188                    let input = input.downcast::<crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityInput>().expect("correct type");
189                    let _header_serialization_settings = _cfg.load::<crate::serialization_settings::HeaderSerializationSettings>().cloned().unwrap_or_default();
190                    let mut request_builder = {
191                        #[allow(clippy::uninlined_format_args)]
192fn 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> {
193    use ::std::fmt::Write as _;
194    ::std::write!(output, "/").expect("formatting should succeed");
195    ::std::result::Result::Ok(())
196}
197#[allow(clippy::unnecessary_wraps)]
198fn update_http_builder(
199                input: &crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityInput,
200                builder: ::http_1x::request::Builder
201            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
202    let mut uri = ::std::string::String::new();
203    uri_base(input, &mut uri)?;
204    ::std::result::Result::Ok(builder.method("POST").uri(uri))
205}
206let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
207builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-www-form-urlencoded");
208builder
209                    };
210                    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)?);
211                    if let Some(content_length) = body.content_length() {
212                                let content_length = content_length.to_string();
213                                request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
214                            }
215                    ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
216                }
217            }
218#[derive(Debug)]
219            struct AssumeRoleWithWebIdentityEndpointParamsInterceptor;
220
221            #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
222            impl ::aws_smithy_runtime_api::client::interceptors::Intercept for AssumeRoleWithWebIdentityEndpointParamsInterceptor {
223                fn name(&self) -> &'static str {
224                    "AssumeRoleWithWebIdentityEndpointParamsInterceptor"
225                }
226
227                fn read_before_execution(
228                    &self,
229                    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>,
230                    cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
231                ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
232                    let _input = context.input()
233                        .downcast_ref::<AssumeRoleWithWebIdentityInput>()
234                        .ok_or("failed to downcast to AssumeRoleWithWebIdentityInput")?;
235
236
237
238                    let params = crate::config::endpoint::Params::builder()
239                        .set_region(cfg.load::<::aws_types::region::Region>().map(|r|r.as_ref().to_owned()))
240.set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
241.set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
242.set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
243                        .build()
244                        .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?;
245                    cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
246                    ::std::result::Result::Ok(())
247                }
248            }
249
250            // The get_* functions below are generated from JMESPath expressions in the
251            // operationContextParams trait. They target the operation's input shape.
252
253
254
255/// Error type for the `AssumeRoleWithWebIdentityError` operation.
256#[non_exhaustive]
257#[derive(::std::fmt::Debug)]
258pub enum AssumeRoleWithWebIdentityError {
259    /// <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>
260    ExpiredTokenException(crate::types::error::ExpiredTokenException),
261    /// <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>
262    IdpCommunicationErrorException(crate::types::error::IdpCommunicationErrorException),
263    /// <p>The identity provider (IdP) reported that authentication failed. This might be because the claim is invalid.</p>
264    /// <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>
265    IdpRejectedClaimException(crate::types::error::IdpRejectedClaimException),
266    /// <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>
267    InvalidIdentityTokenException(crate::types::error::InvalidIdentityTokenException),
268    /// <p>The request was rejected because the policy document was malformed. The error message describes the specific error.</p>
269    MalformedPolicyDocumentException(crate::types::error::MalformedPolicyDocumentException),
270    /// <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>
271    /// <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>
272    PackedPolicyTooLargeException(crate::types::error::PackedPolicyTooLargeException),
273    /// <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>
274    RegionDisabledException(crate::types::error::RegionDisabledException),
275    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
276                    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
277    variable wildcard pattern and check `.code()`:
278     \
279    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
280     \
281    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-AssumeRoleWithWebIdentityError) for what information is available for the error.")]
282                    Unhandled(crate::error::sealed_unhandled::Unhandled),
283}
284impl AssumeRoleWithWebIdentityError {
285    /// Creates the `AssumeRoleWithWebIdentityError::Unhandled` variant from any error type.
286                    pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>) -> Self {
287                        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() })
288                    }
289
290                    /// Creates the `AssumeRoleWithWebIdentityError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
291                    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
292                        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err })
293                    }
294    ///
295    /// Returns error metadata, which includes the error code, message,
296    /// request ID, and potentially additional information.
297    ///
298    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
299        match self {
300            Self::ExpiredTokenException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
301            Self::IdpCommunicationErrorException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
302            Self::IdpRejectedClaimException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
303            Self::InvalidIdentityTokenException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
304            Self::MalformedPolicyDocumentException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
305            Self::PackedPolicyTooLargeException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
306            Self::RegionDisabledException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
307            Self::Unhandled(e) => &e.meta,
308        }
309    }
310    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::ExpiredTokenException`.
311    pub fn is_expired_token_exception(&self) -> bool {
312        matches!(self, Self::ExpiredTokenException(_))
313    }
314    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::IdpCommunicationErrorException`.
315    pub fn is_idp_communication_error_exception(&self) -> bool {
316        matches!(self, Self::IdpCommunicationErrorException(_))
317    }
318    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::IdpRejectedClaimException`.
319    pub fn is_idp_rejected_claim_exception(&self) -> bool {
320        matches!(self, Self::IdpRejectedClaimException(_))
321    }
322    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::InvalidIdentityTokenException`.
323    pub fn is_invalid_identity_token_exception(&self) -> bool {
324        matches!(self, Self::InvalidIdentityTokenException(_))
325    }
326    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::MalformedPolicyDocumentException`.
327    pub fn is_malformed_policy_document_exception(&self) -> bool {
328        matches!(self, Self::MalformedPolicyDocumentException(_))
329    }
330    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::PackedPolicyTooLargeException`.
331    pub fn is_packed_policy_too_large_exception(&self) -> bool {
332        matches!(self, Self::PackedPolicyTooLargeException(_))
333    }
334    /// Returns `true` if the error kind is `AssumeRoleWithWebIdentityError::RegionDisabledException`.
335    pub fn is_region_disabled_exception(&self) -> bool {
336        matches!(self, Self::RegionDisabledException(_))
337    }
338}
339impl ::std::error::Error for AssumeRoleWithWebIdentityError {
340    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
341        match self {
342            Self::ExpiredTokenException(_inner) =>
343            ::std::option::Option::Some(_inner)
344            ,
345            Self::IdpCommunicationErrorException(_inner) =>
346            ::std::option::Option::Some(_inner)
347            ,
348            Self::IdpRejectedClaimException(_inner) =>
349            ::std::option::Option::Some(_inner)
350            ,
351            Self::InvalidIdentityTokenException(_inner) =>
352            ::std::option::Option::Some(_inner)
353            ,
354            Self::MalformedPolicyDocumentException(_inner) =>
355            ::std::option::Option::Some(_inner)
356            ,
357            Self::PackedPolicyTooLargeException(_inner) =>
358            ::std::option::Option::Some(_inner)
359            ,
360            Self::RegionDisabledException(_inner) =>
361            ::std::option::Option::Some(_inner)
362            ,
363            Self::Unhandled(_inner) => {
364                ::std::option::Option::Some(&*_inner.source)
365            }
366        }
367    }
368}
369impl ::std::fmt::Display for AssumeRoleWithWebIdentityError {
370    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
371        match self {
372            Self::ExpiredTokenException(_inner) =>
373            _inner.fmt(f)
374            ,
375            Self::IdpCommunicationErrorException(_inner) =>
376            _inner.fmt(f)
377            ,
378            Self::IdpRejectedClaimException(_inner) =>
379            _inner.fmt(f)
380            ,
381            Self::InvalidIdentityTokenException(_inner) =>
382            _inner.fmt(f)
383            ,
384            Self::MalformedPolicyDocumentException(_inner) =>
385            _inner.fmt(f)
386            ,
387            Self::PackedPolicyTooLargeException(_inner) =>
388            _inner.fmt(f)
389            ,
390            Self::RegionDisabledException(_inner) =>
391            _inner.fmt(f)
392            ,
393            Self::Unhandled(_inner) => {
394                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
395                                                        write!(f, "unhandled error ({code})")
396                                                    } else {
397                                                        f.write_str("unhandled error")
398                                                    }
399            }
400        }
401    }
402}
403impl ::aws_smithy_types::retry::ProvideErrorKind for AssumeRoleWithWebIdentityError {
404    fn code(&self) -> ::std::option::Option<&str> {
405        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
406    }
407    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
408        match self {
409            Self::IdpCommunicationErrorException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()),
410            _ => ::std::option::Option::None
411        }
412    }
413}
414impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for AssumeRoleWithWebIdentityError {
415    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
416        match self {
417            Self::ExpiredTokenException(_inner) =>
418            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
419            ,
420            Self::IdpCommunicationErrorException(_inner) =>
421            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
422            ,
423            Self::IdpRejectedClaimException(_inner) =>
424            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
425            ,
426            Self::InvalidIdentityTokenException(_inner) =>
427            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
428            ,
429            Self::MalformedPolicyDocumentException(_inner) =>
430            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
431            ,
432            Self::PackedPolicyTooLargeException(_inner) =>
433            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
434            ,
435            Self::RegionDisabledException(_inner) =>
436            ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner)
437            ,
438            Self::Unhandled(_inner) => {
439                &_inner.meta
440            }
441        }
442    }
443}
444impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for AssumeRoleWithWebIdentityError {
445    fn create_unhandled_error(
446                        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
447                        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>
448                    ) -> Self {
449        Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source, meta: meta.unwrap_or_default() })
450    }
451}
452impl ::aws_types::request_id::RequestId for crate::operation::assume_role_with_web_identity::AssumeRoleWithWebIdentityError {
453                                fn request_id(&self) -> Option<&str> {
454                                    self.meta().request_id()
455                                }
456                            }
457
458pub use crate::operation::assume_role_with_web_identity::_assume_role_with_web_identity_input::AssumeRoleWithWebIdentityInput;
459
460pub use crate::operation::assume_role_with_web_identity::_assume_role_with_web_identity_output::AssumeRoleWithWebIdentityOutput;
461
462mod _assume_role_with_web_identity_input;
463
464mod _assume_role_with_web_identity_output;
465
466/// Builders
467pub mod builders;
468