Skip to main content

aws_sdk_ec2/operation/associate_vpc_cidr_block/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::associate_vpc_cidr_block::_associate_vpc_cidr_block_input::AssociateVpcCidrBlockInputBuilder;
3
4pub use crate::operation::associate_vpc_cidr_block::_associate_vpc_cidr_block_output::AssociateVpcCidrBlockOutputBuilder;
5
6impl crate::operation::associate_vpc_cidr_block::builders::AssociateVpcCidrBlockInputBuilder {
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::associate_vpc_cidr_block::AssociateVpcCidrBlockOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::associate_vpc_cidr_block::AssociateVpcCidrBlockError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.associate_vpc_cidr_block();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AssociateVpcCidrBlock`.
24///
25/// <p>Associates a CIDR block with your VPC. You can associate a secondary IPv4 CIDR block, an Amazon-provided IPv6 CIDR block, or an IPv6 CIDR block from an IPv6 address pool that you provisioned through bring your own IP addresses (<a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html">BYOIP</a>).</p>
26/// <p>You must specify one of the following in the request: an IPv4 CIDR block, an IPv6 pool, or an Amazon-provided IPv6 CIDR block.</p>
27/// <p>For more information about associating CIDR blocks with your VPC and applicable restrictions, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html">IP addressing for your VPCs and subnets</a> in the <i>Amazon VPC User Guide</i>.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct AssociateVpcCidrBlockFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::associate_vpc_cidr_block::builders::AssociateVpcCidrBlockInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::associate_vpc_cidr_block::AssociateVpcCidrBlockOutput,
37        crate::operation::associate_vpc_cidr_block::AssociateVpcCidrBlockError,
38    > for AssociateVpcCidrBlockFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::associate_vpc_cidr_block::AssociateVpcCidrBlockOutput,
46            crate::operation::associate_vpc_cidr_block::AssociateVpcCidrBlockError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl AssociateVpcCidrBlockFluentBuilder {
53    /// Creates a new `AssociateVpcCidrBlockFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the AssociateVpcCidrBlock as a reference.
62    pub fn as_input(&self) -> &crate::operation::associate_vpc_cidr_block::builders::AssociateVpcCidrBlockInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::associate_vpc_cidr_block::AssociateVpcCidrBlockOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::associate_vpc_cidr_block::AssociateVpcCidrBlockError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::associate_vpc_cidr_block::AssociateVpcCidrBlock::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::associate_vpc_cidr_block::AssociateVpcCidrBlock::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::associate_vpc_cidr_block::AssociateVpcCidrBlockOutput,
99        crate::operation::associate_vpc_cidr_block::AssociateVpcCidrBlockError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>An IPv4 CIDR block to associate with the VPC.</p>
114    pub fn cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.cidr_block(input.into());
116        self
117    }
118    /// <p>An IPv4 CIDR block to associate with the VPC.</p>
119    pub fn set_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_cidr_block(input);
121        self
122    }
123    /// <p>An IPv4 CIDR block to associate with the VPC.</p>
124    pub fn get_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_cidr_block()
126    }
127    /// <p>The name of the location from which we advertise the IPV6 CIDR block. Use this parameter to limit the CIDR block to this location.</p>
128    /// <p>You must set <code>AmazonProvidedIpv6CidrBlock</code> to <code>true</code> to use this parameter.</p>
129    /// <p>You can have one IPv6 CIDR block association per network border group.</p>
130    pub fn ipv6_cidr_block_network_border_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.ipv6_cidr_block_network_border_group(input.into());
132        self
133    }
134    /// <p>The name of the location from which we advertise the IPV6 CIDR block. Use this parameter to limit the CIDR block to this location.</p>
135    /// <p>You must set <code>AmazonProvidedIpv6CidrBlock</code> to <code>true</code> to use this parameter.</p>
136    /// <p>You can have one IPv6 CIDR block association per network border group.</p>
137    pub fn set_ipv6_cidr_block_network_border_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_ipv6_cidr_block_network_border_group(input);
139        self
140    }
141    /// <p>The name of the location from which we advertise the IPV6 CIDR block. Use this parameter to limit the CIDR block to this location.</p>
142    /// <p>You must set <code>AmazonProvidedIpv6CidrBlock</code> to <code>true</code> to use this parameter.</p>
143    /// <p>You can have one IPv6 CIDR block association per network border group.</p>
144    pub fn get_ipv6_cidr_block_network_border_group(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_ipv6_cidr_block_network_border_group()
146    }
147    /// <p>The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.</p>
148    pub fn ipv6_pool(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.ipv6_pool(input.into());
150        self
151    }
152    /// <p>The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.</p>
153    pub fn set_ipv6_pool(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_ipv6_pool(input);
155        self
156    }
157    /// <p>The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block.</p>
158    pub fn get_ipv6_pool(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_ipv6_pool()
160    }
161    /// <p>An IPv6 CIDR block from the IPv6 address pool. You must also specify <code>Ipv6Pool</code> in the request.</p>
162    /// <p>To let Amazon choose the IPv6 CIDR block for you, omit this parameter.</p>
163    pub fn ipv6_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.inner = self.inner.ipv6_cidr_block(input.into());
165        self
166    }
167    /// <p>An IPv6 CIDR block from the IPv6 address pool. You must also specify <code>Ipv6Pool</code> in the request.</p>
168    /// <p>To let Amazon choose the IPv6 CIDR block for you, omit this parameter.</p>
169    pub fn set_ipv6_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_ipv6_cidr_block(input);
171        self
172    }
173    /// <p>An IPv6 CIDR block from the IPv6 address pool. You must also specify <code>Ipv6Pool</code> in the request.</p>
174    /// <p>To let Amazon choose the IPv6 CIDR block for you, omit this parameter.</p>
175    pub fn get_ipv6_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
176        self.inner.get_ipv6_cidr_block()
177    }
178    /// <p>Associate a CIDR allocated from an IPv4 IPAM pool to a VPC. For more information about Amazon VPC IP Address Manager (IPAM), see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
179    pub fn ipv4_ipam_pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180        self.inner = self.inner.ipv4_ipam_pool_id(input.into());
181        self
182    }
183    /// <p>Associate a CIDR allocated from an IPv4 IPAM pool to a VPC. For more information about Amazon VPC IP Address Manager (IPAM), see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
184    pub fn set_ipv4_ipam_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185        self.inner = self.inner.set_ipv4_ipam_pool_id(input);
186        self
187    }
188    /// <p>Associate a CIDR allocated from an IPv4 IPAM pool to a VPC. For more information about Amazon VPC IP Address Manager (IPAM), see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
189    pub fn get_ipv4_ipam_pool_id(&self) -> &::std::option::Option<::std::string::String> {
190        self.inner.get_ipv4_ipam_pool_id()
191    }
192    /// <p>The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
193    pub fn ipv4_netmask_length(mut self, input: i32) -> Self {
194        self.inner = self.inner.ipv4_netmask_length(input);
195        self
196    }
197    /// <p>The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
198    pub fn set_ipv4_netmask_length(mut self, input: ::std::option::Option<i32>) -> Self {
199        self.inner = self.inner.set_ipv4_netmask_length(input);
200        self
201    }
202    /// <p>The netmask length of the IPv4 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
203    pub fn get_ipv4_netmask_length(&self) -> &::std::option::Option<i32> {
204        self.inner.get_ipv4_netmask_length()
205    }
206    /// <p>Associates a CIDR allocated from an IPv6 IPAM pool to a VPC. For more information about Amazon VPC IP Address Manager (IPAM), see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
207    pub fn ipv6_ipam_pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.inner = self.inner.ipv6_ipam_pool_id(input.into());
209        self
210    }
211    /// <p>Associates a CIDR allocated from an IPv6 IPAM pool to a VPC. For more information about Amazon VPC IP Address Manager (IPAM), see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
212    pub fn set_ipv6_ipam_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213        self.inner = self.inner.set_ipv6_ipam_pool_id(input);
214        self
215    }
216    /// <p>Associates a CIDR allocated from an IPv6 IPAM pool to a VPC. For more information about Amazon VPC IP Address Manager (IPAM), see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
217    pub fn get_ipv6_ipam_pool_id(&self) -> &::std::option::Option<::std::string::String> {
218        self.inner.get_ipv6_ipam_pool_id()
219    }
220    /// <p>The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
221    pub fn ipv6_netmask_length(mut self, input: i32) -> Self {
222        self.inner = self.inner.ipv6_netmask_length(input);
223        self
224    }
225    /// <p>The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
226    pub fn set_ipv6_netmask_length(mut self, input: ::std::option::Option<i32>) -> Self {
227        self.inner = self.inner.set_ipv6_netmask_length(input);
228        self
229    }
230    /// <p>The netmask length of the IPv6 CIDR you would like to associate from an Amazon VPC IP Address Manager (IPAM) pool. For more information about IPAM, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/what-is-it-ipam.html">What is IPAM?</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>
231    pub fn get_ipv6_netmask_length(&self) -> &::std::option::Option<i32> {
232        self.inner.get_ipv6_netmask_length()
233    }
234    /// <p>The ID of the VPC.</p>
235    pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
236        self.inner = self.inner.vpc_id(input.into());
237        self
238    }
239    /// <p>The ID of the VPC.</p>
240    pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
241        self.inner = self.inner.set_vpc_id(input);
242        self
243    }
244    /// <p>The ID of the VPC.</p>
245    pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
246        self.inner.get_vpc_id()
247    }
248    /// <p>Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IPv6 addresses or the size of the CIDR block.</p>
249    pub fn amazon_provided_ipv6_cidr_block(mut self, input: bool) -> Self {
250        self.inner = self.inner.amazon_provided_ipv6_cidr_block(input);
251        self
252    }
253    /// <p>Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IPv6 addresses or the size of the CIDR block.</p>
254    pub fn set_amazon_provided_ipv6_cidr_block(mut self, input: ::std::option::Option<bool>) -> Self {
255        self.inner = self.inner.set_amazon_provided_ipv6_cidr_block(input);
256        self
257    }
258    /// <p>Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IPv6 addresses or the size of the CIDR block.</p>
259    pub fn get_amazon_provided_ipv6_cidr_block(&self) -> &::std::option::Option<bool> {
260        self.inner.get_amazon_provided_ipv6_cidr_block()
261    }
262}