1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::logout::_logout_output::LogoutOutputBuilder;
34pub use crate::operation::logout::_logout_input::LogoutInputBuilder;
56impl crate::operation::logout::builders::LogoutInputBuilder {
7/// Sends a request with this input using the given client.
8pub async fn send_with(
9self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12crate::operation::logout::LogoutOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14crate::operation::logout::LogoutError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18let mut fluent_builder = client.logout();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21}
22}
23/// Fluent builder constructing a request to `Logout`.
24///
25/// <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>
26/// <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>
27/// <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>
28/// </note>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct LogoutFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::logout::builders::LogoutInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl crate::client::customize::internal::CustomizableSend<crate::operation::logout::LogoutOutput, crate::operation::logout::LogoutError>
36for LogoutFluentBuilder
37{
38fn send(
39self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42crate::client::customize::internal::SendResult<crate::operation::logout::LogoutOutput, crate::operation::logout::LogoutError>,
43 > {
44 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
45 }
46}
47impl LogoutFluentBuilder {
48/// Creates a new `LogoutFluentBuilder`.
49pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
50Self {
51 handle,
52 inner: ::std::default::Default::default(),
53 config_override: ::std::option::Option::None,
54 }
55 }
56/// Access the Logout as a reference.
57pub fn as_input(&self) -> &crate::operation::logout::builders::LogoutInputBuilder {
58&self.inner
59 }
60/// Sends the request and returns the response.
61 ///
62 /// If an error occurs, an `SdkError` will be returned with additional details that
63 /// can be matched against.
64 ///
65 /// By default, any retryable failures will be retried twice. Retry behavior
66 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
67 /// set when configuring the client.
68pub async fn send(
69self,
70 ) -> ::std::result::Result<
71crate::operation::logout::LogoutOutput,
72 ::aws_smithy_runtime_api::client::result::SdkError<
73crate::operation::logout::LogoutError,
74 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
75 >,
76 > {
77let input = self
78.inner
79 .build()
80 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
81let runtime_plugins =
82crate::operation::logout::Logout::operation_runtime_plugins(self.handle.runtime_plugins.clone(), &self.handle.conf, self.config_override);
83crate::operation::logout::Logout::orchestrate(&runtime_plugins, input).await
84}
8586/// Consumes this builder, creating a customizable operation that can be modified before being sent.
87pub fn customize(
88self,
89 ) -> crate::client::customize::CustomizableOperation<crate::operation::logout::LogoutOutput, crate::operation::logout::LogoutError, Self> {
90crate::client::customize::CustomizableOperation::new(self)
91 }
92pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
93self.set_config_override(::std::option::Option::Some(config_override.into()));
94self
95}
9697pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
98self.config_override = config_override;
99self
100}
101/// <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>
102pub fn access_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103self.inner = self.inner.access_token(input.into());
104self
105}
106/// <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>
107pub fn set_access_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108self.inner = self.inner.set_access_token(input);
109self
110}
111/// <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>
112pub fn get_access_token(&self) -> &::std::option::Option<::std::string::String> {
113self.inner.get_access_token()
114 }
115}