aws_sdk_ec2/waiters/
vpn_connection_deleted.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `vpn_connection_deleted` waiter.
5///
6/// This builder is intended to be used similar to the other fluent builders for
7/// normal operations on the client. However, instead of a `send` method, it has
8/// a `wait` method that takes a maximum amount of time to wait.
9///
10/// Construct this fluent builder using the client by importing the
11/// [`Waiters`](crate::client::Waiters) trait and calling the methods
12/// prefixed with `wait_until`.
13///
14#[derive(::std::clone::Clone, ::std::fmt::Debug)]
15pub struct VpnConnectionDeletedFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_vpn_connections::builders::DescribeVpnConnectionsInputBuilder,
18}
19impl VpnConnectionDeletedFluentBuilder {
20    /// Creates a new `VpnConnectionDeletedFluentBuilder`.
21    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
22        Self {
23            handle,
24            inner: ::std::default::Default::default(),
25        }
26    }
27    /// Access the DescribeVpnConnections as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_vpn_connections::builders::DescribeVpnConnectionsInputBuilder {
29        &self.inner
30    }
31    /// Wait for `vpn_connection_deleted`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::vpn_connection_deleted::VpnConnectionDeletedFinalPoll,
37        crate::waiters::vpn_connection_deleted::WaitUntilVpnConnectionDeletedError,
38    > {
39        let input = self
40            .inner
41            .build()
42            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
43        let runtime_plugins = crate::operation::describe_vpn_connections::DescribeVpnConnections::operation_runtime_plugins(
44            self.handle.runtime_plugins.clone(),
45            &self.handle.conf,
46            ::std::option::Option::None,
47        )
48        .with_operation_plugin(crate::sdk_feature_tracker::waiter::WaiterFeatureTrackerRuntimePlugin::new());
49        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
50        let runtime_components_builder = runtime_plugins
51            .apply_client_configuration(&mut cfg)
52            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
53        let time_components = runtime_components_builder.into_time_components();
54        let sleep_impl = time_components.sleep_impl().expect("a sleep impl is required by waiters");
55        let time_source = time_components.time_source().expect("a time source is required by waiters");
56
57        let acceptor = move |result: ::std::result::Result<
58            &crate::operation::describe_vpn_connections::DescribeVpnConnectionsOutput,
59            &crate::operation::describe_vpn_connections::DescribeVpnConnectionsError,
60        >| {
61            // Matches: {"output":{"path":"VpnConnections[].State","expected":"deleted","comparator":"allStringEquals"}}
62            if crate::waiters::matchers::match_describe_vpn_connections_3fdf8e45e4e684e38(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"output":{"path":"VpnConnections[].State","expected":"pending","comparator":"anyStringEquals"}}
66            if crate::waiters::matchers::match_describe_vpn_connections_5becee76bf19ae9e0(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
68            }
69            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
70        };
71        let operation = move || {
72            let input = input.clone();
73            let runtime_plugins = runtime_plugins.clone();
74            async move { crate::operation::describe_vpn_connections::DescribeVpnConnections::orchestrate(&runtime_plugins, input).await }
75        };
76        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
77            .min_delay(::std::time::Duration::from_secs(15))
78            .max_delay(::std::time::Duration::from_secs(120))
79            .max_wait(max_wait)
80            .time_source(time_source)
81            .sleep_impl(sleep_impl)
82            .acceptor(acceptor)
83            .operation(operation)
84            .build();
85        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
86    }
87    ///
88    /// Appends an item to `Filters`.
89    ///
90    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
91    ///
92    /// <p>One or more filters.</p>
93    /// <ul>
94    /// <li>
95    /// <p><code>customer-gateway-configuration</code> - The configuration information for the customer gateway.</p></li>
96    /// <li>
97    /// <p><code>customer-gateway-id</code> - The ID of a customer gateway associated with the VPN connection.</p></li>
98    /// <li>
99    /// <p><code>state</code> - The state of the VPN connection (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
100    /// <li>
101    /// <p><code>option.static-routes-only</code> - Indicates whether the connection has static routes only. Used for devices that do not support Border Gateway Protocol (BGP).</p></li>
102    /// <li>
103    /// <p><code>route.destination-cidr-block</code> - The destination CIDR block. This corresponds to the subnet used in a customer data center.</p></li>
104    /// <li>
105    /// <p><code>bgp-asn</code> - The BGP Autonomous System Number (ASN) associated with a BGP device.</p></li>
106    /// <li>
107    /// <p><code>tag</code>:<key>
108    /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
109    /// <code>Owner</code> and the value
110    /// <code>TeamA</code>, specify
111    /// <code>tag:Owner</code> for the filter name and
112    /// <code>TeamA</code> for the filter value.
113    /// </key></p></li>
114    /// <li>
115    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
116    /// <li>
117    /// <p><code>type</code> - The type of VPN connection. Currently the only supported type is <code>ipsec.1</code>.</p></li>
118    /// <li>
119    /// <p><code>vpn-connection-id</code> - The ID of the VPN connection.</p></li>
120    /// <li>
121    /// <p><code>vpn-gateway-id</code> - The ID of a virtual private gateway associated with the VPN connection.</p></li>
122    /// <li>
123    /// <p><code>transit-gateway-id</code> - The ID of a transit gateway associated with the VPN connection.</p></li>
124    /// </ul>
125    pub fn filters(mut self, input: crate::types::Filter) -> Self {
126        self.inner = self.inner.filters(input);
127        self
128    }
129    /// <p>One or more filters.</p>
130    /// <ul>
131    /// <li>
132    /// <p><code>customer-gateway-configuration</code> - The configuration information for the customer gateway.</p></li>
133    /// <li>
134    /// <p><code>customer-gateway-id</code> - The ID of a customer gateway associated with the VPN connection.</p></li>
135    /// <li>
136    /// <p><code>state</code> - The state of the VPN connection (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
137    /// <li>
138    /// <p><code>option.static-routes-only</code> - Indicates whether the connection has static routes only. Used for devices that do not support Border Gateway Protocol (BGP).</p></li>
139    /// <li>
140    /// <p><code>route.destination-cidr-block</code> - The destination CIDR block. This corresponds to the subnet used in a customer data center.</p></li>
141    /// <li>
142    /// <p><code>bgp-asn</code> - The BGP Autonomous System Number (ASN) associated with a BGP device.</p></li>
143    /// <li>
144    /// <p><code>tag</code>:<key>
145    /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
146    /// <code>Owner</code> and the value
147    /// <code>TeamA</code>, specify
148    /// <code>tag:Owner</code> for the filter name and
149    /// <code>TeamA</code> for the filter value.
150    /// </key></p></li>
151    /// <li>
152    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
153    /// <li>
154    /// <p><code>type</code> - The type of VPN connection. Currently the only supported type is <code>ipsec.1</code>.</p></li>
155    /// <li>
156    /// <p><code>vpn-connection-id</code> - The ID of the VPN connection.</p></li>
157    /// <li>
158    /// <p><code>vpn-gateway-id</code> - The ID of a virtual private gateway associated with the VPN connection.</p></li>
159    /// <li>
160    /// <p><code>transit-gateway-id</code> - The ID of a transit gateway associated with the VPN connection.</p></li>
161    /// </ul>
162    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
163        self.inner = self.inner.set_filters(input);
164        self
165    }
166    /// <p>One or more filters.</p>
167    /// <ul>
168    /// <li>
169    /// <p><code>customer-gateway-configuration</code> - The configuration information for the customer gateway.</p></li>
170    /// <li>
171    /// <p><code>customer-gateway-id</code> - The ID of a customer gateway associated with the VPN connection.</p></li>
172    /// <li>
173    /// <p><code>state</code> - The state of the VPN connection (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
174    /// <li>
175    /// <p><code>option.static-routes-only</code> - Indicates whether the connection has static routes only. Used for devices that do not support Border Gateway Protocol (BGP).</p></li>
176    /// <li>
177    /// <p><code>route.destination-cidr-block</code> - The destination CIDR block. This corresponds to the subnet used in a customer data center.</p></li>
178    /// <li>
179    /// <p><code>bgp-asn</code> - The BGP Autonomous System Number (ASN) associated with a BGP device.</p></li>
180    /// <li>
181    /// <p><code>tag</code>:<key>
182    /// - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key
183    /// <code>Owner</code> and the value
184    /// <code>TeamA</code>, specify
185    /// <code>tag:Owner</code> for the filter name and
186    /// <code>TeamA</code> for the filter value.
187    /// </key></p></li>
188    /// <li>
189    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
190    /// <li>
191    /// <p><code>type</code> - The type of VPN connection. Currently the only supported type is <code>ipsec.1</code>.</p></li>
192    /// <li>
193    /// <p><code>vpn-connection-id</code> - The ID of the VPN connection.</p></li>
194    /// <li>
195    /// <p><code>vpn-gateway-id</code> - The ID of a virtual private gateway associated with the VPN connection.</p></li>
196    /// <li>
197    /// <p><code>transit-gateway-id</code> - The ID of a transit gateway associated with the VPN connection.</p></li>
198    /// </ul>
199    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
200        self.inner.get_filters()
201    }
202    ///
203    /// Appends an item to `VpnConnectionIds`.
204    ///
205    /// To override the contents of this collection use [`set_vpn_connection_ids`](Self::set_vpn_connection_ids).
206    ///
207    /// <p>One or more VPN connection IDs.</p>
208    /// <p>Default: Describes your VPN connections.</p>
209    pub fn vpn_connection_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210        self.inner = self.inner.vpn_connection_ids(input.into());
211        self
212    }
213    /// <p>One or more VPN connection IDs.</p>
214    /// <p>Default: Describes your VPN connections.</p>
215    pub fn set_vpn_connection_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
216        self.inner = self.inner.set_vpn_connection_ids(input);
217        self
218    }
219    /// <p>One or more VPN connection IDs.</p>
220    /// <p>Default: Describes your VPN connections.</p>
221    pub fn get_vpn_connection_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
222        self.inner.get_vpn_connection_ids()
223    }
224    /// <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>
225    pub fn dry_run(mut self, input: bool) -> Self {
226        self.inner = self.inner.dry_run(input);
227        self
228    }
229    /// <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>
230    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
231        self.inner = self.inner.set_dry_run(input);
232        self
233    }
234    /// <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>
235    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
236        self.inner.get_dry_run()
237    }
238}
239
240/// Successful return type for the `vpn_connection_deleted` waiter.
241pub type VpnConnectionDeletedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
242    crate::operation::describe_vpn_connections::DescribeVpnConnectionsOutput,
243    ::aws_smithy_runtime_api::client::result::SdkError<
244        crate::operation::describe_vpn_connections::DescribeVpnConnectionsError,
245        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
246    >,
247>;
248
249/// Error type for the `vpn_connection_deleted` waiter.
250pub type WaitUntilVpnConnectionDeletedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
251    crate::operation::describe_vpn_connections::DescribeVpnConnectionsOutput,
252    crate::operation::describe_vpn_connections::DescribeVpnConnectionsError,
253>;