aws_sdk_iam/operation/disable_organizations_root_credentials_management/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::disable_organizations_root_credentials_management::_disable_organizations_root_credentials_management_output::DisableOrganizationsRootCredentialsManagementOutputBuilder;
3
4pub use crate::operation::disable_organizations_root_credentials_management::_disable_organizations_root_credentials_management_input::DisableOrganizationsRootCredentialsManagementInputBuilder;
5
6impl crate::operation::disable_organizations_root_credentials_management::builders::DisableOrganizationsRootCredentialsManagementInputBuilder {
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::disable_organizations_root_credentials_management::DisableOrganizationsRootCredentialsManagementOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::disable_organizations_root_credentials_management::DisableOrganizationsRootCredentialsManagementError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.disable_organizations_root_credentials_management();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DisableOrganizationsRootCredentialsManagement`.
24///
25/// <p>Disables the management of privileged root user credentials across member accounts in your organization. When you disable this feature, the management account and the delegated administrator for IAM can no longer manage root user credentials for member accounts in your organization.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct DisableOrganizationsRootCredentialsManagementFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::disable_organizations_root_credentials_management::builders::DisableOrganizationsRootCredentialsManagementInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::disable_organizations_root_credentials_management::DisableOrganizationsRootCredentialsManagementOutput,
35        crate::operation::disable_organizations_root_credentials_management::DisableOrganizationsRootCredentialsManagementError,
36    > for DisableOrganizationsRootCredentialsManagementFluentBuilder
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::disable_organizations_root_credentials_management::DisableOrganizationsRootCredentialsManagementOutput,
44            crate::operation::disable_organizations_root_credentials_management::DisableOrganizationsRootCredentialsManagementError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl DisableOrganizationsRootCredentialsManagementFluentBuilder {
51    /// Creates a new `DisableOrganizationsRootCredentialsManagementFluentBuilder`.
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 DisableOrganizationsRootCredentialsManagement as a reference.
60    pub fn as_input(
61        &self,
62    ) -> &crate::operation::disable_organizations_root_credentials_management::builders::DisableOrganizationsRootCredentialsManagementInputBuilder
63    {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::disable_organizations_root_credentials_management::DisableOrganizationsRootCredentialsManagementOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::disable_organizations_root_credentials_management::DisableOrganizationsRootCredentialsManagementError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::disable_organizations_root_credentials_management::DisableOrganizationsRootCredentialsManagement::operation_runtime_plugins(
88                            self.handle.runtime_plugins.clone(),
89                            &self.handle.conf,
90                            self.config_override,
91                        );
92        crate::operation::disable_organizations_root_credentials_management::DisableOrganizationsRootCredentialsManagement::orchestrate(
93            &runtime_plugins,
94            input,
95        )
96        .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::disable_organizations_root_credentials_management::DisableOrganizationsRootCredentialsManagementOutput,
104        crate::operation::disable_organizations_root_credentials_management::DisableOrganizationsRootCredentialsManagementError,
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}