aws_sdk_ec2/waiters/
vpc_available.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `vpc_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 VpcAvailableFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_vpcs::builders::DescribeVpcsInputBuilder,
18}
19impl VpcAvailableFluentBuilder {
20    /// Creates a new `VpcAvailableFluentBuilder`.
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 DescribeVpcs as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_vpcs::builders::DescribeVpcsInputBuilder {
29        &self.inner
30    }
31    /// Wait for `vpc_available`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<crate::waiters::vpc_available::VpcAvailableFinalPoll, crate::waiters::vpc_available::WaitUntilVpcAvailableError> {
36        let input = self
37            .inner
38            .build()
39            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
40        let runtime_plugins = crate::operation::describe_vpcs::DescribeVpcs::operation_runtime_plugins(
41            self.handle.runtime_plugins.clone(),
42            &self.handle.conf,
43            ::std::option::Option::None,
44        )
45        .with_operation_plugin(crate::sdk_feature_tracker::waiter::WaiterFeatureTrackerRuntimePlugin::new());
46        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
47        let runtime_components_builder = runtime_plugins
48            .apply_client_configuration(&mut cfg)
49            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
50        let time_components = runtime_components_builder.into_time_components();
51        let sleep_impl = time_components.sleep_impl().expect("a sleep impl is required by waiters");
52        let time_source = time_components.time_source().expect("a time source is required by waiters");
53
54        let acceptor = move |result: ::std::result::Result<
55            &crate::operation::describe_vpcs::DescribeVpcsOutput,
56            &crate::operation::describe_vpcs::DescribeVpcsError,
57        >| {
58            // Matches: {"output":{"path":"Vpcs[].State","expected":"available","comparator":"allStringEquals"}}
59            if crate::waiters::matchers::match_describe_vpcs_758fa5df2adba3998(result) {
60                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
61            }
62            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
63        };
64        let operation = move || {
65            let input = input.clone();
66            let runtime_plugins = runtime_plugins.clone();
67            async move { crate::operation::describe_vpcs::DescribeVpcs::orchestrate(&runtime_plugins, input).await }
68        };
69        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
70            .min_delay(::std::time::Duration::from_secs(15))
71            .max_delay(::std::time::Duration::from_secs(120))
72            .max_wait(max_wait)
73            .time_source(time_source)
74            .sleep_impl(sleep_impl)
75            .acceptor(acceptor)
76            .operation(operation)
77            .build();
78        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
79    }
80    ///
81    /// Appends an item to `Filters`.
82    ///
83    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
84    ///
85    /// <p>The filters.</p>
86    /// <ul>
87    /// <li>
88    /// <p><code>cidr</code> - The primary IPv4 CIDR block of the VPC. The CIDR block you specify must exactly match the VPC's CIDR block for information to be returned for the VPC. Must contain the slash followed by one or two digits (for example, <code>/28</code>).</p></li>
89    /// <li>
90    /// <p><code>cidr-block-association.cidr-block</code> - An IPv4 CIDR block associated with the VPC.</p></li>
91    /// <li>
92    /// <p><code>cidr-block-association.association-id</code> - The association ID for an IPv4 CIDR block associated with the VPC.</p></li>
93    /// <li>
94    /// <p><code>cidr-block-association.state</code> - The state of an IPv4 CIDR block associated with the VPC.</p></li>
95    /// <li>
96    /// <p><code>dhcp-options-id</code> - The ID of a set of DHCP options.</p></li>
97    /// <li>
98    /// <p><code>ipv6-cidr-block-association.ipv6-cidr-block</code> - An IPv6 CIDR block associated with the VPC.</p></li>
99    /// <li>
100    /// <p><code>ipv6-cidr-block-association.ipv6-pool</code> - The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated.</p></li>
101    /// <li>
102    /// <p><code>ipv6-cidr-block-association.association-id</code> - The association ID for an IPv6 CIDR block associated with the VPC.</p></li>
103    /// <li>
104    /// <p><code>ipv6-cidr-block-association.state</code> - The state of an IPv6 CIDR block associated with the VPC.</p></li>
105    /// <li>
106    /// <p><code>is-default</code> - Indicates whether the VPC is the default VPC.</p></li>
107    /// <li>
108    /// <p><code>owner-id</code> - The ID of the Amazon Web Services account that owns the VPC.</p></li>
109    /// <li>
110    /// <p><code>state</code> - The state of the VPC (<code>pending</code> | <code>available</code>).</p></li>
111    /// <li>
112    /// <p><code>tag</code> - 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 <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
113    /// <li>
114    /// <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>
115    /// <li>
116    /// <p><code>vpc-id</code> - The ID of the VPC.</p></li>
117    /// </ul>
118    pub fn filters(mut self, input: crate::types::Filter) -> Self {
119        self.inner = self.inner.filters(input);
120        self
121    }
122    /// <p>The filters.</p>
123    /// <ul>
124    /// <li>
125    /// <p><code>cidr</code> - The primary IPv4 CIDR block of the VPC. The CIDR block you specify must exactly match the VPC's CIDR block for information to be returned for the VPC. Must contain the slash followed by one or two digits (for example, <code>/28</code>).</p></li>
126    /// <li>
127    /// <p><code>cidr-block-association.cidr-block</code> - An IPv4 CIDR block associated with the VPC.</p></li>
128    /// <li>
129    /// <p><code>cidr-block-association.association-id</code> - The association ID for an IPv4 CIDR block associated with the VPC.</p></li>
130    /// <li>
131    /// <p><code>cidr-block-association.state</code> - The state of an IPv4 CIDR block associated with the VPC.</p></li>
132    /// <li>
133    /// <p><code>dhcp-options-id</code> - The ID of a set of DHCP options.</p></li>
134    /// <li>
135    /// <p><code>ipv6-cidr-block-association.ipv6-cidr-block</code> - An IPv6 CIDR block associated with the VPC.</p></li>
136    /// <li>
137    /// <p><code>ipv6-cidr-block-association.ipv6-pool</code> - The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated.</p></li>
138    /// <li>
139    /// <p><code>ipv6-cidr-block-association.association-id</code> - The association ID for an IPv6 CIDR block associated with the VPC.</p></li>
140    /// <li>
141    /// <p><code>ipv6-cidr-block-association.state</code> - The state of an IPv6 CIDR block associated with the VPC.</p></li>
142    /// <li>
143    /// <p><code>is-default</code> - Indicates whether the VPC is the default VPC.</p></li>
144    /// <li>
145    /// <p><code>owner-id</code> - The ID of the Amazon Web Services account that owns the VPC.</p></li>
146    /// <li>
147    /// <p><code>state</code> - The state of the VPC (<code>pending</code> | <code>available</code>).</p></li>
148    /// <li>
149    /// <p><code>tag</code> - 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 <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
150    /// <li>
151    /// <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>
152    /// <li>
153    /// <p><code>vpc-id</code> - The ID of the VPC.</p></li>
154    /// </ul>
155    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
156        self.inner = self.inner.set_filters(input);
157        self
158    }
159    /// <p>The filters.</p>
160    /// <ul>
161    /// <li>
162    /// <p><code>cidr</code> - The primary IPv4 CIDR block of the VPC. The CIDR block you specify must exactly match the VPC's CIDR block for information to be returned for the VPC. Must contain the slash followed by one or two digits (for example, <code>/28</code>).</p></li>
163    /// <li>
164    /// <p><code>cidr-block-association.cidr-block</code> - An IPv4 CIDR block associated with the VPC.</p></li>
165    /// <li>
166    /// <p><code>cidr-block-association.association-id</code> - The association ID for an IPv4 CIDR block associated with the VPC.</p></li>
167    /// <li>
168    /// <p><code>cidr-block-association.state</code> - The state of an IPv4 CIDR block associated with the VPC.</p></li>
169    /// <li>
170    /// <p><code>dhcp-options-id</code> - The ID of a set of DHCP options.</p></li>
171    /// <li>
172    /// <p><code>ipv6-cidr-block-association.ipv6-cidr-block</code> - An IPv6 CIDR block associated with the VPC.</p></li>
173    /// <li>
174    /// <p><code>ipv6-cidr-block-association.ipv6-pool</code> - The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated.</p></li>
175    /// <li>
176    /// <p><code>ipv6-cidr-block-association.association-id</code> - The association ID for an IPv6 CIDR block associated with the VPC.</p></li>
177    /// <li>
178    /// <p><code>ipv6-cidr-block-association.state</code> - The state of an IPv6 CIDR block associated with the VPC.</p></li>
179    /// <li>
180    /// <p><code>is-default</code> - Indicates whether the VPC is the default VPC.</p></li>
181    /// <li>
182    /// <p><code>owner-id</code> - The ID of the Amazon Web Services account that owns the VPC.</p></li>
183    /// <li>
184    /// <p><code>state</code> - The state of the VPC (<code>pending</code> | <code>available</code>).</p></li>
185    /// <li>
186    /// <p><code>tag</code> - 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 <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
187    /// <li>
188    /// <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>
189    /// <li>
190    /// <p><code>vpc-id</code> - The ID of the VPC.</p></li>
191    /// </ul>
192    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
193        self.inner.get_filters()
194    }
195    ///
196    /// Appends an item to `VpcIds`.
197    ///
198    /// To override the contents of this collection use [`set_vpc_ids`](Self::set_vpc_ids).
199    ///
200    /// <p>The IDs of the VPCs.</p>
201    pub fn vpc_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202        self.inner = self.inner.vpc_ids(input.into());
203        self
204    }
205    /// <p>The IDs of the VPCs.</p>
206    pub fn set_vpc_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
207        self.inner = self.inner.set_vpc_ids(input);
208        self
209    }
210    /// <p>The IDs of the VPCs.</p>
211    pub fn get_vpc_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
212        self.inner.get_vpc_ids()
213    }
214    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
215    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216        self.inner = self.inner.next_token(input.into());
217        self
218    }
219    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
220    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.inner = self.inner.set_next_token(input);
222        self
223    }
224    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
225    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
226        self.inner.get_next_token()
227    }
228    /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
229    pub fn max_results(mut self, input: i32) -> Self {
230        self.inner = self.inner.max_results(input);
231        self
232    }
233    /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
234    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
235        self.inner = self.inner.set_max_results(input);
236        self
237    }
238    /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
239    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
240        self.inner.get_max_results()
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}
257
258/// Successful return type for the `vpc_available` waiter.
259pub type VpcAvailableFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
260    crate::operation::describe_vpcs::DescribeVpcsOutput,
261    ::aws_smithy_runtime_api::client::result::SdkError<
262        crate::operation::describe_vpcs::DescribeVpcsError,
263        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
264    >,
265>;
266
267/// Error type for the `vpc_available` waiter.
268pub type WaitUntilVpcAvailableError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
269    crate::operation::describe_vpcs::DescribeVpcsOutput,
270    crate::operation::describe_vpcs::DescribeVpcsError,
271>;