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::get_insight_selectors::_get_insight_selectors_input::GetInsightSelectorsInputBuilder;

pub use crate::operation::get_insight_selectors::_get_insight_selectors_output::GetInsightSelectorsOutputBuilder;

impl crate::operation::get_insight_selectors::builders::GetInsightSelectorsInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::get_insight_selectors::GetInsightSelectorsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_insight_selectors::GetInsightSelectorsError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.get_insight_selectors();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `GetInsightSelectors`.
///
/// <p>Describes the settings for the Insights event selectors that you configured for your trail or event data store. <code>GetInsightSelectors</code> shows if CloudTrail Insights logging is enabled and which Insights types are configured with corresponding event categories. If you run <code>GetInsightSelectors</code> on a trail or event data store that does not have Insights events enabled, the operation throws the exception <code>InsightNotEnabledException</code></p>
/// <p>Specify either the <code>EventDataStore</code> parameter to get Insights event selectors for an event data store, or the <code>TrailName</code> parameter to the get Insights event selectors for a trail. You cannot specify these parameters together.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-insights-events-with-cloudtrail.html">Working with CloudTrail Insights</a> in the <i>CloudTrail User Guide</i>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetInsightSelectorsFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::get_insight_selectors::builders::GetInsightSelectorsInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::get_insight_selectors::GetInsightSelectorsOutput,
        crate::operation::get_insight_selectors::GetInsightSelectorsError,
    > for GetInsightSelectorsFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::get_insight_selectors::GetInsightSelectorsOutput,
            crate::operation::get_insight_selectors::GetInsightSelectorsError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl GetInsightSelectorsFluentBuilder {
    /// Creates a new `GetInsightSelectorsFluentBuilder`.
    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 GetInsightSelectors as a reference.
    pub fn as_input(&self) -> &crate::operation::get_insight_selectors::builders::GetInsightSelectorsInputBuilder {
        &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::get_insight_selectors::GetInsightSelectorsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_insight_selectors::GetInsightSelectorsError,
            ::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::get_insight_selectors::GetInsightSelectors::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::get_insight_selectors::GetInsightSelectors::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::get_insight_selectors::GetInsightSelectorsOutput,
        crate::operation::get_insight_selectors::GetInsightSelectorsError,
        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>Specifies the name of the trail or trail ARN. If you specify a trail name, the string must meet the following requirements:</p>
    /// <ul>
    /// <li>
    /// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
    /// <li>
    /// <p>Start with a letter or number, and end with a letter or number</p></li>
    /// <li>
    /// <p>Be between 3 and 128 characters</p></li>
    /// <li>
    /// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
    /// <li>
    /// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
    /// </ul>
    /// <p>If you specify a trail ARN, it must be in the format:</p>
    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
    /// <p>You cannot use this parameter with the <code>EventDataStore</code> parameter.</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>Specifies the name of the trail or trail ARN. If you specify a trail name, the string must meet the following requirements:</p>
    /// <ul>
    /// <li>
    /// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
    /// <li>
    /// <p>Start with a letter or number, and end with a letter or number</p></li>
    /// <li>
    /// <p>Be between 3 and 128 characters</p></li>
    /// <li>
    /// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
    /// <li>
    /// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
    /// </ul>
    /// <p>If you specify a trail ARN, it must be in the format:</p>
    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
    /// <p>You cannot use this parameter with the <code>EventDataStore</code> parameter.</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>Specifies the name of the trail or trail ARN. If you specify a trail name, the string must meet the following requirements:</p>
    /// <ul>
    /// <li>
    /// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
    /// <li>
    /// <p>Start with a letter or number, and end with a letter or number</p></li>
    /// <li>
    /// <p>Be between 3 and 128 characters</p></li>
    /// <li>
    /// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
    /// <li>
    /// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
    /// </ul>
    /// <p>If you specify a trail ARN, it must be in the format:</p>
    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
    /// <p>You cannot use this parameter with the <code>EventDataStore</code> parameter.</p>
    pub fn get_trail_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_trail_name()
    }
    /// <p>Specifies the ARN (or ID suffix of the ARN) of the event data store for which you want to get Insights selectors.</p>
    /// <p>You cannot use this parameter with the <code>TrailName</code> parameter.</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>Specifies the ARN (or ID suffix of the ARN) of the event data store for which you want to get Insights selectors.</p>
    /// <p>You cannot use this parameter with the <code>TrailName</code> parameter.</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>Specifies the ARN (or ID suffix of the ARN) of the event data store for which you want to get Insights selectors.</p>
    /// <p>You cannot use this parameter with the <code>TrailName</code> parameter.</p>
    pub fn get_event_data_store(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_event_data_store()
    }
}