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.

/// <p>Returns information about the trail.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribeTrailsInput {
    /// <p>Specifies a list of trail names, trail ARNs, or both, of the trails to describe. The format of a trail ARN is:</p>
    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
    /// <p>If an empty list is specified, information for the trail in the current Region is returned.</p>
    /// <ul>
    /// <li>
    /// <p>If an empty list is specified and <code>IncludeShadowTrails</code> is false, then information for all trails in the current Region is returned.</p></li>
    /// <li>
    /// <p>If an empty list is specified and IncludeShadowTrails is null or true, then information for all trails in the current Region and any associated shadow trails in other Regions is returned.</p></li>
    /// </ul><note>
    /// <p>If one or more trail names are specified, information is returned only if the names match the names of trails belonging only to the current Region and current account. To return information about a trail in another Region, you must specify its trail ARN.</p>
    /// </note>
    pub trail_name_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Specifies whether to include shadow trails in the response. A shadow trail is the replication in a Region of a trail that was created in a different Region, or in the case of an organization trail, the replication of an organization trail in member accounts. If you do not include shadow trails, organization trails in a member account and Region replication trails will not be returned. The default is true.</p>
    pub include_shadow_trails: ::std::option::Option<bool>,
}
impl DescribeTrailsInput {
    /// <p>Specifies a list of trail names, trail ARNs, or both, of the trails to describe. The format of a trail ARN is:</p>
    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
    /// <p>If an empty list is specified, information for the trail in the current Region is returned.</p>
    /// <ul>
    /// <li>
    /// <p>If an empty list is specified and <code>IncludeShadowTrails</code> is false, then information for all trails in the current Region is returned.</p></li>
    /// <li>
    /// <p>If an empty list is specified and IncludeShadowTrails is null or true, then information for all trails in the current Region and any associated shadow trails in other Regions is returned.</p></li>
    /// </ul><note>
    /// <p>If one or more trail names are specified, information is returned only if the names match the names of trails belonging only to the current Region and current account. To return information about a trail in another Region, you must specify its trail ARN.</p>
    /// </note>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.trail_name_list.is_none()`.
    pub fn trail_name_list(&self) -> &[::std::string::String] {
        self.trail_name_list.as_deref().unwrap_or_default()
    }
    /// <p>Specifies whether to include shadow trails in the response. A shadow trail is the replication in a Region of a trail that was created in a different Region, or in the case of an organization trail, the replication of an organization trail in member accounts. If you do not include shadow trails, organization trails in a member account and Region replication trails will not be returned. The default is true.</p>
    pub fn include_shadow_trails(&self) -> ::std::option::Option<bool> {
        self.include_shadow_trails
    }
}
impl DescribeTrailsInput {
    /// Creates a new builder-style object to manufacture [`DescribeTrailsInput`](crate::operation::describe_trails::DescribeTrailsInput).
    pub fn builder() -> crate::operation::describe_trails::builders::DescribeTrailsInputBuilder {
        crate::operation::describe_trails::builders::DescribeTrailsInputBuilder::default()
    }
}

