aws_sdk_ec2/operation/provision_byoip_cidr/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::provision_byoip_cidr::_provision_byoip_cidr_output::ProvisionByoipCidrOutputBuilder;
3
4pub use crate::operation::provision_byoip_cidr::_provision_byoip_cidr_input::ProvisionByoipCidrInputBuilder;
5
6impl crate::operation::provision_byoip_cidr::builders::ProvisionByoipCidrInputBuilder {
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::provision_byoip_cidr::ProvisionByoipCidrOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::provision_byoip_cidr::ProvisionByoipCidrError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.provision_byoip_cidr();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ProvisionByoipCidr`.
24///
25/// <p>Provisions an IPv4 or IPv6 address range for use with your Amazon Web Services resources through bring your own IP addresses (BYOIP) and creates a corresponding address pool. After the address range is provisioned, it is ready to be advertised.</p>
26/// <p>Amazon Web Services verifies that you own the address range and are authorized to advertise it. You must ensure that the address range is registered to you and that you created an RPKI ROA to authorize Amazon ASNs 16509 and 14618 to advertise the address range. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html">Bring your own IP addresses (BYOIP)</a> in the <i>Amazon EC2 User Guide</i>.</p>
27/// <p>Provisioning an address range is an asynchronous operation, so the call returns immediately, but the address range is not ready to use until its status changes from <code>pending-provision</code> to <code>provisioned</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/byoip-onboard.html">Onboard your address range</a>.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct ProvisionByoipCidrFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::provision_byoip_cidr::builders::ProvisionByoipCidrInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::provision_byoip_cidr::ProvisionByoipCidrOutput,
37        crate::operation::provision_byoip_cidr::ProvisionByoipCidrError,
38    > for ProvisionByoipCidrFluentBuilder
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::provision_byoip_cidr::ProvisionByoipCidrOutput,
46            crate::operation::provision_byoip_cidr::ProvisionByoipCidrError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl ProvisionByoipCidrFluentBuilder {
53    /// Creates a new `ProvisionByoipCidrFluentBuilder`.
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 ProvisionByoipCidr as a reference.
62    pub fn as_input(&self) -> &crate::operation::provision_byoip_cidr::builders::ProvisionByoipCidrInputBuilder {
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::provision_byoip_cidr::ProvisionByoipCidrOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::provision_byoip_cidr::ProvisionByoipCidrError,
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::provision_byoip_cidr::ProvisionByoipCidr::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::provision_byoip_cidr::ProvisionByoipCidr::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::provision_byoip_cidr::ProvisionByoipCidrOutput,
99        crate::operation::provision_byoip_cidr::ProvisionByoipCidrError,
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>The public IPv4 or IPv6 address range, in CIDR notation. The most specific IPv4 prefix that you can specify is /24. The most specific IPv6 address range that you can bring is /48 for CIDRs that are publicly advertisable and /56 for CIDRs that are not publicly advertisable. The address range cannot overlap with another address range that you've brought to this or another Region.</p>
114    pub fn cidr(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.cidr(input.into());
116        self
117    }
118    /// <p>The public IPv4 or IPv6 address range, in CIDR notation. The most specific IPv4 prefix that you can specify is /24. The most specific IPv6 address range that you can bring is /48 for CIDRs that are publicly advertisable and /56 for CIDRs that are not publicly advertisable. The address range cannot overlap with another address range that you've brought to this or another Region.</p>
119    pub fn set_cidr(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_cidr(input);
121        self
122    }
123    /// <p>The public IPv4 or IPv6 address range, in CIDR notation. The most specific IPv4 prefix that you can specify is /24. The most specific IPv6 address range that you can bring is /48 for CIDRs that are publicly advertisable and /56 for CIDRs that are not publicly advertisable. The address range cannot overlap with another address range that you've brought to this or another Region.</p>
124    pub fn get_cidr(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_cidr()
126    }
127    /// <p>A signed document that proves that you are authorized to bring the specified IP address range to Amazon using BYOIP.</p>
128    pub fn cidr_authorization_context(mut self, input: crate::types::CidrAuthorizationContext) -> Self {
129        self.inner = self.inner.cidr_authorization_context(input);
130        self
131    }
132    /// <p>A signed document that proves that you are authorized to bring the specified IP address range to Amazon using BYOIP.</p>
133    pub fn set_cidr_authorization_context(mut self, input: ::std::option::Option<crate::types::CidrAuthorizationContext>) -> Self {
134        self.inner = self.inner.set_cidr_authorization_context(input);
135        self
136    }
137    /// <p>A signed document that proves that you are authorized to bring the specified IP address range to Amazon using BYOIP.</p>
138    pub fn get_cidr_authorization_context(&self) -> &::std::option::Option<crate::types::CidrAuthorizationContext> {
139        self.inner.get_cidr_authorization_context()
140    }
141    /// <p>(IPv6 only) Indicate whether the address range will be publicly advertised to the internet.</p>
142    /// <p>Default: true</p>
143    pub fn publicly_advertisable(mut self, input: bool) -> Self {
144        self.inner = self.inner.publicly_advertisable(input);
145        self
146    }
147    /// <p>(IPv6 only) Indicate whether the address range will be publicly advertised to the internet.</p>
148    /// <p>Default: true</p>
149    pub fn set_publicly_advertisable(mut self, input: ::std::option::Option<bool>) -> Self {
150        self.inner = self.inner.set_publicly_advertisable(input);
151        self
152    }
153    /// <p>(IPv6 only) Indicate whether the address range will be publicly advertised to the internet.</p>
154    /// <p>Default: true</p>
155    pub fn get_publicly_advertisable(&self) -> &::std::option::Option<bool> {
156        self.inner.get_publicly_advertisable()
157    }
158    /// <p>A description for the address range and the address pool.</p>
159    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.inner = self.inner.description(input.into());
161        self
162    }
163    /// <p>A description for the address range and the address pool.</p>
164    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.inner = self.inner.set_description(input);
166        self
167    }
168    /// <p>A description for the address range and the address pool.</p>
169    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
170        self.inner.get_description()
171    }
172    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
173    pub fn dry_run(mut self, input: bool) -> Self {
174        self.inner = self.inner.dry_run(input);
175        self
176    }
177    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
178    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
179        self.inner = self.inner.set_dry_run(input);
180        self
181    }
182    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
183    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
184        self.inner.get_dry_run()
185    }
186    ///
187    /// Appends an item to `PoolTagSpecifications`.
188    ///
189    /// To override the contents of this collection use [`set_pool_tag_specifications`](Self::set_pool_tag_specifications).
190    ///
191    /// <p>The tags to apply to the address pool.</p>
192    pub fn pool_tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
193        self.inner = self.inner.pool_tag_specifications(input);
194        self
195    }
196    /// <p>The tags to apply to the address pool.</p>
197    pub fn set_pool_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
198        self.inner = self.inner.set_pool_tag_specifications(input);
199        self
200    }
201    /// <p>The tags to apply to the address pool.</p>
202    pub fn get_pool_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
203        self.inner.get_pool_tag_specifications()
204    }
205    /// <p>Reserved.</p>
206    pub fn multi_region(mut self, input: bool) -> Self {
207        self.inner = self.inner.multi_region(input);
208        self
209    }
210    /// <p>Reserved.</p>
211    pub fn set_multi_region(mut self, input: ::std::option::Option<bool>) -> Self {
212        self.inner = self.inner.set_multi_region(input);
213        self
214    }
215    /// <p>Reserved.</p>
216    pub fn get_multi_region(&self) -> &::std::option::Option<bool> {
217        self.inner.get_multi_region()
218    }
219    /// <p>If you have <a href="https://docs.aws.amazon.com/local-zones/latest/ug/how-local-zones-work.html">Local Zones</a> enabled, you can choose a network border group for Local Zones when you provision and advertise a BYOIPv4 CIDR. Choose the network border group carefully as the EIP and the Amazon Web Services resource it is associated with must reside in the same network border group.</p>
220    /// <p>You can provision BYOIP address ranges to and advertise them in the following Local Zone network border groups:</p>
221    /// <ul>
222    /// <li>
223    /// <p>us-east-1-dfw-2</p></li>
224    /// <li>
225    /// <p>us-west-2-lax-1</p></li>
226    /// <li>
227    /// <p>us-west-2-phx-2</p></li>
228    /// </ul><note>
229    /// <p>You cannot provision or advertise BYOIPv6 address ranges in Local Zones at this time.</p>
230    /// </note>
231    pub fn network_border_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232        self.inner = self.inner.network_border_group(input.into());
233        self
234    }
235    /// <p>If you have <a href="https://docs.aws.amazon.com/local-zones/latest/ug/how-local-zones-work.html">Local Zones</a> enabled, you can choose a network border group for Local Zones when you provision and advertise a BYOIPv4 CIDR. Choose the network border group carefully as the EIP and the Amazon Web Services resource it is associated with must reside in the same network border group.</p>
236    /// <p>You can provision BYOIP address ranges to and advertise them in the following Local Zone network border groups:</p>
237    /// <ul>
238    /// <li>
239    /// <p>us-east-1-dfw-2</p></li>
240    /// <li>
241    /// <p>us-west-2-lax-1</p></li>
242    /// <li>
243    /// <p>us-west-2-phx-2</p></li>
244    /// </ul><note>
245    /// <p>You cannot provision or advertise BYOIPv6 address ranges in Local Zones at this time.</p>
246    /// </note>
247    pub fn set_network_border_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
248        self.inner = self.inner.set_network_border_group(input);
249        self
250    }
251    /// <p>If you have <a href="https://docs.aws.amazon.com/local-zones/latest/ug/how-local-zones-work.html">Local Zones</a> enabled, you can choose a network border group for Local Zones when you provision and advertise a BYOIPv4 CIDR. Choose the network border group carefully as the EIP and the Amazon Web Services resource it is associated with must reside in the same network border group.</p>
252    /// <p>You can provision BYOIP address ranges to and advertise them in the following Local Zone network border groups:</p>
253    /// <ul>
254    /// <li>
255    /// <p>us-east-1-dfw-2</p></li>
256    /// <li>
257    /// <p>us-west-2-lax-1</p></li>
258    /// <li>
259    /// <p>us-west-2-phx-2</p></li>
260    /// </ul><note>
261    /// <p>You cannot provision or advertise BYOIPv6 address ranges in Local Zones at this time.</p>
262    /// </note>
263    pub fn get_network_border_group(&self) -> &::std::option::Option<::std::string::String> {
264        self.inner.get_network_border_group()
265    }
266}