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