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>How long, in days, message data is kept.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RetentionPeriod {
    /// <p>If true, message data is kept indefinitely.</p>
    pub unlimited: bool,
    /// <p>The number of days that message data is kept. The <code>unlimited</code> parameter must be false.</p>
    pub number_of_days: ::std::option::Option<i32>,
}
impl RetentionPeriod {
    /// <p>If true, message data is kept indefinitely.</p>
    pub fn unlimited(&self) -> bool {
        self.unlimited
    }
    /// <p>The number of days that message data is kept. The <code>unlimited</code> parameter must be false.</p>
    pub fn number_of_days(&self) -> ::std::option::Option<i32> {
        self.number_of_days
    }
}
impl RetentionPeriod {
    /// Creates a new builder-style object to manufacture [`RetentionPeriod`](crate::types::RetentionPeriod).
    pub fn builder() -> crate::types::builders::RetentionPeriodBuilder {
        crate::types::builders::RetentionPeriodBuilder::default()
    }
}

/// A builder for [`RetentionPeriod`](crate::types::RetentionPeriod).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct RetentionPeriodBuilder {
    pub(crate) unlimited: ::std::option::Option<bool>,
    pub(crate) number_of_days: ::std::option::Option<i32>,
}
impl RetentionPeriodBuilder {
    /// <p>If true, message data is kept indefinitely.</p>
    pub fn unlimited(mut self, input: bool) -> Self {
        self.unlimited = ::std::option::Option::Some(input);
        self
    }
    /// <p>If true, message data is kept indefinitely.</p>
    pub fn set_unlimited(mut self, input: ::std::option::Option<bool>) -> Self {
        self.unlimited = input;
        self
    }
    /// <p>If true, message data is kept indefinitely.</p>
    pub fn get_unlimited(&self) -> &::std::option::Option<bool> {
        &self.unlimited
    }
    /// <p>The number of days that message data is kept. The <code>unlimited</code> parameter must be false.</p>
    pub fn number_of_days(mut self, input: i32) -> Self {
        self.number_of_days = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of days that message data is kept. The <code>unlimited</code> parameter must be false.</p>
    pub fn set_number_of_days(mut self, input: ::std::option::Option<i32>) -> Self {
        self.number_of_days = input;
        self
    }
    /// <p>The number of days that message data is kept. The <code>unlimited</code> parameter must be false.</p>
    pub fn get_number_of_days(&self) -> &::std::option::Option<i32> {
        &self.number_of_days
    }
    /// Consumes the builder and constructs a [`RetentionPeriod`](crate::types::RetentionPeriod).
    pub fn build(self) -> crate::types::RetentionPeriod {
        crate::types::RetentionPeriod {
            unlimited: self.unlimited.unwrap_or_default(),
            number_of_days: self.number_of_days,
        }
    }
}