aws_sdk_iam/operation/enable_organizations_root_credentials_management/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::enable_organizations_root_credentials_management::_enable_organizations_root_credentials_management_output::EnableOrganizationsRootCredentialsManagementOutputBuilder;
3
4pub use crate::operation::enable_organizations_root_credentials_management::_enable_organizations_root_credentials_management_input::EnableOrganizationsRootCredentialsManagementInputBuilder;
5
6impl crate::operation::enable_organizations_root_credentials_management::builders::EnableOrganizationsRootCredentialsManagementInputBuilder {
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_credentials_management::EnableOrganizationsRootCredentialsManagementOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::enable_organizations_root_credentials_management::EnableOrganizationsRootCredentialsManagementError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.enable_organizations_root_credentials_management();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `EnableOrganizationsRootCredentialsManagement`.
24///
25/// <p>Enables the management of privileged root user credentials across member accounts in your organization. When you enable root credentials management for <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#id_root-user-access-management">centralized root access</a>, the management account and the delegated administrator for IAM can manage root user credentials for member accounts in your organization.</p>
26/// <p>Before you enable centralized root access, 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-iam.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 EnableOrganizationsRootCredentialsManagementFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::enable_organizations_root_credentials_management::builders::EnableOrganizationsRootCredentialsManagementInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::enable_organizations_root_credentials_management::EnableOrganizationsRootCredentialsManagementOutput,
42        crate::operation::enable_organizations_root_credentials_management::EnableOrganizationsRootCredentialsManagementError,
43    > for EnableOrganizationsRootCredentialsManagementFluentBuilder
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_credentials_management::EnableOrganizationsRootCredentialsManagementOutput,
51            crate::operation::enable_organizations_root_credentials_management::EnableOrganizationsRootCredentialsManagementError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl EnableOrganizationsRootCredentialsManagementFluentBuilder {
58    /// Creates a new `EnableOrganizationsRootCredentialsManagementFluentBuilder`.
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 EnableOrganizationsRootCredentialsManagement as a reference.
67    pub fn as_input(
68        &self,
69    ) -> &crate::operation::enable_organizations_root_credentials_management::builders::EnableOrganizationsRootCredentialsManagementInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::enable_organizations_root_credentials_management::EnableOrganizationsRootCredentialsManagementOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::enable_organizations_root_credentials_management::EnableOrganizationsRootCredentialsManagementError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::enable_organizations_root_credentials_management::EnableOrganizationsRootCredentialsManagement::operation_runtime_plugins(
94                            self.handle.runtime_plugins.clone(),
95                            &self.handle.conf,
96                            self.config_override,
97                        );
98        crate::operation::enable_organizations_root_credentials_management::EnableOrganizationsRootCredentialsManagement::orchestrate(
99            &runtime_plugins,
100            input,
101        )
102        .await
103    }
104
105    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106    pub fn customize(
107        self,
108    ) -> crate::client::customize::CustomizableOperation<
109        crate::operation::enable_organizations_root_credentials_management::EnableOrganizationsRootCredentialsManagementOutput,
110        crate::operation::enable_organizations_root_credentials_management::EnableOrganizationsRootCredentialsManagementError,
111        Self,
112    > {
113        crate::client::customize::CustomizableOperation::new(self)
114    }
115    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116        self.set_config_override(::std::option::Option::Some(config_override.into()));
117        self
118    }
119
120    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121        self.config_override = config_override;
122        self
123    }
124}