aws_sdk_ec2/operation/modify_vpn_connection/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::modify_vpn_connection::_modify_vpn_connection_output::ModifyVpnConnectionOutputBuilder;
3
4pub use crate::operation::modify_vpn_connection::_modify_vpn_connection_input::ModifyVpnConnectionInputBuilder;
5
6impl crate::operation::modify_vpn_connection::builders::ModifyVpnConnectionInputBuilder {
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::modify_vpn_connection::ModifyVpnConnectionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::modify_vpn_connection::ModifyVpnConnectionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.modify_vpn_connection();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ModifyVpnConnection`.
24///
25/// <p>Modifies the customer gateway or the target gateway of an Amazon Web Services Site-to-Site VPN connection. To modify the target gateway, the following migration options are available:</p>
26/// <ul>
27/// <li>
28/// <p>An existing virtual private gateway to a new virtual private gateway</p></li>
29/// <li>
30/// <p>An existing virtual private gateway to a transit gateway</p></li>
31/// <li>
32/// <p>An existing transit gateway to a new transit gateway</p></li>
33/// <li>
34/// <p>An existing transit gateway to a virtual private gateway</p></li>
35/// </ul>
36/// <p>Before you perform the migration to the new gateway, you must configure the new gateway. Use <code>CreateVpnGateway</code> to create a virtual private gateway, or <code>CreateTransitGateway</code> to create a transit gateway.</p>
37/// <p>This step is required when you migrate from a virtual private gateway with static routes to a transit gateway.</p>
38/// <p>You must delete the static routes before you migrate to the new gateway.</p>
39/// <p>Keep a copy of the static route before you delete it. You will need to add back these routes to the transit gateway after the VPN connection migration is complete.</p>
40/// <p>After you migrate to the new gateway, you might need to modify your VPC route table. Use <code>CreateRoute</code> and <code>DeleteRoute</code> to make the changes described in <a href="https://docs.aws.amazon.com/vpn/latest/s2svpn/modify-vpn-target.html#step-update-routing">Update VPC route tables</a> in the <i>Amazon Web Services Site-to-Site VPN User Guide</i>.</p>
41/// <p>When the new gateway is a transit gateway, modify the transit gateway route table to allow traffic between the VPC and the Amazon Web Services Site-to-Site VPN connection. Use <code>CreateTransitGatewayRoute</code> to add the routes.</p>
42/// <p>If you deleted VPN static routes, you must add the static routes to the transit gateway route table.</p>
43/// <p>After you perform this operation, the VPN endpoint's IP addresses on the Amazon Web Services side and the tunnel options remain intact. Your Amazon Web Services Site-to-Site VPN connection will be temporarily unavailable for a brief period while we provision the new endpoints.</p>
44#[derive(::std::clone::Clone, ::std::fmt::Debug)]
45pub struct ModifyVpnConnectionFluentBuilder {
46    handle: ::std::sync::Arc<crate::client::Handle>,
47    inner: crate::operation::modify_vpn_connection::builders::ModifyVpnConnectionInputBuilder,
48    config_override: ::std::option::Option<crate::config::Builder>,
49}
50impl
51    crate::client::customize::internal::CustomizableSend<
52        crate::operation::modify_vpn_connection::ModifyVpnConnectionOutput,
53        crate::operation::modify_vpn_connection::ModifyVpnConnectionError,
54    > for ModifyVpnConnectionFluentBuilder
55{
56    fn send(
57        self,
58        config_override: crate::config::Builder,
59    ) -> crate::client::customize::internal::BoxFuture<
60        crate::client::customize::internal::SendResult<
61            crate::operation::modify_vpn_connection::ModifyVpnConnectionOutput,
62            crate::operation::modify_vpn_connection::ModifyVpnConnectionError,
63        >,
64    > {
65        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
66    }
67}
68impl ModifyVpnConnectionFluentBuilder {
69    /// Creates a new `ModifyVpnConnectionFluentBuilder`.
70    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
71        Self {
72            handle,
73            inner: ::std::default::Default::default(),
74            config_override: ::std::option::Option::None,
75        }
76    }
77    /// Access the ModifyVpnConnection as a reference.
78    pub fn as_input(&self) -> &crate::operation::modify_vpn_connection::builders::ModifyVpnConnectionInputBuilder {
79        &self.inner
80    }
81    /// Sends the request and returns the response.
82    ///
83    /// If an error occurs, an `SdkError` will be returned with additional details that
84    /// can be matched against.
85    ///
86    /// By default, any retryable failures will be retried twice. Retry behavior
87    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
88    /// set when configuring the client.
89    pub async fn send(
90        self,
91    ) -> ::std::result::Result<
92        crate::operation::modify_vpn_connection::ModifyVpnConnectionOutput,
93        ::aws_smithy_runtime_api::client::result::SdkError<
94            crate::operation::modify_vpn_connection::ModifyVpnConnectionError,
95            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
96        >,
97    > {
98        let input = self
99            .inner
100            .build()
101            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
102        let runtime_plugins = crate::operation::modify_vpn_connection::ModifyVpnConnection::operation_runtime_plugins(
103            self.handle.runtime_plugins.clone(),
104            &self.handle.conf,
105            self.config_override,
106        );
107        crate::operation::modify_vpn_connection::ModifyVpnConnection::orchestrate(&runtime_plugins, input).await
108    }
109
110    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
111    pub fn customize(
112        self,
113    ) -> crate::client::customize::CustomizableOperation<
114        crate::operation::modify_vpn_connection::ModifyVpnConnectionOutput,
115        crate::operation::modify_vpn_connection::ModifyVpnConnectionError,
116        Self,
117    > {
118        crate::client::customize::CustomizableOperation::new(self)
119    }
120    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
121        self.set_config_override(::std::option::Option::Some(config_override.into()));
122        self
123    }
124
125    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
126        self.config_override = config_override;
127        self
128    }
129    /// <p>The ID of the VPN connection.</p>
130    pub fn vpn_connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.vpn_connection_id(input.into());
132        self
133    }
134    /// <p>The ID of the VPN connection.</p>
135    pub fn set_vpn_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_vpn_connection_id(input);
137        self
138    }
139    /// <p>The ID of the VPN connection.</p>
140    pub fn get_vpn_connection_id(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_vpn_connection_id()
142    }
143    /// <p>The ID of the transit gateway.</p>
144    pub fn transit_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.transit_gateway_id(input.into());
146        self
147    }
148    /// <p>The ID of the transit gateway.</p>
149    pub fn set_transit_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_transit_gateway_id(input);
151        self
152    }
153    /// <p>The ID of the transit gateway.</p>
154    pub fn get_transit_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
155        self.inner.get_transit_gateway_id()
156    }
157    /// <p>The ID of the customer gateway at your end of the VPN connection.</p>
158    pub fn customer_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.inner = self.inner.customer_gateway_id(input.into());
160        self
161    }
162    /// <p>The ID of the customer gateway at your end of the VPN connection.</p>
163    pub fn set_customer_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.inner = self.inner.set_customer_gateway_id(input);
165        self
166    }
167    /// <p>The ID of the customer gateway at your end of the VPN connection.</p>
168    pub fn get_customer_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
169        self.inner.get_customer_gateway_id()
170    }
171    /// <p>The ID of the virtual private gateway at the Amazon Web Services side of the VPN connection.</p>
172    pub fn vpn_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.inner = self.inner.vpn_gateway_id(input.into());
174        self
175    }
176    /// <p>The ID of the virtual private gateway at the Amazon Web Services side of the VPN connection.</p>
177    pub fn set_vpn_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.inner = self.inner.set_vpn_gateway_id(input);
179        self
180    }
181    /// <p>The ID of the virtual private gateway at the Amazon Web Services side of the VPN connection.</p>
182    pub fn get_vpn_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
183        self.inner.get_vpn_gateway_id()
184    }
185    /// <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>
186    pub fn dry_run(mut self, input: bool) -> Self {
187        self.inner = self.inner.dry_run(input);
188        self
189    }
190    /// <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>
191    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
192        self.inner = self.inner.set_dry_run(input);
193        self
194    }
195    /// <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>
196    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
197        self.inner.get_dry_run()
198    }
199}