aws_sdk_securityhub/types/
_action_local_port_details.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <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>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ActionLocalPortDetails {
7    /// <p>The number of the port.</p>
8    pub port: ::std::option::Option<i32>,
9    /// <p>The port name of the local connection.</p>
10    /// <p>Length Constraints: 128.</p>
11    pub port_name: ::std::option::Option<::std::string::String>,
12}
13impl ActionLocalPortDetails {
14    /// <p>The number of the port.</p>
15    pub fn port(&self) -> ::std::option::Option<i32> {
16        self.port
17    }
18    /// <p>The port name of the local connection.</p>
19    /// <p>Length Constraints: 128.</p>
20    pub fn port_name(&self) -> ::std::option::Option<&str> {
21        self.port_name.as_deref()
22    }
23}
24impl ActionLocalPortDetails {
25    /// Creates a new builder-style object to manufacture [`ActionLocalPortDetails`](crate::types::ActionLocalPortDetails).
26    pub fn builder() -> crate::types::builders::ActionLocalPortDetailsBuilder {
27        crate::types::builders::ActionLocalPortDetailsBuilder::default()
28    }
29}
30
31/// A builder for [`ActionLocalPortDetails`](crate::types::ActionLocalPortDetails).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct ActionLocalPortDetailsBuilder {
35    pub(crate) port: ::std::option::Option<i32>,
36    pub(crate) port_name: ::std::option::Option<::std::string::String>,
37}
38impl ActionLocalPortDetailsBuilder {
39    /// <p>The number of the port.</p>
40    pub fn port(mut self, input: i32) -> Self {
41        self.port = ::std::option::Option::Some(input);
42        self
43    }
44    /// <p>The number of the port.</p>
45    pub fn set_port(mut self, input: ::std::option::Option<i32>) -> Self {
46        self.port = input;
47        self
48    }
49    /// <p>The number of the port.</p>
50    pub fn get_port(&self) -> &::std::option::Option<i32> {
51        &self.port
52    }
53    /// <p>The port name of the local connection.</p>
54    /// <p>Length Constraints: 128.</p>
55    pub fn port_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56        self.port_name = ::std::option::Option::Some(input.into());
57        self
58    }
59    /// <p>The port name of the local connection.</p>
60    /// <p>Length Constraints: 128.</p>
61    pub fn set_port_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62        self.port_name = input;
63        self
64    }
65    /// <p>The port name of the local connection.</p>
66    /// <p>Length Constraints: 128.</p>
67    pub fn get_port_name(&self) -> &::std::option::Option<::std::string::String> {
68        &self.port_name
69    }
70    /// Consumes the builder and constructs a [`ActionLocalPortDetails`](crate::types::ActionLocalPortDetails).
71    pub fn build(self) -> crate::types::ActionLocalPortDetails {
72        crate::types::ActionLocalPortDetails {
73            port: self.port,
74            port_name: self.port_name,
75        }
76    }
77}