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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes prefixes for Amazon Web Services services.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PrefixList {
    /// <p>The IP address range of the Amazon Web Service.</p>
    pub cidrs: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The ID of the prefix.</p>
    pub prefix_list_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the prefix.</p>
    pub prefix_list_name: ::std::option::Option<::std::string::String>,
}
impl PrefixList {
    /// <p>The IP address range of the Amazon Web Service.</p>
    pub fn cidrs(&self) -> ::std::option::Option<&[::std::string::String]> {
        self.cidrs.as_deref()
    }
    /// <p>The ID of the prefix.</p>
    pub fn prefix_list_id(&self) -> ::std::option::Option<&str> {
        self.prefix_list_id.as_deref()
    }
    /// <p>The name of the prefix.</p>
    pub fn prefix_list_name(&self) -> ::std::option::Option<&str> {
        self.prefix_list_name.as_deref()
    }
}
impl PrefixList {
    /// Creates a new builder-style object to manufacture [`PrefixList`](crate::types::PrefixList).
    pub fn builder() -> crate::types::builders::PrefixListBuilder {
        crate::types::builders::PrefixListBuilder::default()
    }
}

/// A builder for [`PrefixList`](crate::types::PrefixList).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct PrefixListBuilder {
    pub(crate) cidrs: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) prefix_list_id: ::std::option::Option<::std::string::String>,
    pub(crate) prefix_list_name: ::std::option::Option<::std::string::String>,
}
impl PrefixListBuilder {
    /// Appends an item to `cidrs`.
    ///
    /// To override the contents of this collection use [`set_cidrs`](Self::set_cidrs).
    ///
    /// <p>The IP address range of the Amazon Web Service.</p>
    pub fn cidrs(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.cidrs.unwrap_or_default();
        v.push(input.into());
        self.cidrs = ::std::option::Option::Some(v);
        self
    }
    /// <p>The IP address range of the Amazon Web Service.</p>
    pub fn set_cidrs(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.cidrs = input;
        self
    }
    /// <p>The IP address range of the Amazon Web Service.</p>
    pub fn get_cidrs(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.cidrs
    }
    /// <p>The ID of the prefix.</p>
    pub fn prefix_list_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.prefix_list_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the prefix.</p>
    pub fn set_prefix_list_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.prefix_list_id = input;
        self
    }
    /// <p>The ID of the prefix.</p>
    pub fn get_prefix_list_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.prefix_list_id
    }
    /// <p>The name of the prefix.</p>
    pub fn prefix_list_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.prefix_list_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the prefix.</p>
    pub fn set_prefix_list_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.prefix_list_name = input;
        self
    }
    /// <p>The name of the prefix.</p>
    pub fn get_prefix_list_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.prefix_list_name
    }
    /// Consumes the builder and constructs a [`PrefixList`](crate::types::PrefixList).
    pub fn build(self) -> crate::types::PrefixList {
        crate::types::PrefixList {
            cidrs: self.cidrs,
            prefix_list_id: self.prefix_list_id,
            prefix_list_name: self.prefix_list_name,
        }
    }
}