aws_sdk_config/operation/put_configuration_aggregator/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::put_configuration_aggregator::_put_configuration_aggregator_output::PutConfigurationAggregatorOutputBuilder;
3
4pub use crate::operation::put_configuration_aggregator::_put_configuration_aggregator_input::PutConfigurationAggregatorInputBuilder;
5
6impl crate::operation::put_configuration_aggregator::builders::PutConfigurationAggregatorInputBuilder {
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::put_configuration_aggregator::PutConfigurationAggregatorOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.put_configuration_aggregator();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `PutConfigurationAggregator`.
24///
25/// <p>Creates and updates the configuration aggregator with the selected source accounts and regions. The source account can be individual account(s) or an organization.</p>
26/// <p><code>accountIds</code> that are passed will be replaced with existing accounts. If you want to add additional accounts into the aggregator, call <code>DescribeConfigurationAggregators</code> to get the previous accounts and then append new ones.</p><note>
27/// <p>Config should be enabled in source accounts and regions you want to aggregate.</p>
28/// <p>If your source type is an organization, you must be signed in to the management account or a registered delegated administrator and all the features must be enabled in your organization. If the caller is a management account, Config calls <code>EnableAwsServiceAccess</code> API to enable integration between Config and Organizations. If the caller is a registered delegated administrator, Config calls <code>ListDelegatedAdministrators</code> API to verify whether the caller is a valid delegated administrator.</p>
29/// <p>To register a delegated administrator, see <a href="https://docs.aws.amazon.com/config/latest/developerguide/set-up-aggregator-cli.html#register-a-delegated-administrator-cli">Register a Delegated Administrator</a> in the <i>Config developer guide</i>.</p>
30/// </note> <note>
31/// <p><b>Tags are added at creation and cannot be updated with this operation</b></p>
32/// <p><code>PutConfigurationAggregator</code> is an idempotent API. Subsequent requests won’t create a duplicate resource if one was already created. If a following request has different <code>tags</code> values, Config will ignore these differences and treat it as an idempotent request of the previous. In this case, <code>tags</code> will not be updated, even if they are different.</p>
33/// <p>Use <a href="https://docs.aws.amazon.com/config/latest/APIReference/API_TagResource.html">TagResource</a> and <a href="https://docs.aws.amazon.com/config/latest/APIReference/API_UntagResource.html">UntagResource</a> to update tags after creation.</p>
34/// </note>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct PutConfigurationAggregatorFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::put_configuration_aggregator::builders::PutConfigurationAggregatorInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::put_configuration_aggregator::PutConfigurationAggregatorOutput,
44        crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError,
45    > for PutConfigurationAggregatorFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::put_configuration_aggregator::PutConfigurationAggregatorOutput,
53            crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl PutConfigurationAggregatorFluentBuilder {
60    /// Creates a new `PutConfigurationAggregatorFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the PutConfigurationAggregator as a reference.
69    pub fn as_input(&self) -> &crate::operation::put_configuration_aggregator::builders::PutConfigurationAggregatorInputBuilder {
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::put_configuration_aggregator::PutConfigurationAggregatorOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError,
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::put_configuration_aggregator::PutConfigurationAggregator::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::put_configuration_aggregator::PutConfigurationAggregator::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::put_configuration_aggregator::PutConfigurationAggregatorOutput,
106        crate::operation::put_configuration_aggregator::PutConfigurationAggregatorError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>The name of the configuration aggregator.</p>
121    pub fn configuration_aggregator_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.configuration_aggregator_name(input.into());
123        self
124    }
125    /// <p>The name of the configuration aggregator.</p>
126    pub fn set_configuration_aggregator_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_configuration_aggregator_name(input);
128        self
129    }
130    /// <p>The name of the configuration aggregator.</p>
131    pub fn get_configuration_aggregator_name(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_configuration_aggregator_name()
133    }
134    ///
135    /// Appends an item to `AccountAggregationSources`.
136    ///
137    /// To override the contents of this collection use [`set_account_aggregation_sources`](Self::set_account_aggregation_sources).
138    ///
139    /// <p>A list of AccountAggregationSource object.</p>
140    pub fn account_aggregation_sources(mut self, input: crate::types::AccountAggregationSource) -> Self {
141        self.inner = self.inner.account_aggregation_sources(input);
142        self
143    }
144    /// <p>A list of AccountAggregationSource object.</p>
145    pub fn set_account_aggregation_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AccountAggregationSource>>) -> Self {
146        self.inner = self.inner.set_account_aggregation_sources(input);
147        self
148    }
149    /// <p>A list of AccountAggregationSource object.</p>
150    pub fn get_account_aggregation_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AccountAggregationSource>> {
151        self.inner.get_account_aggregation_sources()
152    }
153    /// <p>An OrganizationAggregationSource object.</p>
154    pub fn organization_aggregation_source(mut self, input: crate::types::OrganizationAggregationSource) -> Self {
155        self.inner = self.inner.organization_aggregation_source(input);
156        self
157    }
158    /// <p>An OrganizationAggregationSource object.</p>
159    pub fn set_organization_aggregation_source(mut self, input: ::std::option::Option<crate::types::OrganizationAggregationSource>) -> Self {
160        self.inner = self.inner.set_organization_aggregation_source(input);
161        self
162    }
163    /// <p>An OrganizationAggregationSource object.</p>
164    pub fn get_organization_aggregation_source(&self) -> &::std::option::Option<crate::types::OrganizationAggregationSource> {
165        self.inner.get_organization_aggregation_source()
166    }
167    ///
168    /// Appends an item to `Tags`.
169    ///
170    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
171    ///
172    /// <p>An array of tag object.</p>
173    pub fn tags(mut self, input: crate::types::Tag) -> Self {
174        self.inner = self.inner.tags(input);
175        self
176    }
177    /// <p>An array of tag object.</p>
178    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
179        self.inner = self.inner.set_tags(input);
180        self
181    }
182    /// <p>An array of tag object.</p>
183    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
184        self.inner.get_tags()
185    }
186    /// <p>An object to filter configuration recorders in an aggregator. Either <code>ResourceType</code> or <code>ServicePrincipal</code> is required.</p>
187    pub fn aggregator_filters(mut self, input: crate::types::AggregatorFilters) -> Self {
188        self.inner = self.inner.aggregator_filters(input);
189        self
190    }
191    /// <p>An object to filter configuration recorders in an aggregator. Either <code>ResourceType</code> or <code>ServicePrincipal</code> is required.</p>
192    pub fn set_aggregator_filters(mut self, input: ::std::option::Option<crate::types::AggregatorFilters>) -> Self {
193        self.inner = self.inner.set_aggregator_filters(input);
194        self
195    }
196    /// <p>An object to filter configuration recorders in an aggregator. Either <code>ResourceType</code> or <code>ServicePrincipal</code> is required.</p>
197    pub fn get_aggregator_filters(&self) -> &::std::option::Option<crate::types::AggregatorFilters> {
198        self.inner.get_aggregator_filters()
199    }
200}