aws_sdk_securityhub/operation/update_organization_configuration/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_organization_configuration::_update_organization_configuration_output::UpdateOrganizationConfigurationOutputBuilder;
3
4pub use crate::operation::update_organization_configuration::_update_organization_configuration_input::UpdateOrganizationConfigurationInputBuilder;
5
6impl crate::operation::update_organization_configuration::builders::UpdateOrganizationConfigurationInputBuilder {
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_organization_configuration::UpdateOrganizationConfigurationOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_organization_configuration::UpdateOrganizationConfigurationError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_organization_configuration();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateOrganizationConfiguration`.
24///
25/// <p>Updates the configuration of your organization in Security Hub. Only the Security Hub administrator account can invoke this operation.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateOrganizationConfigurationFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::update_organization_configuration::builders::UpdateOrganizationConfigurationInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::update_organization_configuration::UpdateOrganizationConfigurationOutput,
35 crate::operation::update_organization_configuration::UpdateOrganizationConfigurationError,
36 > for UpdateOrganizationConfigurationFluentBuilder
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_organization_configuration::UpdateOrganizationConfigurationOutput,
44 crate::operation::update_organization_configuration::UpdateOrganizationConfigurationError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl UpdateOrganizationConfigurationFluentBuilder {
51 /// Creates a new `UpdateOrganizationConfigurationFluentBuilder`.
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 UpdateOrganizationConfiguration as a reference.
60 pub fn as_input(&self) -> &crate::operation::update_organization_configuration::builders::UpdateOrganizationConfigurationInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::update_organization_configuration::UpdateOrganizationConfigurationOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::update_organization_configuration::UpdateOrganizationConfigurationError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::update_organization_configuration::UpdateOrganizationConfiguration::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::update_organization_configuration::UpdateOrganizationConfiguration::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::update_organization_configuration::UpdateOrganizationConfigurationOutput,
97 crate::operation::update_organization_configuration::UpdateOrganizationConfigurationError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>Whether to automatically enable Security Hub in new member accounts when they join the organization.</p>
112 /// <p>If set to <code>true</code>, then Security Hub is automatically enabled in new accounts. If set to <code>false</code>, then Security Hub isn't enabled in new accounts automatically. The default value is <code>false</code>.</p>
113 /// <p>If the <code>ConfigurationType</code> of your organization is set to <code>CENTRAL</code>, then this field is set to <code>false</code> and can't be changed in the home Region and linked Regions. However, in that case, the delegated administrator can create a configuration policy in which Security Hub is enabled and associate the policy with new organization accounts.</p>
114 pub fn auto_enable(mut self, input: bool) -> Self {
115 self.inner = self.inner.auto_enable(input);
116 self
117 }
118 /// <p>Whether to automatically enable Security Hub in new member accounts when they join the organization.</p>
119 /// <p>If set to <code>true</code>, then Security Hub is automatically enabled in new accounts. If set to <code>false</code>, then Security Hub isn't enabled in new accounts automatically. The default value is <code>false</code>.</p>
120 /// <p>If the <code>ConfigurationType</code> of your organization is set to <code>CENTRAL</code>, then this field is set to <code>false</code> and can't be changed in the home Region and linked Regions. However, in that case, the delegated administrator can create a configuration policy in which Security Hub is enabled and associate the policy with new organization accounts.</p>
121 pub fn set_auto_enable(mut self, input: ::std::option::Option<bool>) -> Self {
122 self.inner = self.inner.set_auto_enable(input);
123 self
124 }
125 /// <p>Whether to automatically enable Security Hub in new member accounts when they join the organization.</p>
126 /// <p>If set to <code>true</code>, then Security Hub is automatically enabled in new accounts. If set to <code>false</code>, then Security Hub isn't enabled in new accounts automatically. The default value is <code>false</code>.</p>
127 /// <p>If the <code>ConfigurationType</code> of your organization is set to <code>CENTRAL</code>, then this field is set to <code>false</code> and can't be changed in the home Region and linked Regions. However, in that case, the delegated administrator can create a configuration policy in which Security Hub is enabled and associate the policy with new organization accounts.</p>
128 pub fn get_auto_enable(&self) -> &::std::option::Option<bool> {
129 self.inner.get_auto_enable()
130 }
131 /// <p>Whether to automatically enable Security Hub <a href="https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-enable-disable.html">default standards</a> in new member accounts when they join the organization.</p>
132 /// <p>The default value of this parameter is equal to <code>DEFAULT</code>.</p>
133 /// <p>If equal to <code>DEFAULT</code>, then Security Hub default standards are automatically enabled for new member accounts. If equal to <code>NONE</code>, then default standards are not automatically enabled for new member accounts.</p>
134 /// <p>If the <code>ConfigurationType</code> of your organization is set to <code>CENTRAL</code>, then this field is set to <code>NONE</code> and can't be changed in the home Region and linked Regions. However, in that case, the delegated administrator can create a configuration policy in which specific security standards are enabled and associate the policy with new organization accounts.</p>
135 pub fn auto_enable_standards(mut self, input: crate::types::AutoEnableStandards) -> Self {
136 self.inner = self.inner.auto_enable_standards(input);
137 self
138 }
139 /// <p>Whether to automatically enable Security Hub <a href="https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-enable-disable.html">default standards</a> in new member accounts when they join the organization.</p>
140 /// <p>The default value of this parameter is equal to <code>DEFAULT</code>.</p>
141 /// <p>If equal to <code>DEFAULT</code>, then Security Hub default standards are automatically enabled for new member accounts. If equal to <code>NONE</code>, then default standards are not automatically enabled for new member accounts.</p>
142 /// <p>If the <code>ConfigurationType</code> of your organization is set to <code>CENTRAL</code>, then this field is set to <code>NONE</code> and can't be changed in the home Region and linked Regions. However, in that case, the delegated administrator can create a configuration policy in which specific security standards are enabled and associate the policy with new organization accounts.</p>
143 pub fn set_auto_enable_standards(mut self, input: ::std::option::Option<crate::types::AutoEnableStandards>) -> Self {
144 self.inner = self.inner.set_auto_enable_standards(input);
145 self
146 }
147 /// <p>Whether to automatically enable Security Hub <a href="https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-enable-disable.html">default standards</a> in new member accounts when they join the organization.</p>
148 /// <p>The default value of this parameter is equal to <code>DEFAULT</code>.</p>
149 /// <p>If equal to <code>DEFAULT</code>, then Security Hub default standards are automatically enabled for new member accounts. If equal to <code>NONE</code>, then default standards are not automatically enabled for new member accounts.</p>
150 /// <p>If the <code>ConfigurationType</code> of your organization is set to <code>CENTRAL</code>, then this field is set to <code>NONE</code> and can't be changed in the home Region and linked Regions. However, in that case, the delegated administrator can create a configuration policy in which specific security standards are enabled and associate the policy with new organization accounts.</p>
151 pub fn get_auto_enable_standards(&self) -> &::std::option::Option<crate::types::AutoEnableStandards> {
152 self.inner.get_auto_enable_standards()
153 }
154 /// <p>Provides information about the way an organization is configured in Security Hub.</p>
155 pub fn organization_configuration(mut self, input: crate::types::OrganizationConfiguration) -> Self {
156 self.inner = self.inner.organization_configuration(input);
157 self
158 }
159 /// <p>Provides information about the way an organization is configured in Security Hub.</p>
160 pub fn set_organization_configuration(mut self, input: ::std::option::Option<crate::types::OrganizationConfiguration>) -> Self {
161 self.inner = self.inner.set_organization_configuration(input);
162 self
163 }
164 /// <p>Provides information about the way an organization is configured in Security Hub.</p>
165 pub fn get_organization_configuration(&self) -> &::std::option::Option<crate::types::OrganizationConfiguration> {
166 self.inner.get_organization_configuration()
167 }
168}