/// A builder for [`DescribeTrailsInput`](crate::operation::describe_trails::DescribeTrailsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeTrailsInputBuilder {
    pub(crate) trail_name_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) include_shadow_trails: ::std::option::Option<bool>,
}
impl DescribeTrailsInputBuilder {
    /// Appends an item to `trail_name_list`.
    ///
    /// To override the contents of this collection use [`set_trail_name_list`](Self::set_trail_name_list).
    ///
    /// <p>Specifies a list of trail names, trail ARNs, or both, of the trails to describe. The format of a trail ARN is:</p>
    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
    /// <p>If an empty list is specified, information for the trail in the current Region is returned.</p>
    /// <ul>
    /// <li>
    /// <p>If an empty list is specified and <code>IncludeShadowTrails</code> is false, then information for all trails in the current Region is returned.</p></li>
    /// <li>
    /// <p>If an empty list is specified and IncludeShadowTrails is null or true, then information for all trails in the current Region and any associated shadow trails in other Regions is returned.</p></li>
    /// </ul><note>
    /// <p>If one or more trail names are specified, information is returned only if the names match the names of trails belonging only to the current Region and current account. To return information about a trail in another Region, you must specify its trail ARN.</p>
    /// </note>
    pub fn trail_name_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.trail_name_list.unwrap_or_default();
        v.push(input.into());
        self.trail_name_list = ::std::option::Option::Some(v);
        self
    }
    /// <p>Specifies a list of trail names, trail ARNs, or both, of the trails to describe. The format of a trail ARN is:</p>
    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
    /// <p>If an empty list is specified, information for the trail in the current Region is returned.</p>
    /// <ul>
    /// <li>
    /// <p>If an empty list is specified and <code>IncludeShadowTrails</code> is false, then information for all trails in the current Region is returned.</p></li>
    /// <li>
    /// <p>If an empty list is specified and IncludeShadowTrails is null or true, then information for all trails in the current Region and any associated shadow trails in other Regions is returned.</p></li>
    /// </ul><note>
    /// <p>If one or more trail names are specified, information is returned only if the names match the names of trails belonging only to the current Region and current account. To return information about a trail in another Region, you must specify its trail ARN.</p>
    /// </note>
    pub fn set_trail_name_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.trail_name_list = input;
        self
    }
    /// <p>Specifies a list of trail names, trail ARNs, or both, of the trails to describe. The format of a trail ARN is:</p>
    /// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
    /// <p>If an empty list is specified, information for the trail in the current Region is returned.</p>
    /// <ul>
    /// <li>
    /// <p>If an empty list is specified and <code>IncludeShadowTrails</code> is false, then information for all trails in the current Region is returned.</p></li>
    /// <li>
    /// <p>If an empty list is specified and IncludeShadowTrails is null or true, then information for all trails in the current Region and any associated shadow trails in other Regions is returned.</p></li>
    /// </ul><note>
    /// <p>If one or more trail names are specified, information is returned only if the names match the names of trails belonging only to the current Region and current account. To return information about a trail in another Region, you must specify its trail ARN.</p>
    /// </note>
    pub fn get_trail_name_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.trail_name_list
    }
    /// <p>Specifies whether to include shadow trails in the response. A shadow trail is the replication in a Region of a trail that was created in a different Region, or in the case of an organization trail, the replication of an organization trail in member accounts. If you do not include shadow trails, organization trails in a member account and Region replication trails will not be returned. The default is true.</p>
    pub fn include_shadow_trails(mut self, input: bool) -> Self {
        self.include_shadow_trails = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether to include shadow trails in the response. A shadow trail is the replication in a Region of a trail that was created in a different Region, or in the case of an organization trail, the replication of an organization trail in member accounts. If you do not include shadow trails, organization trails in a member account and Region replication trails will not be returned. The default is true.</p>
    pub fn set_include_shadow_trails(mut self, input: ::std::option::Option<bool>) -> Self {
        self.include_shadow_trails = input;
        self
    }
    /// <p>Specifies whether to include shadow trails in the response. A shadow trail is the replication in a Region of a trail that was created in a different Region, or in the case of an organization trail, the replication of an organization trail in member accounts. If you do not include shadow trails, organization trails in a member account and Region replication trails will not be returned. The default is true.</p>
    pub fn get_include_shadow_trails(&self) -> &::std::option::Option<bool> {
        &self.include_shadow_trails
    }
    /// Consumes the builder and constructs a [`DescribeTrailsInput`](crate::operation::describe_trails::DescribeTrailsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::describe_trails::DescribeTrailsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::describe_trails::DescribeTrailsInput {
            trail_name_list: self.trail_name_list,
            include_shadow_trails: self.include_shadow_trails,
        })
    }
}