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