1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p><b>[Custom AMI policies only]</b> Specifies an AMI deprecation rule for cross-Region AMI copies created by an AMI policy.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CrossRegionCopyDeprecateRule {
    /// <p>The period after which to deprecate the cross-Region AMI copies. The period must be less than or equal to the cross-Region AMI copy retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.</p>
    pub interval: ::std::option::Option<i32>,
    /// <p>The unit of time in which to measure the <b>Interval</b>. For example, to deprecate a cross-Region AMI copy after 3 months, specify <code>Interval=3</code> and <code>IntervalUnit=MONTHS</code>.</p>
    pub interval_unit: ::std::option::Option<crate::types::RetentionIntervalUnitValues>,
}
impl CrossRegionCopyDeprecateRule {
    /// <p>The period after which to deprecate the cross-Region AMI copies. The period must be less than or equal to the cross-Region AMI copy retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.</p>
    pub fn interval(&self) -> ::std::option::Option<i32> {
        self.interval
    }
    /// <p>The unit of time in which to measure the <b>Interval</b>. For example, to deprecate a cross-Region AMI copy after 3 months, specify <code>Interval=3</code> and <code>IntervalUnit=MONTHS</code>.</p>
    pub fn interval_unit(&self) -> ::std::option::Option<&crate::types::RetentionIntervalUnitValues> {
        self.interval_unit.as_ref()
    }
}
impl CrossRegionCopyDeprecateRule {
    /// Creates a new builder-style object to manufacture [`CrossRegionCopyDeprecateRule`](crate::types::CrossRegionCopyDeprecateRule).
    pub fn builder() -> crate::types::builders::CrossRegionCopyDeprecateRuleBuilder {
        crate::types::builders::CrossRegionCopyDeprecateRuleBuilder::default()
    }
}

/// A builder for [`CrossRegionCopyDeprecateRule`](crate::types::CrossRegionCopyDeprecateRule).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CrossRegionCopyDeprecateRuleBuilder {
    pub(crate) interval: ::std::option::Option<i32>,
    pub(crate) interval_unit: ::std::option::Option<crate::types::RetentionIntervalUnitValues>,
}
impl CrossRegionCopyDeprecateRuleBuilder {
    /// <p>The period after which to deprecate the cross-Region AMI copies. The period must be less than or equal to the cross-Region AMI copy retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.</p>
    pub fn interval(mut self, input: i32) -> Self {
        self.interval = ::std::option::Option::Some(input);
        self
    }
    /// <p>The period after which to deprecate the cross-Region AMI copies. The period must be less than or equal to the cross-Region AMI copy retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.</p>
    pub fn set_interval(mut self, input: ::std::option::Option<i32>) -> Self {
        self.interval = input;
        self
    }
    /// <p>The period after which to deprecate the cross-Region AMI copies. The period must be less than or equal to the cross-Region AMI copy retention period, and it can't be greater than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.</p>
    pub fn get_interval(&self) -> &::std::option::Option<i32> {
        &self.interval
    }
    /// <p>The unit of time in which to measure the <b>Interval</b>. For example, to deprecate a cross-Region AMI copy after 3 months, specify <code>Interval=3</code> and <code>IntervalUnit=MONTHS</code>.</p>
    pub fn interval_unit(mut self, input: crate::types::RetentionIntervalUnitValues) -> Self {
        self.interval_unit = ::std::option::Option::Some(input);
        self
    }
    /// <p>The unit of time in which to measure the <b>Interval</b>. For example, to deprecate a cross-Region AMI copy after 3 months, specify <code>Interval=3</code> and <code>IntervalUnit=MONTHS</code>.</p>
    pub fn set_interval_unit(mut self, input: ::std::option::Option<crate::types::RetentionIntervalUnitValues>) -> Self {
        self.interval_unit = input;
        self
    }
    /// <p>The unit of time in which to measure the <b>Interval</b>. For example, to deprecate a cross-Region AMI copy after 3 months, specify <code>Interval=3</code> and <code>IntervalUnit=MONTHS</code>.</p>
    pub fn get_interval_unit(&self) -> &::std::option::Option<crate::types::RetentionIntervalUnitValues> {
        &self.interval_unit
    }
    /// Consumes the builder and constructs a [`CrossRegionCopyDeprecateRule`](crate::types::CrossRegionCopyDeprecateRule).
    pub fn build(self) -> crate::types::CrossRegionCopyDeprecateRule {
        crate::types::CrossRegionCopyDeprecateRule {
            interval: self.interval,
            interval_unit: self.interval_unit,
        }
    }
}