aws-sdk-backup 1.109.0

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

/// <p>Specifies the time period, in days, before a recovery point transitions to cold storage or is deleted.</p>
/// <p>Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, on the console, the retention setting must be 90 days greater than the transition to cold after days setting. The transition to cold after days setting can't be changed after a backup has been transitioned to cold.</p>
/// <p>Resource types that can transition to cold storage are listed in the <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/backup-feature-availability.html#features-by-resource">Feature availability by resource</a> table. Backup ignores this expression for other resource types.</p>
/// <p>To remove the existing lifecycle and retention periods and keep your recovery points indefinitely, specify -1 for <code>MoveToColdStorageAfterDays</code> and <code>DeleteAfterDays</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Lifecycle {
    /// <p>The number of days after creation that a recovery point is moved to cold storage.</p>
    pub move_to_cold_storage_after_days: ::std::option::Option<i64>,
    /// <p>The number of days after creation that a recovery point is deleted. This value must be at least 90 days after the number of days specified in <code>MoveToColdStorageAfterDays</code>.</p>
    pub delete_after_days: ::std::option::Option<i64>,
    /// <p>If the value is true, your backup plan transitions supported resources to archive (cold) storage tier in accordance with your lifecycle settings.</p>
    pub opt_in_to_archive_for_supported_resources: ::std::option::Option<bool>,
    /// <p>The event after which a recovery point is deleted. A recovery point with both <code>DeleteAfterDays</code> and <code>DeleteAfterEvent</code> will delete after whichever condition is satisfied first. Not valid as an input.</p>
    pub delete_after_event: ::std::option::Option<crate::types::LifecycleDeleteAfterEvent>,
}
impl Lifecycle {
    /// <p>The number of days after creation that a recovery point is moved to cold storage.</p>
    pub fn move_to_cold_storage_after_days(&self) -> ::std::option::Option<i64> {
        self.move_to_cold_storage_after_days
    }
    /// <p>The number of days after creation that a recovery point is deleted. This value must be at least 90 days after the number of days specified in <code>MoveToColdStorageAfterDays</code>.</p>
    pub fn delete_after_days(&self) -> ::std::option::Option<i64> {
        self.delete_after_days
    }
    /// <p>If the value is true, your backup plan transitions supported resources to archive (cold) storage tier in accordance with your lifecycle settings.</p>
    pub fn opt_in_to_archive_for_supported_resources(&self) -> ::std::option::Option<bool> {
        self.opt_in_to_archive_for_supported_resources
    }
    /// <p>The event after which a recovery point is deleted. A recovery point with both <code>DeleteAfterDays</code> and <code>DeleteAfterEvent</code> will delete after whichever condition is satisfied first. Not valid as an input.</p>
    pub fn delete_after_event(&self) -> ::std::option::Option<&crate::types::LifecycleDeleteAfterEvent> {
        self.delete_after_event.as_ref()
    }
}
impl Lifecycle {
    /// Creates a new builder-style object to manufacture [`Lifecycle`](crate::types::Lifecycle).
    pub fn builder() -> crate::types::builders::LifecycleBuilder {
        crate::types::builders::LifecycleBuilder::default()
    }
}

