aws_sdk_sso/operation/logout/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::logout::_logout_output::LogoutOutputBuilder;
3
4pub use crate::operation::logout::_logout_input::LogoutInputBuilder;
5
6impl crate::operation::logout::builders::LogoutInputBuilder {
7                    /// Sends a request with this input using the given client.
8                    pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result<
9                        crate::operation::logout::LogoutOutput,
10                        ::aws_smithy_runtime_api::client::result::SdkError<
11                            crate::operation::logout::LogoutError,
12                            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13                        >
14                    > {
15                        let mut fluent_builder = client.logout();
16                        fluent_builder.inner = self;
17                        fluent_builder.send().await
18                    }
19                }
20/// Fluent builder constructing a request to `Logout`.
21/// 
22/// <p>Removes the locally stored SSO tokens from the client-side cache and sends an API call to the IAM Identity Center service to invalidate the corresponding server-side IAM Identity Center sign in session.</p><note>
23/// <p>If a user uses IAM Identity Center to access the AWS CLI, the user’s IAM Identity Center sign in session is used to obtain an IAM session, as specified in the corresponding IAM Identity Center permission set. More specifically, IAM Identity Center assumes an IAM role in the target account on behalf of the user, and the corresponding temporary AWS credentials are returned to the client.</p>
24/// <p>After user logout, any existing IAM role sessions that were created by using IAM Identity Center permission sets continue based on the duration configured in the permission set. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/authconcept.html">User authentications</a> in the <i>IAM Identity Center User Guide</i>.</p>
25/// </note>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct LogoutFluentBuilder {
28                handle: ::std::sync::Arc<crate::client::Handle>,
29                inner: crate::operation::logout::builders::LogoutInputBuilder,
30config_override: ::std::option::Option<crate::config::Builder>,
31            }
32impl
33                crate::client::customize::internal::CustomizableSend<
34                    crate::operation::logout::LogoutOutput,
35                    crate::operation::logout::LogoutError,
36                > for LogoutFluentBuilder
37            {
38                fn send(
39                    self,
40                    config_override: crate::config::Builder,
41                ) -> crate::client::customize::internal::BoxFuture<
42                    crate::client::customize::internal::SendResult<
43                        crate::operation::logout::LogoutOutput,
44                        crate::operation::logout::LogoutError,
45                    >,
46                > {
47                    ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48                }
49            }
50impl LogoutFluentBuilder {
51    /// Creates a new `LogoutFluentBuilder`.
52                    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53                        Self {
54                            handle,
55                            inner: ::std::default::Default::default(),
56    config_override: ::std::option::Option::None,
57                        }
58                    }
59    /// Access the Logout as a reference.
60                    pub fn as_input(&self) -> &crate::operation::logout::builders::LogoutInputBuilder {
61                        &self.inner
62                    }
63    /// Sends the request and returns the response.
64                    ///
65                    /// If an error occurs, an `SdkError` will be returned with additional details that
66                    /// can be matched against.
67                    ///
68                    /// By default, any retryable failures will be retried twice. Retry behavior
69                    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70                    /// set when configuring the client.
71                    pub async fn send(self) -> ::std::result::Result<crate::operation::logout::LogoutOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::logout::LogoutError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
72                        let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
73                        let runtime_plugins = crate::operation::logout::Logout::operation_runtime_plugins(
74                            self.handle.runtime_plugins.clone(),
75                            &self.handle.conf,
76                            self.config_override,
77                        );
78                        crate::operation::logout::Logout::orchestrate(&runtime_plugins, input).await
79                    }
80    
81                    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
82                    pub fn customize(
83                        self,
84                    ) -> crate::client::customize::CustomizableOperation<crate::operation::logout::LogoutOutput, crate::operation::logout::LogoutError, Self> {
85                        crate::client::customize::CustomizableOperation::new(self)
86                    }
87    pub(crate) fn config_override(
88                            mut self,
89                            config_override: impl ::std::convert::Into<crate::config::Builder>,
90                        ) -> Self {
91                            self.set_config_override(::std::option::Option::Some(config_override.into()));
92                            self
93                        }
94    
95                        pub(crate) fn set_config_override(
96                            &mut self,
97                            config_override: ::std::option::Option<crate::config::Builder>,
98                        ) -> &mut Self {
99                            self.config_override = config_override;
100                            self
101                        }
102    /// <p>The token issued by the <code>CreateToken</code> API call. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html">CreateToken</a> in the <i>IAM Identity Center OIDC API Reference Guide</i>.</p>
103    pub fn access_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104                    self.inner = self.inner.access_token(input.into());
105                    self
106                }
107    /// <p>The token issued by the <code>CreateToken</code> API call. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html">CreateToken</a> in the <i>IAM Identity Center OIDC API Reference Guide</i>.</p>
108    pub fn set_access_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109                    self.inner = self.inner.set_access_token(input);
110                    self
111                }
112    /// <p>The token issued by the <code>CreateToken</code> API call. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html">CreateToken</a> in the <i>IAM Identity Center OIDC API Reference Guide</i>.</p>
113    pub fn get_access_token(&self) -> &::std::option::Option<::std::string::String> {
114                    self.inner.get_access_token()
115                }
116}
117