aws-sdk-cloudwatchlogs 0.25.1

AWS SDK for Amazon CloudWatch Logs
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents a cross-account destination that receives subscription log events.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Destination {
    /// <p>The name of the destination.</p>
    #[doc(hidden)]
    pub destination_name: std::option::Option<std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the physical target where the log events are delivered (for example, a Kinesis stream).</p>
    #[doc(hidden)]
    pub target_arn: std::option::Option<std::string::String>,
    /// <p>A role for impersonation, used when delivering log events to the target.</p>
    #[doc(hidden)]
    pub role_arn: std::option::Option<std::string::String>,
    /// <p>An IAM policy document that governs which Amazon Web Services accounts can create subscription filters against this destination.</p>
    #[doc(hidden)]
    pub access_policy: std::option::Option<std::string::String>,
    /// <p>The ARN of this destination.</p>
    #[doc(hidden)]
    pub arn: std::option::Option<std::string::String>,
    /// <p>The creation time of the destination, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
    #[doc(hidden)]
    pub creation_time: std::option::Option<i64>,
}
impl Destination {
    /// <p>The name of the destination.</p>
    pub fn destination_name(&self) -> std::option::Option<&str> {
        self.destination_name.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the physical target where the log events are delivered (for example, a Kinesis stream).</p>
    pub fn target_arn(&self) -> std::option::Option<&str> {
        self.target_arn.as_deref()
    }
    /// <p>A role for impersonation, used when delivering log events to the target.</p>
    pub fn role_arn(&self) -> std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// <p>An IAM policy document that governs which Amazon Web Services accounts can create subscription filters against this destination.</p>
    pub fn access_policy(&self) -> std::option::Option<&str> {
        self.access_policy.as_deref()
    }
    /// <p>The ARN of this destination.</p>
    pub fn arn(&self) -> std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The creation time of the destination, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
    pub fn creation_time(&self) -> std::option::Option<i64> {
        self.creation_time
    }
}
impl Destination {
    /// Creates a new builder-style object to manufacture [`Destination`](crate::types::Destination).
    pub fn builder() -> crate::types::builders::DestinationBuilder {
        crate::types::builders::DestinationBuilder::default()
    }
}

/// A builder for [`Destination`](crate::types::Destination).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct DestinationBuilder {
    pub(crate) destination_name: std::option::Option<std::string::String>,
    pub(crate) target_arn: std::option::Option<std::string::String>,
    pub(crate) role_arn: std::option::Option<std::string::String>,
    pub(crate) access_policy: std::option::Option<std::string::String>,
    pub(crate) arn: std::option::Option<std::string::String>,
    pub(crate) creation_time: std::option::Option<i64>,
}
impl DestinationBuilder {
    /// <p>The name of the destination.</p>
    pub fn destination_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.destination_name = Some(input.into());
        self
    }
    /// <p>The name of the destination.</p>
    pub fn set_destination_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.destination_name = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the physical target where the log events are delivered (for example, a Kinesis stream).</p>
    pub fn target_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.target_arn = Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the physical target where the log events are delivered (for example, a Kinesis stream).</p>
    pub fn set_target_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.target_arn = input;
        self
    }
    /// <p>A role for impersonation, used when delivering log events to the target.</p>
    pub fn role_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.role_arn = Some(input.into());
        self
    }
    /// <p>A role for impersonation, used when delivering log events to the target.</p>
    pub fn set_role_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// <p>An IAM policy document that governs which Amazon Web Services accounts can create subscription filters against this destination.</p>
    pub fn access_policy(mut self, input: impl Into<std::string::String>) -> Self {
        self.access_policy = Some(input.into());
        self
    }
    /// <p>An IAM policy document that governs which Amazon Web Services accounts can create subscription filters against this destination.</p>
    pub fn set_access_policy(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.access_policy = input;
        self
    }
    /// <p>The ARN of this destination.</p>
    pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.arn = Some(input.into());
        self
    }
    /// <p>The ARN of this destination.</p>
    pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The creation time of the destination, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
    pub fn creation_time(mut self, input: i64) -> Self {
        self.creation_time = Some(input);
        self
    }
    /// <p>The creation time of the destination, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
    pub fn set_creation_time(mut self, input: std::option::Option<i64>) -> Self {
        self.creation_time = input;
        self
    }
    /// Consumes the builder and constructs a [`Destination`](crate::types::Destination).
    pub fn build(self) -> crate::types::Destination {
        crate::types::Destination {
            destination_name: self.destination_name,
            target_arn: self.target_arn,
            role_arn: self.role_arn,
            access_policy: self.access_policy,
            arn: self.arn,
            creation_time: self.creation_time,
        }
    }
}