/// A builder for [`Lifecycle`](crate::types::Lifecycle).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct LifecycleBuilder {
    pub(crate) move_to_cold_storage_after_days: ::std::option::Option<i64>,
    pub(crate) delete_after_days: ::std::option::Option<i64>,
    pub(crate) opt_in_to_archive_for_supported_resources: ::std::option::Option<bool>,
    pub(crate) delete_after_event: ::std::option::Option<crate::types::LifecycleDeleteAfterEvent>,
}
impl LifecycleBuilder {
    /// <p>The number of days after creation that a recovery point is moved to cold storage.</p>
    pub fn move_to_cold_storage_after_days(mut self, input: i64) -> Self {
        self.move_to_cold_storage_after_days = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of days after creation that a recovery point is moved to cold storage.</p>
    pub fn set_move_to_cold_storage_after_days(mut self, input: ::std::option::Option<i64>) -> Self {
        self.move_to_cold_storage_after_days = input;
        self
    }
    /// <p>The number of days after creation that a recovery point is moved to cold storage.</p>
    pub fn get_move_to_cold_storage_after_days(&self) -> &::std::option::Option<i64> {
        &self.move_to_cold_storage_after_days
    }
    /// <p>The number of days after creation that a recovery point is deleted. This value must be at least 90 days after the number of days specified in <code>MoveToColdStorageAfterDays</code>.</p>
    pub fn delete_after_days(mut self, input: i64) -> Self {
        self.delete_after_days = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of days after creation that a recovery point is deleted. This value must be at least 90 days after the number of days specified in <code>MoveToColdStorageAfterDays</code>.</p>
    pub fn set_delete_after_days(mut self, input: ::std::option::Option<i64>) -> Self {
        self.delete_after_days = input;
        self
    }
    /// <p>The number of days after creation that a recovery point is deleted. This value must be at least 90 days after the number of days specified in <code>MoveToColdStorageAfterDays</code>.</p>
    pub fn get_delete_after_days(&self) -> &::std::option::Option<i64> {
        &self.delete_after_days
    }
    /// <p>If the value is true, your backup plan transitions supported resources to archive (cold) storage tier in accordance with your lifecycle settings.</p>
    pub fn opt_in_to_archive_for_supported_resources(mut self, input: bool) -> Self {
        self.opt_in_to_archive_for_supported_resources = ::std::option::Option::Some(input);
        self
    }
    /// <p>If the value is true, your backup plan transitions supported resources to archive (cold) storage tier in accordance with your lifecycle settings.</p>
    pub fn set_opt_in_to_archive_for_supported_resources(mut self, input: ::std::option::Option<bool>) -> Self {
        self.opt_in_to_archive_for_supported_resources = input;
        self
    }
    /// <p>If the value is true, your backup plan transitions supported resources to archive (cold) storage tier in accordance with your lifecycle settings.</p>
    pub fn get_opt_in_to_archive_for_supported_resources(&self) -> &::std::option::Option<bool> {
        &self.opt_in_to_archive_for_supported_resources
    }
    /// <p>The event after which a recovery point is deleted. A recovery point with both <code>DeleteAfterDays</code> and <code>DeleteAfterEvent</code> will delete after whichever condition is satisfied first. Not valid as an input.</p>
    pub fn delete_after_event(mut self, input: crate::types::LifecycleDeleteAfterEvent) -> Self {
        self.delete_after_event = ::std::option::Option::Some(input);
        self
    }
    /// <p>The event after which a recovery point is deleted. A recovery point with both <code>DeleteAfterDays</code> and <code>DeleteAfterEvent</code> will delete after whichever condition is satisfied first. Not valid as an input.</p>
    pub fn set_delete_after_event(mut self, input: ::std::option::Option<crate::types::LifecycleDeleteAfterEvent>) -> Self {
        self.delete_after_event = input;
        self
    }
    /// <p>The event after which a recovery point is deleted. A recovery point with both <code>DeleteAfterDays</code> and <code>DeleteAfterEvent</code> will delete after whichever condition is satisfied first. Not valid as an input.</p>
    pub fn get_delete_after_event(&self) -> &::std::option::Option<crate::types::LifecycleDeleteAfterEvent> {
        &self.delete_after_event
    }
    /// Consumes the builder and constructs a [`Lifecycle`](crate::types::Lifecycle).
    pub fn build(self) -> crate::types::Lifecycle {
        crate::types::Lifecycle {
            move_to_cold_storage_after_days: self.move_to_cold_storage_after_days,
            delete_after_days: self.delete_after_days,
            opt_in_to_archive_for_supported_resources: self.opt_in_to_archive_for_supported_resources,
            delete_after_event: self.delete_after_event,
        }
    }
}