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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>For <code>NetworkConnectionAction</code> and <code>PortProbeDetails</code>, <code>LocalPortDetails</code> provides information about the local port that was involved in the action.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ActionLocalPortDetails {
    /// <p>The number of the port.</p>
    #[doc(hidden)]
    pub port: i32,
    /// <p>The port name of the local connection.</p>
    #[doc(hidden)]
    pub port_name: std::option::Option<std::string::String>,
}
impl ActionLocalPortDetails {
    /// <p>The number of the port.</p>
    pub fn port(&self) -> i32 {
        self.port
    }
    /// <p>The port name of the local connection.</p>
    pub fn port_name(&self) -> std::option::Option<&str> {
        self.port_name.as_deref()
    }
}
impl ActionLocalPortDetails {
    /// Creates a new builder-style object to manufacture [`ActionLocalPortDetails`](crate::types::ActionLocalPortDetails).
    pub fn builder() -> crate::types::builders::ActionLocalPortDetailsBuilder {
        crate::types::builders::ActionLocalPortDetailsBuilder::default()
    }
}

/// A builder for [`ActionLocalPortDetails`](crate::types::ActionLocalPortDetails).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct ActionLocalPortDetailsBuilder {
    pub(crate) port: std::option::Option<i32>,
    pub(crate) port_name: std::option::Option<std::string::String>,
}
impl ActionLocalPortDetailsBuilder {
    /// <p>The number of the port.</p>
    pub fn port(mut self, input: i32) -> Self {
        self.port = Some(input);
        self
    }
    /// <p>The number of the port.</p>
    pub fn set_port(mut self, input: std::option::Option<i32>) -> Self {
        self.port = input;
        self
    }
    /// <p>The port name of the local connection.</p>
    pub fn port_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.port_name = Some(input.into());
        self
    }
    /// <p>The port name of the local connection.</p>
    pub fn set_port_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.port_name = input;
        self
    }
    /// Consumes the builder and constructs a [`ActionLocalPortDetails`](crate::types::ActionLocalPortDetails).
    pub fn build(self) -> crate::types::ActionLocalPortDetails {
        crate::types::ActionLocalPortDetails {
            port: self.port.unwrap_or_default(),
            port_name: self.port_name,
        }
    }
}