aws_sdk_elasticloadbalancingv2/operation/set_subnets/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::set_subnets::_set_subnets_output::SetSubnetsOutputBuilder;
3
4pub use crate::operation::set_subnets::_set_subnets_input::SetSubnetsInputBuilder;
5
6impl crate::operation::set_subnets::builders::SetSubnetsInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::set_subnets::SetSubnetsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::set_subnets::SetSubnetsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.set_subnets();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `SetSubnets`.
24///
25/// <p>Enables the Availability Zones for the specified public subnets for the specified Application Load Balancer, Network Load Balancer or Gateway Load Balancer. The specified subnets replace the previously enabled subnets.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct SetSubnetsFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::set_subnets::builders::SetSubnetsInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::set_subnets::SetSubnetsOutput,
35 crate::operation::set_subnets::SetSubnetsError,
36 > for SetSubnetsFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::set_subnets::SetSubnetsOutput,
44 crate::operation::set_subnets::SetSubnetsError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl SetSubnetsFluentBuilder {
51 /// Creates a new `SetSubnetsFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the SetSubnets as a reference.
60 pub fn as_input(&self) -> &crate::operation::set_subnets::builders::SetSubnetsInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::set_subnets::SetSubnetsOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::set_subnets::SetSubnetsError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::set_subnets::SetSubnets::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::set_subnets::SetSubnets::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::set_subnets::SetSubnetsOutput,
97 crate::operation::set_subnets::SetSubnetsError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The Amazon Resource Name (ARN) of the load balancer.</p>
112 pub fn load_balancer_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.load_balancer_arn(input.into());
114 self
115 }
116 /// <p>The Amazon Resource Name (ARN) of the load balancer.</p>
117 pub fn set_load_balancer_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_load_balancer_arn(input);
119 self
120 }
121 /// <p>The Amazon Resource Name (ARN) of the load balancer.</p>
122 pub fn get_load_balancer_arn(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_load_balancer_arn()
124 }
125 ///
126 /// Appends an item to `Subnets`.
127 ///
128 /// To override the contents of this collection use [`set_subnets`](Self::set_subnets).
129 ///
130 /// <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>
131 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones.</p>
132 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
133 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
134 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
135 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones. You must include all subnets that were enabled previously, with their existing configurations, plus any additional subnets.</p>
136 pub fn subnets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.inner = self.inner.subnets(input.into());
138 self
139 }
140 /// <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>
141 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones.</p>
142 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
143 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
144 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
145 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones. You must include all subnets that were enabled previously, with their existing configurations, plus any additional subnets.</p>
146 pub fn set_subnets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
147 self.inner = self.inner.set_subnets(input);
148 self
149 }
150 /// <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>
151 /// <p>\[Application Load Balancers\] You must specify subnets from at least two Availability Zones.</p>
152 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
153 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
154 /// <p>\[Network Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
155 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones. You must include all subnets that were enabled previously, with their existing configurations, plus any additional subnets.</p>
156 pub fn get_subnets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
157 self.inner.get_subnets()
158 }
159 ///
160 /// Appends an item to `SubnetMappings`.
161 ///
162 /// To override the contents of this collection use [`set_subnet_mappings`](Self::set_subnet_mappings).
163 ///
164 /// <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>
165 /// <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>
166 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
167 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
168 /// <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>
169 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
170 pub fn subnet_mappings(mut self, input: crate::types::SubnetMapping) -> Self {
171 self.inner = self.inner.subnet_mappings(input);
172 self
173 }
174 /// <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>
175 /// <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>
176 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
177 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
178 /// <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>
179 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
180 pub fn set_subnet_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SubnetMapping>>) -> Self {
181 self.inner = self.inner.set_subnet_mappings(input);
182 self
183 }
184 /// <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>
185 /// <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>
186 /// <p>\[Application Load Balancers on Outposts\] You must specify one Outpost subnet.</p>
187 /// <p>\[Application Load Balancers on Local Zones\] You can specify subnets from one or more Local Zones.</p>
188 /// <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>
189 /// <p>\[Gateway Load Balancers\] You can specify subnets from one or more Availability Zones.</p>
190 pub fn get_subnet_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SubnetMapping>> {
191 self.inner.get_subnet_mappings()
192 }
193 /// <p>The IP address type.</p>
194 /// <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>
195 /// <p>\[Network Load Balancers and Gateway Load Balancers\] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).</p>
196 pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
197 self.inner = self.inner.ip_address_type(input);
198 self
199 }
200 /// <p>The IP address type.</p>
201 /// <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>
202 /// <p>\[Network Load Balancers and Gateway Load Balancers\] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).</p>
203 pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
204 self.inner = self.inner.set_ip_address_type(input);
205 self
206 }
207 /// <p>The IP address type.</p>
208 /// <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>
209 /// <p>\[Network Load Balancers and Gateway Load Balancers\] The possible values are ipv4 (IPv4 addresses) and dualstack (IPv4 and IPv6 addresses).</p>
210 pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
211 self.inner.get_ip_address_type()
212 }
213 /// <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>
214 pub fn enable_prefix_for_ipv6_source_nat(mut self, input: crate::types::EnablePrefixForIpv6SourceNatEnum) -> Self {
215 self.inner = self.inner.enable_prefix_for_ipv6_source_nat(input);
216 self
217 }
218 /// <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>
219 pub fn set_enable_prefix_for_ipv6_source_nat(mut self, input: ::std::option::Option<crate::types::EnablePrefixForIpv6SourceNatEnum>) -> Self {
220 self.inner = self.inner.set_enable_prefix_for_ipv6_source_nat(input);
221 self
222 }
223 /// <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>
224 pub fn get_enable_prefix_for_ipv6_source_nat(&self) -> &::std::option::Option<crate::types::EnablePrefixForIpv6SourceNatEnum> {
225 self.inner.get_enable_prefix_for_ipv6_source_nat()
226 }
227}