aws_sdk_ec2/operation/create_customer_gateway/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_customer_gateway::_create_customer_gateway_output::CreateCustomerGatewayOutputBuilder;
3
4pub use crate::operation::create_customer_gateway::_create_customer_gateway_input::CreateCustomerGatewayInputBuilder;
5
6impl crate::operation::create_customer_gateway::builders::CreateCustomerGatewayInputBuilder {
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::create_customer_gateway::CreateCustomerGatewayOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_customer_gateway::CreateCustomerGatewayError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_customer_gateway();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateCustomerGateway`.
24///
25/// <p>Provides information to Amazon Web Services about your customer gateway device. The customer gateway device is the appliance at your end of the VPN connection. You must provide the IP address of the customer gateway device’s external interface. The IP address must be static and can be behind a device performing network address translation (NAT).</p>
26/// <p>For devices that use Border Gateway Protocol (BGP), you can also provide the device's BGP Autonomous System Number (ASN). You can use an existing ASN assigned to your network. If you don't have an ASN already, you can use a private ASN. For more information, see <a href="https://docs.aws.amazon.com/vpn/latest/s2svpn/cgw-options.html">Customer gateway options for your Site-to-Site VPN connection</a> in the <i>Amazon Web Services Site-to-Site VPN User Guide</i>.</p>
27/// <p>To create more than one customer gateway with the same VPN type, IP address, and BGP ASN, specify a unique device name for each customer gateway. An identical request returns information about the existing customer gateway; it doesn't create a new customer gateway.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateCustomerGatewayFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::create_customer_gateway::builders::CreateCustomerGatewayInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::create_customer_gateway::CreateCustomerGatewayOutput,
37        crate::operation::create_customer_gateway::CreateCustomerGatewayError,
38    > for CreateCustomerGatewayFluentBuilder
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::create_customer_gateway::CreateCustomerGatewayOutput,
46            crate::operation::create_customer_gateway::CreateCustomerGatewayError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl CreateCustomerGatewayFluentBuilder {
53    /// Creates a new `CreateCustomerGatewayFluentBuilder`.
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 CreateCustomerGateway as a reference.
62    pub fn as_input(&self) -> &crate::operation::create_customer_gateway::builders::CreateCustomerGatewayInputBuilder {
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::create_customer_gateway::CreateCustomerGatewayOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::create_customer_gateway::CreateCustomerGatewayError,
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::create_customer_gateway::CreateCustomerGateway::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::create_customer_gateway::CreateCustomerGateway::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::create_customer_gateway::CreateCustomerGatewayOutput,
99        crate::operation::create_customer_gateway::CreateCustomerGatewayError,
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>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
114    /// <p>Default: 65000</p>
115    /// <p>Valid values: <code>1</code> to <code>2,147,483,647</code></p>
116    pub fn bgp_asn(mut self, input: i32) -> Self {
117        self.inner = self.inner.bgp_asn(input);
118        self
119    }
120    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
121    /// <p>Default: 65000</p>
122    /// <p>Valid values: <code>1</code> to <code>2,147,483,647</code></p>
123    pub fn set_bgp_asn(mut self, input: ::std::option::Option<i32>) -> Self {
124        self.inner = self.inner.set_bgp_asn(input);
125        self
126    }
127    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
128    /// <p>Default: 65000</p>
129    /// <p>Valid values: <code>1</code> to <code>2,147,483,647</code></p>
130    pub fn get_bgp_asn(&self) -> &::std::option::Option<i32> {
131        self.inner.get_bgp_asn()
132    }
133    /// <p><i>This member has been deprecated.</i> The Internet-routable IP address for the customer gateway's outside interface. The address must be static.</p>
134    pub fn public_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.public_ip(input.into());
136        self
137    }
138    /// <p><i>This member has been deprecated.</i> The Internet-routable IP address for the customer gateway's outside interface. The address must be static.</p>
139    pub fn set_public_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_public_ip(input);
141        self
142    }
143    /// <p><i>This member has been deprecated.</i> The Internet-routable IP address for the customer gateway's outside interface. The address must be static.</p>
144    pub fn get_public_ip(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_public_ip()
146    }
147    /// <p>The Amazon Resource Name (ARN) for the customer gateway certificate.</p>
148    pub fn certificate_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.certificate_arn(input.into());
150        self
151    }
152    /// <p>The Amazon Resource Name (ARN) for the customer gateway certificate.</p>
153    pub fn set_certificate_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_certificate_arn(input);
155        self
156    }
157    /// <p>The Amazon Resource Name (ARN) for the customer gateway certificate.</p>
158    pub fn get_certificate_arn(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_certificate_arn()
160    }
161    /// <p>The type of VPN connection that this customer gateway supports (<code>ipsec.1</code>).</p>
162    pub fn r#type(mut self, input: crate::types::GatewayType) -> Self {
163        self.inner = self.inner.r#type(input);
164        self
165    }
166    /// <p>The type of VPN connection that this customer gateway supports (<code>ipsec.1</code>).</p>
167    pub fn set_type(mut self, input: ::std::option::Option<crate::types::GatewayType>) -> Self {
168        self.inner = self.inner.set_type(input);
169        self
170    }
171    /// <p>The type of VPN connection that this customer gateway supports (<code>ipsec.1</code>).</p>
172    pub fn get_type(&self) -> &::std::option::Option<crate::types::GatewayType> {
173        self.inner.get_type()
174    }
175    ///
176    /// Appends an item to `TagSpecifications`.
177    ///
178    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
179    ///
180    /// <p>The tags to apply to the customer gateway.</p>
181    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
182        self.inner = self.inner.tag_specifications(input);
183        self
184    }
185    /// <p>The tags to apply to the customer gateway.</p>
186    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
187        self.inner = self.inner.set_tag_specifications(input);
188        self
189    }
190    /// <p>The tags to apply to the customer gateway.</p>
191    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
192        self.inner.get_tag_specifications()
193    }
194    /// <p>A name for the customer gateway device.</p>
195    /// <p>Length Constraints: Up to 255 characters.</p>
196    pub fn device_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.inner = self.inner.device_name(input.into());
198        self
199    }
200    /// <p>A name for the customer gateway device.</p>
201    /// <p>Length Constraints: Up to 255 characters.</p>
202    pub fn set_device_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203        self.inner = self.inner.set_device_name(input);
204        self
205    }
206    /// <p>A name for the customer gateway device.</p>
207    /// <p>Length Constraints: Up to 255 characters.</p>
208    pub fn get_device_name(&self) -> &::std::option::Option<::std::string::String> {
209        self.inner.get_device_name()
210    }
211    /// <p>IPv4 address for the customer gateway device's outside interface. The address must be static. If <code>OutsideIpAddressType</code> in your VPN connection options is set to <code>PrivateIpv4</code>, you can use an RFC6598 or RFC1918 private IPv4 address. If <code>OutsideIpAddressType</code> is set to <code>PublicIpv4</code>, you can use a public IPv4 address.</p>
212    pub fn ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.inner = self.inner.ip_address(input.into());
214        self
215    }
216    /// <p>IPv4 address for the customer gateway device's outside interface. The address must be static. If <code>OutsideIpAddressType</code> in your VPN connection options is set to <code>PrivateIpv4</code>, you can use an RFC6598 or RFC1918 private IPv4 address. If <code>OutsideIpAddressType</code> is set to <code>PublicIpv4</code>, you can use a public IPv4 address.</p>
217    pub fn set_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.inner = self.inner.set_ip_address(input);
219        self
220    }
221    /// <p>IPv4 address for the customer gateway device's outside interface. The address must be static. If <code>OutsideIpAddressType</code> in your VPN connection options is set to <code>PrivateIpv4</code>, you can use an RFC6598 or RFC1918 private IPv4 address. If <code>OutsideIpAddressType</code> is set to <code>PublicIpv4</code>, you can use a public IPv4 address.</p>
222    pub fn get_ip_address(&self) -> &::std::option::Option<::std::string::String> {
223        self.inner.get_ip_address()
224    }
225    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
226    /// <p>Valid values: <code>2,147,483,648</code> to <code>4,294,967,295</code></p>
227    pub fn bgp_asn_extended(mut self, input: i64) -> Self {
228        self.inner = self.inner.bgp_asn_extended(input);
229        self
230    }
231    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
232    /// <p>Valid values: <code>2,147,483,648</code> to <code>4,294,967,295</code></p>
233    pub fn set_bgp_asn_extended(mut self, input: ::std::option::Option<i64>) -> Self {
234        self.inner = self.inner.set_bgp_asn_extended(input);
235        self
236    }
237    /// <p>For customer gateway devices that support BGP, specify the device's ASN. You must specify either <code>BgpAsn</code> or <code>BgpAsnExtended</code> when creating the customer gateway. If the ASN is larger than <code>2,147,483,647</code>, you must use <code>BgpAsnExtended</code>.</p>
238    /// <p>Valid values: <code>2,147,483,648</code> to <code>4,294,967,295</code></p>
239    pub fn get_bgp_asn_extended(&self) -> &::std::option::Option<i64> {
240        self.inner.get_bgp_asn_extended()
241    }
242    /// <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>
243    pub fn dry_run(mut self, input: bool) -> Self {
244        self.inner = self.inner.dry_run(input);
245        self
246    }
247    /// <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>
248    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
249        self.inner = self.inner.set_dry_run(input);
250        self
251    }
252    /// <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>
253    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
254        self.inner.get_dry_run()
255    }
256}