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>TCP or UDP protocols: The range of ports the rule applies to.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct NetworkAclPortRange {
    /// <p>The beginning port number of the range.</p>
    pub from: ::std::option::Option<i32>,
    /// <p>The ending port number of the range.</p>
    pub to: ::std::option::Option<i32>,
}
impl NetworkAclPortRange {
    /// <p>The beginning port number of the range.</p>
    pub fn from(&self) -> ::std::option::Option<i32> {
        self.from
    }
    /// <p>The ending port number of the range.</p>
    pub fn to(&self) -> ::std::option::Option<i32> {
        self.to
    }
}
impl NetworkAclPortRange {
    /// Creates a new builder-style object to manufacture [`NetworkAclPortRange`](crate::types::NetworkAclPortRange).
    pub fn builder() -> crate::types::builders::NetworkAclPortRangeBuilder {
        crate::types::builders::NetworkAclPortRangeBuilder::default()
    }
}

/// A builder for [`NetworkAclPortRange`](crate::types::NetworkAclPortRange).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct NetworkAclPortRangeBuilder {
    pub(crate) from: ::std::option::Option<i32>,
    pub(crate) to: ::std::option::Option<i32>,
}
impl NetworkAclPortRangeBuilder {
    /// <p>The beginning port number of the range.</p>
    pub fn from(mut self, input: i32) -> Self {
        self.from = ::std::option::Option::Some(input);
        self
    }
    /// <p>The beginning port number of the range.</p>
    pub fn set_from(mut self, input: ::std::option::Option<i32>) -> Self {
        self.from = input;
        self
    }
    /// <p>The beginning port number of the range.</p>
    pub fn get_from(&self) -> &::std::option::Option<i32> {
        &self.from
    }
    /// <p>The ending port number of the range.</p>
    pub fn to(mut self, input: i32) -> Self {
        self.to = ::std::option::Option::Some(input);
        self
    }
    /// <p>The ending port number of the range.</p>
    pub fn set_to(mut self, input: ::std::option::Option<i32>) -> Self {
        self.to = input;
        self
    }
    /// <p>The ending port number of the range.</p>
    pub fn get_to(&self) -> &::std::option::Option<i32> {
        &self.to
    }
    /// Consumes the builder and constructs a [`NetworkAclPortRange`](crate::types::NetworkAclPortRange).
    pub fn build(self) -> crate::types::NetworkAclPortRange {
        crate::types::NetworkAclPortRange {
            from: self.from,
            to: self.to,
        }
    }
}