// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_enabled_control::_update_enabled_control_input::UpdateEnabledControlInputBuilder;
pub use crate::operation::update_enabled_control::_update_enabled_control_output::UpdateEnabledControlOutputBuilder;
impl crate::operation::update_enabled_control::builders::UpdateEnabledControlInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::update_enabled_control::UpdateEnabledControlOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::update_enabled_control::UpdateEnabledControlError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.update_enabled_control();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `UpdateEnabledControl`.
///
/// <p>Updates the configuration of an already enabled control.</p>
/// <p>If the enabled control shows an <code>EnablementStatus</code> of SUCCEEDED, supply parameters that are different from the currently configured parameters. Otherwise, Amazon Web Services Control Tower will not accept the request.</p>
/// <p>If the enabled control shows an <code>EnablementStatus</code> of FAILED, Amazon Web Services Control Tower updates the control to match any valid parameters that you supply.</p>
/// <p>If the <code>DriftSummary</code> status for the control shows as <code>DRIFTED</code>, you cannot call this API. Instead, you can update the control by calling the <code>ResetEnabledControl</code> API. Alternatively, you can call <code>DisableControl</code> and then call <code>EnableControl</code> again. Also, you can run an extending governance operation to repair drift. For usage examples, see the <a href="https://docs.aws.amazon.com/controltower/latest/controlreference/control-api-examples-short.html"> <i>Controls Reference Guide</i> </a>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateEnabledControlFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::update_enabled_control::builders::UpdateEnabledControlInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::update_enabled_control::UpdateEnabledControlOutput,
crate::operation::update_enabled_control::UpdateEnabledControlError,
> for UpdateEnabledControlFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::update_enabled_control::UpdateEnabledControlOutput,
crate::operation::update_enabled_control::UpdateEnabledControlError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl UpdateEnabledControlFluentBuilder {
/// Creates a new `UpdateEnabledControlFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the UpdateEnabledControl as a reference.
pub fn as_input(&self) -> &crate::operation::update_enabled_control::builders::UpdateEnabledControlInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::update_enabled_control::UpdateEnabledControlOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::update_enabled_control::UpdateEnabledControlError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::update_enabled_control::UpdateEnabledControl::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::update_enabled_control::UpdateEnabledControl::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::update_enabled_control::UpdateEnabledControlOutput,
crate::operation::update_enabled_control::UpdateEnabledControlError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
///
/// Appends an item to `parameters`.
///
/// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
///
/// <p>A key/value pair, where <code>Key</code> is of type <code>String</code> and <code>Value</code> is of type <code>Document</code>.</p>
pub fn parameters(mut self, input: crate::types::EnabledControlParameter) -> Self {
self.inner = self.inner.parameters(input);
self
}
/// <p>A key/value pair, where <code>Key</code> is of type <code>String</code> and <code>Value</code> is of type <code>Document</code>.</p>
pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EnabledControlParameter>>) -> Self {
self.inner = self.inner.set_parameters(input);
self
}
/// <p>A key/value pair, where <code>Key</code> is of type <code>String</code> and <code>Value</code> is of type <code>Document</code>.</p>
pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EnabledControlParameter>> {
self.inner.get_parameters()
}
/// <p>The ARN of the enabled control that will be updated.</p>
pub fn enabled_control_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.enabled_control_identifier(input.into());
self
}
/// <p>The ARN of the enabled control that will be updated.</p>
pub fn set_enabled_control_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_enabled_control_identifier(input);
self
}
/// <p>The ARN of the enabled control that will be updated.</p>
pub fn get_enabled_control_identifier(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_enabled_control_identifier()
}
}