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>Details about the port range associated with a finding.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PortRange {
    /// <p>The beginning port in a port range.</p>
    pub begin: ::std::option::Option<i32>,
    /// <p>The ending port in a port range.</p>
    pub end: ::std::option::Option<i32>,
}
impl PortRange {
    /// <p>The beginning port in a port range.</p>
    pub fn begin(&self) -> ::std::option::Option<i32> {
        self.begin
    }
    /// <p>The ending port in a port range.</p>
    pub fn end(&self) -> ::std::option::Option<i32> {
        self.end
    }
}
impl PortRange {
    /// Creates a new builder-style object to manufacture [`PortRange`](crate::types::PortRange).
    pub fn builder() -> crate::types::builders::PortRangeBuilder {
        crate::types::builders::PortRangeBuilder::default()
    }
}

/// A builder for [`PortRange`](crate::types::PortRange).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct PortRangeBuilder {
    pub(crate) begin: ::std::option::Option<i32>,
    pub(crate) end: ::std::option::Option<i32>,
}
impl PortRangeBuilder {
    /// <p>The beginning port in a port range.</p>
    pub fn begin(mut self, input: i32) -> Self {
        self.begin = ::std::option::Option::Some(input);
        self
    }
    /// <p>The beginning port in a port range.</p>
    pub fn set_begin(mut self, input: ::std::option::Option<i32>) -> Self {
        self.begin = input;
        self
    }
    /// <p>The beginning port in a port range.</p>
    pub fn get_begin(&self) -> &::std::option::Option<i32> {
        &self.begin
    }
    /// <p>The ending port in a port range.</p>
    pub fn end(mut self, input: i32) -> Self {
        self.end = ::std::option::Option::Some(input);
        self
    }
    /// <p>The ending port in a port range.</p>
    pub fn set_end(mut self, input: ::std::option::Option<i32>) -> Self {
        self.end = input;
        self
    }
    /// <p>The ending port in a port range.</p>
    pub fn get_end(&self) -> &::std::option::Option<i32> {
        &self.end
    }
    /// Consumes the builder and constructs a [`PortRange`](crate::types::PortRange).
    pub fn build(self) -> crate::types::PortRange {
        crate::types::PortRange {
            begin: self.begin,
            end: self.end,
        }
    }
}