aws-sdk-cloudtrail 1.104.0

AWS SDK for AWS CloudTrail
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::put_event_configuration::_put_event_configuration_input::PutEventConfigurationInputBuilder;

pub use crate::operation::put_event_configuration::_put_event_configuration_output::PutEventConfigurationOutputBuilder;

impl crate::operation::put_event_configuration::builders::PutEventConfigurationInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::put_event_configuration::PutEventConfigurationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_event_configuration::PutEventConfigurationError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.put_event_configuration();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `PutEventConfiguration`.
///
/// <p>Updates the event configuration settings for the specified event data store or trail. This operation supports updating the maximum event size, adding or modifying context key selectors for event data store, and configuring aggregation settings for the trail.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PutEventConfigurationFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::put_event_configuration::builders::PutEventConfigurationInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::put_event_configuration::PutEventConfigurationOutput,
        crate::operation::put_event_configuration::PutEventConfigurationError,
    > for PutEventConfigurationFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::put_event_configuration::PutEventConfigurationOutput,
            crate::operation::put_event_configuration::PutEventConfigurationError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl PutEventConfigurationFluentBuilder {
    /// Creates a new `PutEventConfigurationFluentBuilder`.
    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 PutEventConfiguration as a reference.
    pub fn as_input(&self) -> &crate::operation::put_event_configuration::builders::PutEventConfigurationInputBuilder {
        &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::put_event_configuration::PutEventConfigurationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_event_configuration::PutEventConfigurationError,
            ::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::put_event_configuration::PutEventConfiguration::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::put_event_configuration::PutEventConfiguration::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::put_event_configuration::PutEventConfigurationOutput,
        crate::operation::put_event_configuration::PutEventConfigurationError,
        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
    }
    /// <p>The name of the trail for which you want to update event configuration settings.</p>
    pub fn trail_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.trail_name(input.into());
        self
    }
    /// <p>The name of the trail for which you want to update event configuration settings.</p>
    pub fn set_trail_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_trail_name(input);
        self
    }
    /// <p>The name of the trail for which you want to update event configuration settings.</p>
    pub fn get_trail_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_trail_name()
    }
    /// <p>The Amazon Resource Name (ARN) or ID suffix of the ARN of the event data store for which event configuration settings are updated.</p>
    pub fn event_data_store(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.event_data_store(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) or ID suffix of the ARN of the event data store for which event configuration settings are updated.</p>
    pub fn set_event_data_store(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_event_data_store(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) or ID suffix of the ARN of the event data store for which event configuration settings are updated.</p>
    pub fn get_event_data_store(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_event_data_store()
    }
    /// <p>The maximum allowed size for events to be stored in the specified event data store. If you are using context key selectors, MaxEventSize must be set to Large.</p>
    pub fn max_event_size(mut self, input: crate::types::MaxEventSize) -> Self {
        self.inner = self.inner.max_event_size(input);
        self
    }
    /// <p>The maximum allowed size for events to be stored in the specified event data store. If you are using context key selectors, MaxEventSize must be set to Large.</p>
    pub fn set_max_event_size(mut self, input: ::std::option::Option<crate::types::MaxEventSize>) -> Self {
        self.inner = self.inner.set_max_event_size(input);
        self
    }
    /// <p>The maximum allowed size for events to be stored in the specified event data store. If you are using context key selectors, MaxEventSize must be set to Large.</p>
    pub fn get_max_event_size(&self) -> &::std::option::Option<crate::types::MaxEventSize> {
        self.inner.get_max_event_size()
    }
    ///
    /// Appends an item to `ContextKeySelectors`.
    ///
    /// To override the contents of this collection use [`set_context_key_selectors`](Self::set_context_key_selectors).
    ///
    /// <p>A list of context key selectors that will be included to provide enriched event data.</p>
    pub fn context_key_selectors(mut self, input: crate::types::ContextKeySelector) -> Self {
        self.inner = self.inner.context_key_selectors(input);
        self
    }
    /// <p>A list of context key selectors that will be included to provide enriched event data.</p>
    pub fn set_context_key_selectors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ContextKeySelector>>) -> Self {
        self.inner = self.inner.set_context_key_selectors(input);
        self
    }
    /// <p>A list of context key selectors that will be included to provide enriched event data.</p>
    pub fn get_context_key_selectors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ContextKeySelector>> {
        self.inner.get_context_key_selectors()
    }
    ///
    /// Appends an item to `AggregationConfigurations`.
    ///
    /// To override the contents of this collection use [`set_aggregation_configurations`](Self::set_aggregation_configurations).
    ///
    /// <p>The list of aggregation configurations that you want to configure for the trail.</p>
    pub fn aggregation_configurations(mut self, input: crate::types::AggregationConfiguration) -> Self {
        self.inner = self.inner.aggregation_configurations(input);
        self
    }
    /// <p>The list of aggregation configurations that you want to configure for the trail.</p>
    pub fn set_aggregation_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AggregationConfiguration>>) -> Self {
        self.inner = self.inner.set_aggregation_configurations(input);
        self
    }
    /// <p>The list of aggregation configurations that you want to configure for the trail.</p>
    pub fn get_aggregation_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AggregationConfiguration>> {
        self.inner.get_aggregation_configurations()
    }
}