aws_sdk_ec2/types/
_verified_access_endpoint_load_balancer_options.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes a load balancer when creating an Amazon Web Services Verified Access endpoint using the <code>load-balancer</code> type.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct VerifiedAccessEndpointLoadBalancerOptions {
7    /// <p>The IP protocol.</p>
8    pub protocol: ::std::option::Option<crate::types::VerifiedAccessEndpointProtocol>,
9    /// <p>The IP port number.</p>
10    pub port: ::std::option::Option<i32>,
11    /// <p>The ARN of the load balancer.</p>
12    pub load_balancer_arn: ::std::option::Option<::std::string::String>,
13    /// <p>The IDs of the subnets.</p>
14    pub subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
15    /// <p>The port ranges.</p>
16    pub port_ranges: ::std::option::Option<::std::vec::Vec<crate::types::VerifiedAccessEndpointPortRange>>,
17}
18impl VerifiedAccessEndpointLoadBalancerOptions {
19    /// <p>The IP protocol.</p>
20    pub fn protocol(&self) -> ::std::option::Option<&crate::types::VerifiedAccessEndpointProtocol> {
21        self.protocol.as_ref()
22    }
23    /// <p>The IP port number.</p>
24    pub fn port(&self) -> ::std::option::Option<i32> {
25        self.port
26    }
27    /// <p>The ARN of the load balancer.</p>
28    pub fn load_balancer_arn(&self) -> ::std::option::Option<&str> {
29        self.load_balancer_arn.as_deref()
30    }
31    /// <p>The IDs of the subnets.</p>
32    ///
33    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subnet_ids.is_none()`.
34    pub fn subnet_ids(&self) -> &[::std::string::String] {
35        self.subnet_ids.as_deref().unwrap_or_default()
36    }
37    /// <p>The port ranges.</p>
38    ///
39    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.port_ranges.is_none()`.
40    pub fn port_ranges(&self) -> &[crate::types::VerifiedAccessEndpointPortRange] {
41        self.port_ranges.as_deref().unwrap_or_default()
42    }
43}
44impl VerifiedAccessEndpointLoadBalancerOptions {
45    /// Creates a new builder-style object to manufacture [`VerifiedAccessEndpointLoadBalancerOptions`](crate::types::VerifiedAccessEndpointLoadBalancerOptions).
46    pub fn builder() -> crate::types::builders::VerifiedAccessEndpointLoadBalancerOptionsBuilder {
47        crate::types::builders::VerifiedAccessEndpointLoadBalancerOptionsBuilder::default()
48    }
49}
50
51/// A builder for [`VerifiedAccessEndpointLoadBalancerOptions`](crate::types::VerifiedAccessEndpointLoadBalancerOptions).
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
53#[non_exhaustive]
54pub struct VerifiedAccessEndpointLoadBalancerOptionsBuilder {
55    pub(crate) protocol: ::std::option::Option<crate::types::VerifiedAccessEndpointProtocol>,
56    pub(crate) port: ::std::option::Option<i32>,
57    pub(crate) load_balancer_arn: ::std::option::Option<::std::string::String>,
58    pub(crate) subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
59    pub(crate) port_ranges: ::std::option::Option<::std::vec::Vec<crate::types::VerifiedAccessEndpointPortRange>>,
60}
61impl VerifiedAccessEndpointLoadBalancerOptionsBuilder {
62    /// <p>The IP protocol.</p>
63    pub fn protocol(mut self, input: crate::types::VerifiedAccessEndpointProtocol) -> Self {
64        self.protocol = ::std::option::Option::Some(input);
65        self
66    }
67    /// <p>The IP protocol.</p>
68    pub fn set_protocol(mut self, input: ::std::option::Option<crate::types::VerifiedAccessEndpointProtocol>) -> Self {
69        self.protocol = input;
70        self
71    }
72    /// <p>The IP protocol.</p>
73    pub fn get_protocol(&self) -> &::std::option::Option<crate::types::VerifiedAccessEndpointProtocol> {
74        &self.protocol
75    }
76    /// <p>The IP port number.</p>
77    pub fn port(mut self, input: i32) -> Self {
78        self.port = ::std::option::Option::Some(input);
79        self
80    }
81    /// <p>The IP port number.</p>
82    pub fn set_port(mut self, input: ::std::option::Option<i32>) -> Self {
83        self.port = input;
84        self
85    }
86    /// <p>The IP port number.</p>
87    pub fn get_port(&self) -> &::std::option::Option<i32> {
88        &self.port
89    }
90    /// <p>The ARN of the load balancer.</p>
91    pub fn load_balancer_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.load_balancer_arn = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>The ARN of the load balancer.</p>
96    pub fn set_load_balancer_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.load_balancer_arn = input;
98        self
99    }
100    /// <p>The ARN of the load balancer.</p>
101    pub fn get_load_balancer_arn(&self) -> &::std::option::Option<::std::string::String> {
102        &self.load_balancer_arn
103    }
104    /// Appends an item to `subnet_ids`.
105    ///
106    /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
107    ///
108    /// <p>The IDs of the subnets.</p>
109    pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        let mut v = self.subnet_ids.unwrap_or_default();
111        v.push(input.into());
112        self.subnet_ids = ::std::option::Option::Some(v);
113        self
114    }
115    /// <p>The IDs of the subnets.</p>
116    pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
117        self.subnet_ids = input;
118        self
119    }
120    /// <p>The IDs of the subnets.</p>
121    pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
122        &self.subnet_ids
123    }
124    /// Appends an item to `port_ranges`.
125    ///
126    /// To override the contents of this collection use [`set_port_ranges`](Self::set_port_ranges).
127    ///
128    /// <p>The port ranges.</p>
129    pub fn port_ranges(mut self, input: crate::types::VerifiedAccessEndpointPortRange) -> Self {
130        let mut v = self.port_ranges.unwrap_or_default();
131        v.push(input);
132        self.port_ranges = ::std::option::Option::Some(v);
133        self
134    }
135    /// <p>The port ranges.</p>
136    pub fn set_port_ranges(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VerifiedAccessEndpointPortRange>>) -> Self {
137        self.port_ranges = input;
138        self
139    }
140    /// <p>The port ranges.</p>
141    pub fn get_port_ranges(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VerifiedAccessEndpointPortRange>> {
142        &self.port_ranges
143    }
144    /// Consumes the builder and constructs a [`VerifiedAccessEndpointLoadBalancerOptions`](crate::types::VerifiedAccessEndpointLoadBalancerOptions).
145    pub fn build(self) -> crate::types::VerifiedAccessEndpointLoadBalancerOptions {
146        crate::types::VerifiedAccessEndpointLoadBalancerOptions {
147            protocol: self.protocol,
148            port: self.port,
149            load_balancer_arn: self.load_balancer_arn,
150            subnet_ids: self.subnet_ids,
151            port_ranges: self.port_ranges,
152        }
153    }
154}