aws_sdk_macie2/operation/update_automated_discovery_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_automated_discovery_configuration::_update_automated_discovery_configuration_output::UpdateAutomatedDiscoveryConfigurationOutputBuilder;
3
4pub use crate::operation::update_automated_discovery_configuration::_update_automated_discovery_configuration_input::UpdateAutomatedDiscoveryConfigurationInputBuilder;
5
6impl crate::operation::update_automated_discovery_configuration::builders::UpdateAutomatedDiscoveryConfigurationInputBuilder {
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::update_automated_discovery_configuration::UpdateAutomatedDiscoveryConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_automated_discovery_configuration::UpdateAutomatedDiscoveryConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_automated_discovery_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateAutomatedDiscoveryConfiguration`.
24///
25/// <p>Changes the configuration settings and status of automated sensitive data discovery for an organization or standalone account.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateAutomatedDiscoveryConfigurationFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_automated_discovery_configuration::builders::UpdateAutomatedDiscoveryConfigurationInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_automated_discovery_configuration::UpdateAutomatedDiscoveryConfigurationOutput,
35        crate::operation::update_automated_discovery_configuration::UpdateAutomatedDiscoveryConfigurationError,
36    > for UpdateAutomatedDiscoveryConfigurationFluentBuilder
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::update_automated_discovery_configuration::UpdateAutomatedDiscoveryConfigurationOutput,
44            crate::operation::update_automated_discovery_configuration::UpdateAutomatedDiscoveryConfigurationError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateAutomatedDiscoveryConfigurationFluentBuilder {
51    /// Creates a new `UpdateAutomatedDiscoveryConfigurationFluentBuilder`.
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 UpdateAutomatedDiscoveryConfiguration as a reference.
60    pub fn as_input(
61        &self,
62    ) -> &crate::operation::update_automated_discovery_configuration::builders::UpdateAutomatedDiscoveryConfigurationInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::update_automated_discovery_configuration::UpdateAutomatedDiscoveryConfigurationOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::update_automated_discovery_configuration::UpdateAutomatedDiscoveryConfigurationError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins =
87            crate::operation::update_automated_discovery_configuration::UpdateAutomatedDiscoveryConfiguration::operation_runtime_plugins(
88                self.handle.runtime_plugins.clone(),
89                &self.handle.conf,
90                self.config_override,
91            );
92        crate::operation::update_automated_discovery_configuration::UpdateAutomatedDiscoveryConfiguration::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::update_automated_discovery_configuration::UpdateAutomatedDiscoveryConfigurationOutput,
100        crate::operation::update_automated_discovery_configuration::UpdateAutomatedDiscoveryConfigurationError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>Specifies whether to automatically enable automated sensitive data discovery for accounts in the organization. Valid values are: ALL (default), enable it for all existing accounts and new member accounts; NEW, enable it only for new member accounts; and, NONE, don't enable it for any accounts.</p>
115    /// <p>If you specify NEW or NONE, automated sensitive data discovery continues to be enabled for any existing accounts that it's currently enabled for. To enable or disable it for individual member accounts, specify NEW or NONE, and then enable or disable it for each account by using the BatchUpdateAutomatedDiscoveryAccounts operation.</p>
116    pub fn auto_enable_organization_members(mut self, input: crate::types::AutoEnableMode) -> Self {
117        self.inner = self.inner.auto_enable_organization_members(input);
118        self
119    }
120    /// <p>Specifies whether to automatically enable automated sensitive data discovery for accounts in the organization. Valid values are: ALL (default), enable it for all existing accounts and new member accounts; NEW, enable it only for new member accounts; and, NONE, don't enable it for any accounts.</p>
121    /// <p>If you specify NEW or NONE, automated sensitive data discovery continues to be enabled for any existing accounts that it's currently enabled for. To enable or disable it for individual member accounts, specify NEW or NONE, and then enable or disable it for each account by using the BatchUpdateAutomatedDiscoveryAccounts operation.</p>
122    pub fn set_auto_enable_organization_members(mut self, input: ::std::option::Option<crate::types::AutoEnableMode>) -> Self {
123        self.inner = self.inner.set_auto_enable_organization_members(input);
124        self
125    }
126    /// <p>Specifies whether to automatically enable automated sensitive data discovery for accounts in the organization. Valid values are: ALL (default), enable it for all existing accounts and new member accounts; NEW, enable it only for new member accounts; and, NONE, don't enable it for any accounts.</p>
127    /// <p>If you specify NEW or NONE, automated sensitive data discovery continues to be enabled for any existing accounts that it's currently enabled for. To enable or disable it for individual member accounts, specify NEW or NONE, and then enable or disable it for each account by using the BatchUpdateAutomatedDiscoveryAccounts operation.</p>
128    pub fn get_auto_enable_organization_members(&self) -> &::std::option::Option<crate::types::AutoEnableMode> {
129        self.inner.get_auto_enable_organization_members()
130    }
131    /// <p>The new status of automated sensitive data discovery for the organization or account. Valid values are: ENABLED, start or resume all automated sensitive data discovery activities; and, DISABLED, stop performing all automated sensitive data discovery activities.</p>
132    /// <p>If you specify DISABLED for an administrator account, you also disable automated sensitive data discovery for all member accounts in the organization.</p>
133    pub fn status(mut self, input: crate::types::AutomatedDiscoveryStatus) -> Self {
134        self.inner = self.inner.status(input);
135        self
136    }
137    /// <p>The new status of automated sensitive data discovery for the organization or account. Valid values are: ENABLED, start or resume all automated sensitive data discovery activities; and, DISABLED, stop performing all automated sensitive data discovery activities.</p>
138    /// <p>If you specify DISABLED for an administrator account, you also disable automated sensitive data discovery for all member accounts in the organization.</p>
139    pub fn set_status(mut self, input: ::std::option::Option<crate::types::AutomatedDiscoveryStatus>) -> Self {
140        self.inner = self.inner.set_status(input);
141        self
142    }
143    /// <p>The new status of automated sensitive data discovery for the organization or account. Valid values are: ENABLED, start or resume all automated sensitive data discovery activities; and, DISABLED, stop performing all automated sensitive data discovery activities.</p>
144    /// <p>If you specify DISABLED for an administrator account, you also disable automated sensitive data discovery for all member accounts in the organization.</p>
145    pub fn get_status(&self) -> &::std::option::Option<crate::types::AutomatedDiscoveryStatus> {
146        self.inner.get_status()
147    }
148}