aws_sdk_ec2/waiters/
vpn_connection_available.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `vpn_connection_available` 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 VpnConnectionAvailableFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_vpn_connections::builders::DescribeVpnConnectionsInputBuilder,
18}
19impl VpnConnectionAvailableFluentBuilder {
20    /// Creates a new `VpnConnectionAvailableFluentBuilder`.
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_available`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::vpn_connection_available::VpnConnectionAvailableFinalPoll,
37        crate::waiters::vpn_connection_available::WaitUntilVpnConnectionAvailableError,
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":"available","comparator":"allStringEquals"}}
62            if crate::waiters::matchers::match_describe_vpn_connections_70b193b3621ebab21(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"output":{"path":"VpnConnections[].State","expected":"deleting","comparator":"anyStringEquals"}}
66            if crate::waiters::matchers::match_describe_vpn_connections_ca4f43c6c5dfc3212(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
68            }
69            // Matches: {"output":{"path":"VpnConnections[].State","expected":"deleted","comparator":"anyStringEquals"}}
70            if crate::waiters::matchers::match_describe_vpn_connections_59d6f494234bab17e(result) {
71                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
72            }
73            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
74        };
75        let operation = move || {
76            let input = input.clone();
77            let runtime_plugins = runtime_plugins.clone();
78            async move { crate::operation::describe_vpn_connections::DescribeVpnConnections::orchestrate(&runtime_plugins, input).await }
79        };
80        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
81            .min_delay(::std::time::Duration::from_secs(15))
82            .max_delay(::std::time::Duration::from_secs(120))
83            .max_wait(max_wait)
84            .time_source(time_source)
85            .sleep_impl(sleep_impl)
86            .acceptor(acceptor)
87            .operation(operation)
88            .build();
89        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
90    }
91    ///
92    /// Appends an item to `Filters`.
93    ///
94    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
95    ///
96    /// <p>One or more filters.</p>
97    /// <ul>
98    /// <li>
99    /// <p><code>customer-gateway-configuration</code> - The configuration information for the customer gateway.</p></li>
100    /// <li>
101    /// <p><code>customer-gateway-id</code> - The ID of a customer gateway associated with the VPN connection.</p></li>
102    /// <li>
103    /// <p><code>state</code> - The state of the VPN connection (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
104    /// <li>
105    /// <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>
106    /// <li>
107    /// <p><code>route.destination-cidr-block</code> - The destination CIDR block. This corresponds to the subnet used in a customer data center.</p></li>
108    /// <li>
109    /// <p><code>bgp-asn</code> - The BGP Autonomous System Number (ASN) associated with a BGP device.</p></li>
110    /// <li>
111    /// <p><code>tag</code>:<key>
112    /// - 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
113    /// <code>Owner</code> and the value
114    /// <code>TeamA</code>, specify
115    /// <code>tag:Owner</code> for the filter name and
116    /// <code>TeamA</code> for the filter value.
117    /// </key></p></li>
118    /// <li>
119    /// <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>
120    /// <li>
121    /// <p><code>type</code> - The type of VPN connection. Currently the only supported type is <code>ipsec.1</code>.</p></li>
122    /// <li>
123    /// <p><code>vpn-connection-id</code> - The ID of the VPN connection.</p></li>
124    /// <li>
125    /// <p><code>vpn-gateway-id</code> - The ID of a virtual private gateway associated with the VPN connection.</p></li>
126    /// <li>
127    /// <p><code>transit-gateway-id</code> - The ID of a transit gateway associated with the VPN connection.</p></li>
128    /// </ul>
129    pub fn filters(mut self, input: crate::types::Filter) -> Self {
130        self.inner = self.inner.filters(input);
131        self
132    }
133    /// <p>One or more filters.</p>
134    /// <ul>
135    /// <li>
136    /// <p><code>customer-gateway-configuration</code> - The configuration information for the customer gateway.</p></li>
137    /// <li>
138    /// <p><code>customer-gateway-id</code> - The ID of a customer gateway associated with the VPN connection.</p></li>
139    /// <li>
140    /// <p><code>state</code> - The state of the VPN connection (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
141    /// <li>
142    /// <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>
143    /// <li>
144    /// <p><code>route.destination-cidr-block</code> - The destination CIDR block. This corresponds to the subnet used in a customer data center.</p></li>
145    /// <li>
146    /// <p><code>bgp-asn</code> - The BGP Autonomous System Number (ASN) associated with a BGP device.</p></li>
147    /// <li>
148    /// <p><code>tag</code>:<key>
149    /// - 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
150    /// <code>Owner</code> and the value
151    /// <code>TeamA</code>, specify
152    /// <code>tag:Owner</code> for the filter name and
153    /// <code>TeamA</code> for the filter value.
154    /// </key></p></li>
155    /// <li>
156    /// <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>
157    /// <li>
158    /// <p><code>type</code> - The type of VPN connection. Currently the only supported type is <code>ipsec.1</code>.</p></li>
159    /// <li>
160    /// <p><code>vpn-connection-id</code> - The ID of the VPN connection.</p></li>
161    /// <li>
162    /// <p><code>vpn-gateway-id</code> - The ID of a virtual private gateway associated with the VPN connection.</p></li>
163    /// <li>
164    /// <p><code>transit-gateway-id</code> - The ID of a transit gateway associated with the VPN connection.</p></li>
165    /// </ul>
166    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
167        self.inner = self.inner.set_filters(input);
168        self
169    }
170    /// <p>One or more filters.</p>
171    /// <ul>
172    /// <li>
173    /// <p><code>customer-gateway-configuration</code> - The configuration information for the customer gateway.</p></li>
174    /// <li>
175    /// <p><code>customer-gateway-id</code> - The ID of a customer gateway associated with the VPN connection.</p></li>
176    /// <li>
177    /// <p><code>state</code> - The state of the VPN connection (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
178    /// <li>
179    /// <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>
180    /// <li>
181    /// <p><code>route.destination-cidr-block</code> - The destination CIDR block. This corresponds to the subnet used in a customer data center.</p></li>
182    /// <li>
183    /// <p><code>bgp-asn</code> - The BGP Autonomous System Number (ASN) associated with a BGP device.</p></li>
184    /// <li>
185    /// <p><code>tag</code>:<key>
186    /// - 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
187    /// <code>Owner</code> and the value
188    /// <code>TeamA</code>, specify
189    /// <code>tag:Owner</code> for the filter name and
190    /// <code>TeamA</code> for the filter value.
191    /// </key></p></li>
192    /// <li>
193    /// <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>
194    /// <li>
195    /// <p><code>type</code> - The type of VPN connection. Currently the only supported type is <code>ipsec.1</code>.</p></li>
196    /// <li>
197    /// <p><code>vpn-connection-id</code> - The ID of the VPN connection.</p></li>
198    /// <li>
199    /// <p><code>vpn-gateway-id</code> - The ID of a virtual private gateway associated with the VPN connection.</p></li>
200    /// <li>
201    /// <p><code>transit-gateway-id</code> - The ID of a transit gateway associated with the VPN connection.</p></li>
202    /// </ul>
203    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
204        self.inner.get_filters()
205    }
206    ///
207    /// Appends an item to `VpnConnectionIds`.
208    ///
209    /// To override the contents of this collection use [`set_vpn_connection_ids`](Self::set_vpn_connection_ids).
210    ///
211    /// <p>One or more VPN connection IDs.</p>
212    /// <p>Default: Describes your VPN connections.</p>
213    pub fn vpn_connection_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214        self.inner = self.inner.vpn_connection_ids(input.into());
215        self
216    }
217    /// <p>One or more VPN connection IDs.</p>
218    /// <p>Default: Describes your VPN connections.</p>
219    pub fn set_vpn_connection_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
220        self.inner = self.inner.set_vpn_connection_ids(input);
221        self
222    }
223    /// <p>One or more VPN connection IDs.</p>
224    /// <p>Default: Describes your VPN connections.</p>
225    pub fn get_vpn_connection_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
226        self.inner.get_vpn_connection_ids()
227    }
228    /// <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>
229    pub fn dry_run(mut self, input: bool) -> Self {
230        self.inner = self.inner.dry_run(input);
231        self
232    }
233    /// <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>
234    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
235        self.inner = self.inner.set_dry_run(input);
236        self
237    }
238    /// <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>
239    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
240        self.inner.get_dry_run()
241    }
242}
243
244/// Successful return type for the `vpn_connection_available` waiter.
245pub type VpnConnectionAvailableFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
246    crate::operation::describe_vpn_connections::DescribeVpnConnectionsOutput,
247    ::aws_smithy_runtime_api::client::result::SdkError<
248        crate::operation::describe_vpn_connections::DescribeVpnConnectionsError,
249        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
250    >,
251>;
252
253/// Error type for the `vpn_connection_available` waiter.
254pub type WaitUntilVpnConnectionAvailableError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
255    crate::operation::describe_vpn_connections::DescribeVpnConnectionsOutput,
256    crate::operation::describe_vpn_connections::DescribeVpnConnectionsError,
257>;