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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutRetentionPolicyInput {
    /// <p>The name of the log group.</p>
    #[doc(hidden)]
    pub log_group_name: std::option::Option<std::string::String>,
    /// <p>The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 2192, 2557, 2922, 3288, and 3653.</p>
    /// <p>To set a log group so that its log events do not expire, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html">DeleteRetentionPolicy</a>. </p>
    #[doc(hidden)]
    pub retention_in_days: std::option::Option<i32>,
}
impl PutRetentionPolicyInput {
    /// <p>The name of the log group.</p>
    pub fn log_group_name(&self) -> std::option::Option<&str> {
        self.log_group_name.as_deref()
    }
    /// <p>The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 2192, 2557, 2922, 3288, and 3653.</p>
    /// <p>To set a log group so that its log events do not expire, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html">DeleteRetentionPolicy</a>. </p>
    pub fn retention_in_days(&self) -> std::option::Option<i32> {
        self.retention_in_days
    }
}
impl PutRetentionPolicyInput {
    /// Creates a new builder-style object to manufacture [`PutRetentionPolicyInput`](crate::operation::put_retention_policy::PutRetentionPolicyInput).
    pub fn builder(
    ) -> crate::operation::put_retention_policy::builders::PutRetentionPolicyInputBuilder {
        crate::operation::put_retention_policy::builders::PutRetentionPolicyInputBuilder::default()
    }
}

/// A builder for [`PutRetentionPolicyInput`](crate::operation::put_retention_policy::PutRetentionPolicyInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct PutRetentionPolicyInputBuilder {
    pub(crate) log_group_name: std::option::Option<std::string::String>,
    pub(crate) retention_in_days: std::option::Option<i32>,
}
impl PutRetentionPolicyInputBuilder {
    /// <p>The name of the log group.</p>
    pub fn log_group_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.log_group_name = Some(input.into());
        self
    }
    /// <p>The name of the log group.</p>
    pub fn set_log_group_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.log_group_name = input;
        self
    }
    /// <p>The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 2192, 2557, 2922, 3288, and 3653.</p>
    /// <p>To set a log group so that its log events do not expire, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html">DeleteRetentionPolicy</a>. </p>
    pub fn retention_in_days(mut self, input: i32) -> Self {
        self.retention_in_days = Some(input);
        self
    }
    /// <p>The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 2192, 2557, 2922, 3288, and 3653.</p>
    /// <p>To set a log group so that its log events do not expire, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html">DeleteRetentionPolicy</a>. </p>
    pub fn set_retention_in_days(mut self, input: std::option::Option<i32>) -> Self {
        self.retention_in_days = input;
        self
    }
    /// Consumes the builder and constructs a [`PutRetentionPolicyInput`](crate::operation::put_retention_policy::PutRetentionPolicyInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::put_retention_policy::PutRetentionPolicyInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(
            crate::operation::put_retention_policy::PutRetentionPolicyInput {
                log_group_name: self.log_group_name,
                retention_in_days: self.retention_in_days,
            },
        )
    }
}