aws_sdk_elasticloadbalancingv2/operation/set_subnets/_set_subnets_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct SetSubnetsInput {
6 /// <p>The Amazon Resource Name (ARN) of the load balancer.</p>
7 pub load_balancer_arn: ::std::option::Option<::std::string::String>,
8 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
9 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones.</p>
10 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
11 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
12 /// <p>\[Network Load Balancers and Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
13 pub subnets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
15 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones. You can't specify Elastic IP addresses for your subnets.</p>
16 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
17 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
18 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
19 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
20 pub subnet_mappings: ::std::option::Option<::std::vec::Vec<crate::types::SubnetMapping>>,
21 /// <p>The IP address type.</p>
22 /// <p>\[Application Load Balancers\] The possible values are ipv4 (IPv4 addresses), dualstack (IPv4 and IPv6 addresses), and dualstack-without-public-ipv4 (public IPv6 addresses and private IPv4 and IPv6 addresses).</p>
23 /// <p>\[Network Load Balancers and Gateway Load Balancers\] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).</p>
24 pub ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
25 /// <p>\[Network Load Balancers with UDP listeners\] Indicates whether to use an IPv6 prefix from each subnet for source NAT. The IP address type must be dualstack. The default value is off.</p>
26 pub enable_prefix_for_ipv6_source_nat: ::std::option::Option<crate::types::EnablePrefixForIpv6SourceNatEnum>,
27}
28impl SetSubnetsInput {
29 /// <p>The Amazon Resource Name (ARN) of the load balancer.</p>
30 pub fn load_balancer_arn(&self) -> ::std::option::Option<&str> {
31 self.load_balancer_arn.as_deref()
32 }
33 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
34 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones.</p>
35 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
36 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
37 /// <p>\[Network Load Balancers and Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</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 `.subnets.is_none()`.
40 pub fn subnets(&self) -> &[::std::string::String] {
41 self.subnets.as_deref().unwrap_or_default()
42 }
43 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
44 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones. You can't specify Elastic IP addresses for your subnets.</p>
45 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
46 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
47 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
48 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
49 ///
50 /// 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_mappings.is_none()`.
51 pub fn subnet_mappings(&self) -> &[crate::types::SubnetMapping] {
52 self.subnet_mappings.as_deref().unwrap_or_default()
53 }
54 /// <p>The IP address type.</p>
55 /// <p>\[Application Load Balancers\] The possible values are ipv4 (IPv4 addresses), dualstack (IPv4 and IPv6 addresses), and dualstack-without-public-ipv4 (public IPv6 addresses and private IPv4 and IPv6 addresses).</p>
56 /// <p>\[Network Load Balancers and Gateway Load Balancers\] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).</p>
57 pub fn ip_address_type(&self) -> ::std::option::Option<&crate::types::IpAddressType> {
58 self.ip_address_type.as_ref()
59 }
60 /// <p>\[Network Load Balancers with UDP listeners\] Indicates whether to use an IPv6 prefix from each subnet for source NAT. The IP address type must be dualstack. The default value is off.</p>
61 pub fn enable_prefix_for_ipv6_source_nat(&self) -> ::std::option::Option<&crate::types::EnablePrefixForIpv6SourceNatEnum> {
62 self.enable_prefix_for_ipv6_source_nat.as_ref()
63 }
64}
65impl SetSubnetsInput {
66 /// Creates a new builder-style object to manufacture [`SetSubnetsInput`](crate::operation::set_subnets::SetSubnetsInput).
67 pub fn builder() -> crate::operation::set_subnets::builders::SetSubnetsInputBuilder {
68 crate::operation::set_subnets::builders::SetSubnetsInputBuilder::default()
69 }
70}
71
72/// A builder for [`SetSubnetsInput`](crate::operation::set_subnets::SetSubnetsInput).
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
74#[non_exhaustive]
75pub struct SetSubnetsInputBuilder {
76 pub(crate) load_balancer_arn: ::std::option::Option<::std::string::String>,
77 pub(crate) subnets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
78 pub(crate) subnet_mappings: ::std::option::Option<::std::vec::Vec<crate::types::SubnetMapping>>,
79 pub(crate) ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
80 pub(crate) enable_prefix_for_ipv6_source_nat: ::std::option::Option<crate::types::EnablePrefixForIpv6SourceNatEnum>,
81}
82impl SetSubnetsInputBuilder {
83 /// <p>The Amazon Resource Name (ARN) of the load balancer.</p>
84 /// This field is required.
85 pub fn load_balancer_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86 self.load_balancer_arn = ::std::option::Option::Some(input.into());
87 self
88 }
89 /// <p>The Amazon Resource Name (ARN) of the load balancer.</p>
90 pub fn set_load_balancer_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91 self.load_balancer_arn = input;
92 self
93 }
94 /// <p>The Amazon Resource Name (ARN) of the load balancer.</p>
95 pub fn get_load_balancer_arn(&self) -> &::std::option::Option<::std::string::String> {
96 &self.load_balancer_arn
97 }
98 /// Appends an item to `subnets`.
99 ///
100 /// To override the contents of this collection use [`set_subnets`](Self::set_subnets).
101 ///
102 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
103 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones.</p>
104 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
105 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
106 /// <p>\[Network Load Balancers and Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
107 pub fn subnets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108 let mut v = self.subnets.unwrap_or_default();
109 v.push(input.into());
110 self.subnets = ::std::option::Option::Some(v);
111 self
112 }
113 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
114 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones.</p>
115 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
116 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
117 /// <p>\[Network Load Balancers and Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
118 pub fn set_subnets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
119 self.subnets = input;
120 self
121 }
122 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
123 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones.</p>
124 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
125 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
126 /// <p>\[Network Load Balancers and Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
127 pub fn get_subnets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
128 &self.subnets
129 }
130 /// Appends an item to `subnet_mappings`.
131 ///
132 /// To override the contents of this collection use [`set_subnet_mappings`](Self::set_subnet_mappings).
133 ///
134 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
135 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones. You can't specify Elastic IP addresses for your subnets.</p>
136 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
137 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
138 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
139 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
140 pub fn subnet_mappings(mut self, input: crate::types::SubnetMapping) -> Self {
141 let mut v = self.subnet_mappings.unwrap_or_default();
142 v.push(input);
143 self.subnet_mappings = ::std::option::Option::Some(v);
144 self
145 }
146 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
147 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones. You can't specify Elastic IP addresses for your subnets.</p>
148 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
149 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
150 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
151 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
152 pub fn set_subnet_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SubnetMapping>>) -> Self {
153 self.subnet_mappings = input;
154 self
155 }
156 /// <p>The IDs of the public subnets. You can specify only one subnet per Availability Zone. You must specify either subnets or subnet mappings.</p>
157 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones. You can't specify Elastic IP addresses for your subnets.</p>
158 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
159 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
160 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones. You can specify one Elastic IP address per subnet if you need static IP addresses for your internet-facing load balancer. For internal load balancers, you can specify one private IP address per subnet from the IPv4 range of the subnet. For internet-facing load balancer, you can specify one IPv6 address per subnet.</p>
161 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
162 pub fn get_subnet_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SubnetMapping>> {
163 &self.subnet_mappings
164 }
165 /// <p>The IP address type.</p>
166 /// <p>\[Application Load Balancers\] The possible values are ipv4 (IPv4 addresses), dualstack (IPv4 and IPv6 addresses), and dualstack-without-public-ipv4 (public IPv6 addresses and private IPv4 and IPv6 addresses).</p>
167 /// <p>\[Network Load Balancers and Gateway Load Balancers\] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).</p>
168 pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
169 self.ip_address_type = ::std::option::Option::Some(input);
170 self
171 }
172 /// <p>The IP address type.</p>
173 /// <p>\[Application Load Balancers\] The possible values are ipv4 (IPv4 addresses), dualstack (IPv4 and IPv6 addresses), and dualstack-without-public-ipv4 (public IPv6 addresses and private IPv4 and IPv6 addresses).</p>
174 /// <p>\[Network Load Balancers and Gateway Load Balancers\] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).</p>
175 pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
176 self.ip_address_type = input;
177 self
178 }
179 /// <p>The IP address type.</p>
180 /// <p>\[Application Load Balancers\] The possible values are ipv4 (IPv4 addresses), dualstack (IPv4 and IPv6 addresses), and dualstack-without-public-ipv4 (public IPv6 addresses and private IPv4 and IPv6 addresses).</p>
181 /// <p>\[Network Load Balancers and Gateway Load Balancers\] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).</p>
182 pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
183 &self.ip_address_type
184 }
185 /// <p>\[Network Load Balancers with UDP listeners\] Indicates whether to use an IPv6 prefix from each subnet for source NAT. The IP address type must be dualstack. The default value is off.</p>
186 pub fn enable_prefix_for_ipv6_source_nat(mut self, input: crate::types::EnablePrefixForIpv6SourceNatEnum) -> Self {
187 self.enable_prefix_for_ipv6_source_nat = ::std::option::Option::Some(input);
188 self
189 }
190 /// <p>\[Network Load Balancers with UDP listeners\] Indicates whether to use an IPv6 prefix from each subnet for source NAT. The IP address type must be dualstack. The default value is off.</p>
191 pub fn set_enable_prefix_for_ipv6_source_nat(mut self, input: ::std::option::Option<crate::types::EnablePrefixForIpv6SourceNatEnum>) -> Self {
192 self.enable_prefix_for_ipv6_source_nat = input;
193 self
194 }
195 /// <p>\[Network Load Balancers with UDP listeners\] Indicates whether to use an IPv6 prefix from each subnet for source NAT. The IP address type must be dualstack. The default value is off.</p>
196 pub fn get_enable_prefix_for_ipv6_source_nat(&self) -> &::std::option::Option<crate::types::EnablePrefixForIpv6SourceNatEnum> {
197 &self.enable_prefix_for_ipv6_source_nat
198 }
199 /// Consumes the builder and constructs a [`SetSubnetsInput`](crate::operation::set_subnets::SetSubnetsInput).
200 pub fn build(self) -> ::std::result::Result<crate::operation::set_subnets::SetSubnetsInput, ::aws_smithy_types::error::operation::BuildError> {
201 ::std::result::Result::Ok(crate::operation::set_subnets::SetSubnetsInput {
202 load_balancer_arn: self.load_balancer_arn,
203 subnets: self.subnets,
204 subnet_mappings: self.subnet_mappings,
205 ip_address_type: self.ip_address_type,
206 enable_prefix_for_ipv6_source_nat: self.enable_prefix_for_ipv6_source_nat,
207 })
208 }
209}