aws_sdk_iam/operation/enable_organizations_root_sessions/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::enable_organizations_root_sessions::_enable_organizations_root_sessions_output::EnableOrganizationsRootSessionsOutputBuilder;
3
4pub use crate::operation::enable_organizations_root_sessions::_enable_organizations_root_sessions_input::EnableOrganizationsRootSessionsInputBuilder;
5
6impl crate::operation::enable_organizations_root_sessions::builders::EnableOrganizationsRootSessionsInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::enable_organizations_root_sessions::EnableOrganizationsRootSessionsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::enable_organizations_root_sessions::EnableOrganizationsRootSessionsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.enable_organizations_root_sessions();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `EnableOrganizationsRootSessions`.
24///
25/// <p>Allows the management account or delegated administrator to perform privileged tasks on member accounts in your organization. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#id_root-user-access-management">Centrally manage root access for member accounts</a> in the <i>Identity and Access Management User Guide</i>.</p>
26/// <p>Before you enable this feature, you must have an account configured with the following settings:</p>
27/// <ul>
28/// <li>
29/// <p>You must manage your Amazon Web Services accounts in <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html">Organizations</a>.</p></li>
30/// <li>
31/// <p>Enable trusted access for Identity and Access Management in Organizations. For details, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-ra.html">IAM and Organizations</a> in the <i>Organizations User Guide</i>.</p></li>
32/// </ul>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct EnableOrganizationsRootSessionsFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::enable_organizations_root_sessions::builders::EnableOrganizationsRootSessionsInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::enable_organizations_root_sessions::EnableOrganizationsRootSessionsOutput,
42        crate::operation::enable_organizations_root_sessions::EnableOrganizationsRootSessionsError,
43    > for EnableOrganizationsRootSessionsFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::enable_organizations_root_sessions::EnableOrganizationsRootSessionsOutput,
51            crate::operation::enable_organizations_root_sessions::EnableOrganizationsRootSessionsError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl EnableOrganizationsRootSessionsFluentBuilder {
58    /// Creates a new `EnableOrganizationsRootSessionsFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the EnableOrganizationsRootSessions as a reference.
67    pub fn as_input(&self) -> &crate::operation::enable_organizations_root_sessions::builders::EnableOrganizationsRootSessionsInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::enable_organizations_root_sessions::EnableOrganizationsRootSessionsOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::enable_organizations_root_sessions::EnableOrganizationsRootSessionsError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::enable_organizations_root_sessions::EnableOrganizationsRootSessions::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::enable_organizations_root_sessions::EnableOrganizationsRootSessions::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::enable_organizations_root_sessions::EnableOrganizationsRootSessionsOutput,
104        crate::operation::enable_organizations_root_sessions::EnableOrganizationsRootSessionsError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118}