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

/// <p>An object that represents a virtual router listener.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct VirtualRouterListener {
    /// <p>An object that represents a port mapping.</p>
    pub port_mapping: ::std::option::Option<crate::types::PortMapping>,
}
impl VirtualRouterListener {
    /// <p>An object that represents a port mapping.</p>
    pub fn port_mapping(&self) -> ::std::option::Option<&crate::types::PortMapping> {
        self.port_mapping.as_ref()
    }
}
impl VirtualRouterListener {
    /// Creates a new builder-style object to manufacture [`VirtualRouterListener`](crate::types::VirtualRouterListener).
    pub fn builder() -> crate::types::builders::VirtualRouterListenerBuilder {
        crate::types::builders::VirtualRouterListenerBuilder::default()
    }
}

/// A builder for [`VirtualRouterListener`](crate::types::VirtualRouterListener).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct VirtualRouterListenerBuilder {
    pub(crate) port_mapping: ::std::option::Option<crate::types::PortMapping>,
}
impl VirtualRouterListenerBuilder {
    /// <p>An object that represents a port mapping.</p>
    /// This field is required.
    pub fn port_mapping(mut self, input: crate::types::PortMapping) -> Self {
        self.port_mapping = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object that represents a port mapping.</p>
    pub fn set_port_mapping(mut self, input: ::std::option::Option<crate::types::PortMapping>) -> Self {
        self.port_mapping = input;
        self
    }
    /// <p>An object that represents a port mapping.</p>
    pub fn get_port_mapping(&self) -> &::std::option::Option<crate::types::PortMapping> {
        &self.port_mapping
    }
    /// Consumes the builder and constructs a [`VirtualRouterListener`](crate::types::VirtualRouterListener).
    pub fn build(self) -> crate::types::VirtualRouterListener {
        crate::types::VirtualRouterListener {
            port_mapping: self.port_mapping,
        }
    }
}