aws_sdk_cloudtrail/operation/update_event_data_store/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_event_data_store::_update_event_data_store_output::UpdateEventDataStoreOutputBuilder;
3
4pub use crate::operation::update_event_data_store::_update_event_data_store_input::UpdateEventDataStoreInputBuilder;
5
6impl crate::operation::update_event_data_store::builders::UpdateEventDataStoreInputBuilder {
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_event_data_store::UpdateEventDataStoreOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_event_data_store::UpdateEventDataStoreError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_event_data_store();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateEventDataStore`.
24///
25/// <p>Updates an event data store. The required <code>EventDataStore</code> value is an ARN or the ID portion of the ARN. Other parameters are optional, but at least one optional parameter must be specified, or CloudTrail throws an error. <code>RetentionPeriod</code> is in days, and valid values are integers between 7 and 3653 if the <code>BillingMode</code> is set to <code>EXTENDABLE_RETENTION_PRICING</code>, or between 7 and 2557 if <code>BillingMode</code> is set to <code>FIXED_RETENTION_PRICING</code>. By default, <code>TerminationProtection</code> is enabled.</p>
26/// <p>For event data stores for CloudTrail events, <code>AdvancedEventSelectors</code> includes or excludes management, data, or network activity events in your event data store. For more information about <code>AdvancedEventSelectors</code>, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedEventSelector.html">AdvancedEventSelectors</a>.</p>
27/// <p>For event data stores for CloudTrail Insights events, Config configuration items, Audit Manager evidence, or non-Amazon Web Services events, <code>AdvancedEventSelectors</code> includes events of that type in your event data store.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct UpdateEventDataStoreFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::update_event_data_store::builders::UpdateEventDataStoreInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::update_event_data_store::UpdateEventDataStoreOutput,
37        crate::operation::update_event_data_store::UpdateEventDataStoreError,
38    > for UpdateEventDataStoreFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::update_event_data_store::UpdateEventDataStoreOutput,
46            crate::operation::update_event_data_store::UpdateEventDataStoreError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl UpdateEventDataStoreFluentBuilder {
53    /// Creates a new `UpdateEventDataStoreFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the UpdateEventDataStore as a reference.
62    pub fn as_input(&self) -> &crate::operation::update_event_data_store::builders::UpdateEventDataStoreInputBuilder {
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_event_data_store::UpdateEventDataStoreOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::update_event_data_store::UpdateEventDataStoreError,
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 = crate::operation::update_event_data_store::UpdateEventDataStore::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::update_event_data_store::UpdateEventDataStore::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::update_event_data_store::UpdateEventDataStoreOutput,
99        crate::operation::update_event_data_store::UpdateEventDataStoreError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The ARN (or the ID suffix of the ARN) of the event data store that you want to update.</p>
114    pub fn event_data_store(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.event_data_store(input.into());
116        self
117    }
118    /// <p>The ARN (or the ID suffix of the ARN) of the event data store that you want to update.</p>
119    pub fn set_event_data_store(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_event_data_store(input);
121        self
122    }
123    /// <p>The ARN (or the ID suffix of the ARN) of the event data store that you want to update.</p>
124    pub fn get_event_data_store(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_event_data_store()
126    }
127    /// <p>The event data store name.</p>
128    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.name(input.into());
130        self
131    }
132    /// <p>The event data store name.</p>
133    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_name(input);
135        self
136    }
137    /// <p>The event data store name.</p>
138    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_name()
140    }
141    ///
142    /// Appends an item to `AdvancedEventSelectors`.
143    ///
144    /// To override the contents of this collection use [`set_advanced_event_selectors`](Self::set_advanced_event_selectors).
145    ///
146    /// <p>The advanced event selectors used to select events for the event data store. You can configure up to five advanced event selectors for each event data store.</p>
147    pub fn advanced_event_selectors(mut self, input: crate::types::AdvancedEventSelector) -> Self {
148        self.inner = self.inner.advanced_event_selectors(input);
149        self
150    }
151    /// <p>The advanced event selectors used to select events for the event data store. You can configure up to five advanced event selectors for each event data store.</p>
152    pub fn set_advanced_event_selectors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AdvancedEventSelector>>) -> Self {
153        self.inner = self.inner.set_advanced_event_selectors(input);
154        self
155    }
156    /// <p>The advanced event selectors used to select events for the event data store. You can configure up to five advanced event selectors for each event data store.</p>
157    pub fn get_advanced_event_selectors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AdvancedEventSelector>> {
158        self.inner.get_advanced_event_selectors()
159    }
160    /// <p>Specifies whether an event data store collects events from all Regions, or only from the Region in which it was created.</p>
161    pub fn multi_region_enabled(mut self, input: bool) -> Self {
162        self.inner = self.inner.multi_region_enabled(input);
163        self
164    }
165    /// <p>Specifies whether an event data store collects events from all Regions, or only from the Region in which it was created.</p>
166    pub fn set_multi_region_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
167        self.inner = self.inner.set_multi_region_enabled(input);
168        self
169    }
170    /// <p>Specifies whether an event data store collects events from all Regions, or only from the Region in which it was created.</p>
171    pub fn get_multi_region_enabled(&self) -> &::std::option::Option<bool> {
172        self.inner.get_multi_region_enabled()
173    }
174    /// <p>Specifies whether an event data store collects events logged for an organization in Organizations.</p><note>
175    /// <p>Only the management account for the organization can convert an organization event data store to a non-organization event data store, or convert a non-organization event data store to an organization event data store.</p>
176    /// </note>
177    pub fn organization_enabled(mut self, input: bool) -> Self {
178        self.inner = self.inner.organization_enabled(input);
179        self
180    }
181    /// <p>Specifies whether an event data store collects events logged for an organization in Organizations.</p><note>
182    /// <p>Only the management account for the organization can convert an organization event data store to a non-organization event data store, or convert a non-organization event data store to an organization event data store.</p>
183    /// </note>
184    pub fn set_organization_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
185        self.inner = self.inner.set_organization_enabled(input);
186        self
187    }
188    /// <p>Specifies whether an event data store collects events logged for an organization in Organizations.</p><note>
189    /// <p>Only the management account for the organization can convert an organization event data store to a non-organization event data store, or convert a non-organization event data store to an organization event data store.</p>
190    /// </note>
191    pub fn get_organization_enabled(&self) -> &::std::option::Option<bool> {
192        self.inner.get_organization_enabled()
193    }
194    /// <p>The retention period of the event data store, in days. If <code>BillingMode</code> is set to <code>EXTENDABLE_RETENTION_PRICING</code>, you can set a retention period of up to 3653 days, the equivalent of 10 years. If <code>BillingMode</code> is set to <code>FIXED_RETENTION_PRICING</code>, you can set a retention period of up to 2557 days, the equivalent of seven years.</p>
195    /// <p>CloudTrail Lake determines whether to retain an event by checking if the <code>eventTime</code> of the event is within the specified retention period. For example, if you set a retention period of 90 days, CloudTrail will remove events when the <code>eventTime</code> is older than 90 days.</p><note>
196    /// <p>If you decrease the retention period of an event data store, CloudTrail will remove any events with an <code>eventTime</code> older than the new retention period. For example, if the previous retention period was 365 days and you decrease it to 100 days, CloudTrail will remove events with an <code>eventTime</code> older than 100 days.</p>
197    /// </note>
198    pub fn retention_period(mut self, input: i32) -> Self {
199        self.inner = self.inner.retention_period(input);
200        self
201    }
202    /// <p>The retention period of the event data store, in days. If <code>BillingMode</code> is set to <code>EXTENDABLE_RETENTION_PRICING</code>, you can set a retention period of up to 3653 days, the equivalent of 10 years. If <code>BillingMode</code> is set to <code>FIXED_RETENTION_PRICING</code>, you can set a retention period of up to 2557 days, the equivalent of seven years.</p>
203    /// <p>CloudTrail Lake determines whether to retain an event by checking if the <code>eventTime</code> of the event is within the specified retention period. For example, if you set a retention period of 90 days, CloudTrail will remove events when the <code>eventTime</code> is older than 90 days.</p><note>
204    /// <p>If you decrease the retention period of an event data store, CloudTrail will remove any events with an <code>eventTime</code> older than the new retention period. For example, if the previous retention period was 365 days and you decrease it to 100 days, CloudTrail will remove events with an <code>eventTime</code> older than 100 days.</p>
205    /// </note>
206    pub fn set_retention_period(mut self, input: ::std::option::Option<i32>) -> Self {
207        self.inner = self.inner.set_retention_period(input);
208        self
209    }
210    /// <p>The retention period of the event data store, in days. If <code>BillingMode</code> is set to <code>EXTENDABLE_RETENTION_PRICING</code>, you can set a retention period of up to 3653 days, the equivalent of 10 years. If <code>BillingMode</code> is set to <code>FIXED_RETENTION_PRICING</code>, you can set a retention period of up to 2557 days, the equivalent of seven years.</p>
211    /// <p>CloudTrail Lake determines whether to retain an event by checking if the <code>eventTime</code> of the event is within the specified retention period. For example, if you set a retention period of 90 days, CloudTrail will remove events when the <code>eventTime</code> is older than 90 days.</p><note>
212    /// <p>If you decrease the retention period of an event data store, CloudTrail will remove any events with an <code>eventTime</code> older than the new retention period. For example, if the previous retention period was 365 days and you decrease it to 100 days, CloudTrail will remove events with an <code>eventTime</code> older than 100 days.</p>
213    /// </note>
214    pub fn get_retention_period(&self) -> &::std::option::Option<i32> {
215        self.inner.get_retention_period()
216    }
217    /// <p>Indicates that termination protection is enabled and the event data store cannot be automatically deleted.</p>
218    pub fn termination_protection_enabled(mut self, input: bool) -> Self {
219        self.inner = self.inner.termination_protection_enabled(input);
220        self
221    }
222    /// <p>Indicates that termination protection is enabled and the event data store cannot be automatically deleted.</p>
223    pub fn set_termination_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
224        self.inner = self.inner.set_termination_protection_enabled(input);
225        self
226    }
227    /// <p>Indicates that termination protection is enabled and the event data store cannot be automatically deleted.</p>
228    pub fn get_termination_protection_enabled(&self) -> &::std::option::Option<bool> {
229        self.inner.get_termination_protection_enabled()
230    }
231    /// <p>Specifies the KMS key ID to use to encrypt the events delivered by CloudTrail. The value can be an alias name prefixed by <code>alias/</code>, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.</p><important>
232    /// <p>Disabling or deleting the KMS key, or removing CloudTrail permissions on the key, prevents CloudTrail from logging events to the event data store, and prevents users from querying the data in the event data store that was encrypted with the key. After you associate an event data store with a KMS key, the KMS key cannot be removed or changed. Before you disable or delete a KMS key that you are using with an event data store, delete or back up your event data store.</p>
233    /// </important>
234    /// <p>CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">Using multi-Region keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
235    /// <p>Examples:</p>
236    /// <ul>
237    /// <li>
238    /// <p><code>alias/MyAliasName</code></p></li>
239    /// <li>
240    /// <p><code>arn:aws:kms:us-east-2:123456789012:alias/MyAliasName</code></p></li>
241    /// <li>
242    /// <p><code>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</code></p></li>
243    /// <li>
244    /// <p><code>12345678-1234-1234-1234-123456789012</code></p></li>
245    /// </ul>
246    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
247        self.inner = self.inner.kms_key_id(input.into());
248        self
249    }
250    /// <p>Specifies the KMS key ID to use to encrypt the events delivered by CloudTrail. The value can be an alias name prefixed by <code>alias/</code>, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.</p><important>
251    /// <p>Disabling or deleting the KMS key, or removing CloudTrail permissions on the key, prevents CloudTrail from logging events to the event data store, and prevents users from querying the data in the event data store that was encrypted with the key. After you associate an event data store with a KMS key, the KMS key cannot be removed or changed. Before you disable or delete a KMS key that you are using with an event data store, delete or back up your event data store.</p>
252    /// </important>
253    /// <p>CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">Using multi-Region keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
254    /// <p>Examples:</p>
255    /// <ul>
256    /// <li>
257    /// <p><code>alias/MyAliasName</code></p></li>
258    /// <li>
259    /// <p><code>arn:aws:kms:us-east-2:123456789012:alias/MyAliasName</code></p></li>
260    /// <li>
261    /// <p><code>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</code></p></li>
262    /// <li>
263    /// <p><code>12345678-1234-1234-1234-123456789012</code></p></li>
264    /// </ul>
265    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
266        self.inner = self.inner.set_kms_key_id(input);
267        self
268    }
269    /// <p>Specifies the KMS key ID to use to encrypt the events delivered by CloudTrail. The value can be an alias name prefixed by <code>alias/</code>, a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.</p><important>
270    /// <p>Disabling or deleting the KMS key, or removing CloudTrail permissions on the key, prevents CloudTrail from logging events to the event data store, and prevents users from querying the data in the event data store that was encrypted with the key. After you associate an event data store with a KMS key, the KMS key cannot be removed or changed. Before you disable or delete a KMS key that you are using with an event data store, delete or back up your event data store.</p>
271    /// </important>
272    /// <p>CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">Using multi-Region keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
273    /// <p>Examples:</p>
274    /// <ul>
275    /// <li>
276    /// <p><code>alias/MyAliasName</code></p></li>
277    /// <li>
278    /// <p><code>arn:aws:kms:us-east-2:123456789012:alias/MyAliasName</code></p></li>
279    /// <li>
280    /// <p><code>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</code></p></li>
281    /// <li>
282    /// <p><code>12345678-1234-1234-1234-123456789012</code></p></li>
283    /// </ul>
284    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
285        self.inner.get_kms_key_id()
286    }
287    /// <note>
288    /// <p>You can't change the billing mode from <code>EXTENDABLE_RETENTION_PRICING</code> to <code>FIXED_RETENTION_PRICING</code>. If <code>BillingMode</code> is set to <code>EXTENDABLE_RETENTION_PRICING</code> and you want to use <code>FIXED_RETENTION_PRICING</code> instead, you'll need to stop ingestion on the event data store and create a new event data store that uses <code>FIXED_RETENTION_PRICING</code>.</p>
289    /// </note>
290    /// <p>The billing mode for the event data store determines the cost for ingesting events and the default and maximum retention period for the event data store.</p>
291    /// <p>The following are the possible values:</p>
292    /// <ul>
293    /// <li>
294    /// <p><code>EXTENDABLE_RETENTION_PRICING</code> - This billing mode is generally recommended if you want a flexible retention period of up to 3653 days (about 10 years). The default retention period for this billing mode is 366 days.</p></li>
295    /// <li>
296    /// <p><code>FIXED_RETENTION_PRICING</code> - This billing mode is recommended if you expect to ingest more than 25 TB of event data per month and need a retention period of up to 2557 days (about 7 years). The default retention period for this billing mode is 2557 days.</p></li>
297    /// </ul>
298    /// <p>For more information about CloudTrail pricing, see <a href="http://aws.amazon.com/cloudtrail/pricing/">CloudTrail Pricing</a> and <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-manage-costs.html">Managing CloudTrail Lake costs</a>.</p>
299    pub fn billing_mode(mut self, input: crate::types::BillingMode) -> Self {
300        self.inner = self.inner.billing_mode(input);
301        self
302    }
303    /// <note>
304    /// <p>You can't change the billing mode from <code>EXTENDABLE_RETENTION_PRICING</code> to <code>FIXED_RETENTION_PRICING</code>. If <code>BillingMode</code> is set to <code>EXTENDABLE_RETENTION_PRICING</code> and you want to use <code>FIXED_RETENTION_PRICING</code> instead, you'll need to stop ingestion on the event data store and create a new event data store that uses <code>FIXED_RETENTION_PRICING</code>.</p>
305    /// </note>
306    /// <p>The billing mode for the event data store determines the cost for ingesting events and the default and maximum retention period for the event data store.</p>
307    /// <p>The following are the possible values:</p>
308    /// <ul>
309    /// <li>
310    /// <p><code>EXTENDABLE_RETENTION_PRICING</code> - This billing mode is generally recommended if you want a flexible retention period of up to 3653 days (about 10 years). The default retention period for this billing mode is 366 days.</p></li>
311    /// <li>
312    /// <p><code>FIXED_RETENTION_PRICING</code> - This billing mode is recommended if you expect to ingest more than 25 TB of event data per month and need a retention period of up to 2557 days (about 7 years). The default retention period for this billing mode is 2557 days.</p></li>
313    /// </ul>
314    /// <p>For more information about CloudTrail pricing, see <a href="http://aws.amazon.com/cloudtrail/pricing/">CloudTrail Pricing</a> and <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-manage-costs.html">Managing CloudTrail Lake costs</a>.</p>
315    pub fn set_billing_mode(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
316        self.inner = self.inner.set_billing_mode(input);
317        self
318    }
319    /// <note>
320    /// <p>You can't change the billing mode from <code>EXTENDABLE_RETENTION_PRICING</code> to <code>FIXED_RETENTION_PRICING</code>. If <code>BillingMode</code> is set to <code>EXTENDABLE_RETENTION_PRICING</code> and you want to use <code>FIXED_RETENTION_PRICING</code> instead, you'll need to stop ingestion on the event data store and create a new event data store that uses <code>FIXED_RETENTION_PRICING</code>.</p>
321    /// </note>
322    /// <p>The billing mode for the event data store determines the cost for ingesting events and the default and maximum retention period for the event data store.</p>
323    /// <p>The following are the possible values:</p>
324    /// <ul>
325    /// <li>
326    /// <p><code>EXTENDABLE_RETENTION_PRICING</code> - This billing mode is generally recommended if you want a flexible retention period of up to 3653 days (about 10 years). The default retention period for this billing mode is 366 days.</p></li>
327    /// <li>
328    /// <p><code>FIXED_RETENTION_PRICING</code> - This billing mode is recommended if you expect to ingest more than 25 TB of event data per month and need a retention period of up to 2557 days (about 7 years). The default retention period for this billing mode is 2557 days.</p></li>
329    /// </ul>
330    /// <p>For more information about CloudTrail pricing, see <a href="http://aws.amazon.com/cloudtrail/pricing/">CloudTrail Pricing</a> and <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-manage-costs.html">Managing CloudTrail Lake costs</a>.</p>
331    pub fn get_billing_mode(&self) -> &::std::option::Option<crate::types::BillingMode> {
332        self.inner.get_billing_mode()
333    }
334}