aws_sdk_ec2/waiters/
volume_deleted.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `volume_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 VolumeDeletedFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_volumes::builders::DescribeVolumesInputBuilder,
18}
19impl VolumeDeletedFluentBuilder {
20    /// Creates a new `VolumeDeletedFluentBuilder`.
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 DescribeVolumes as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_volumes::builders::DescribeVolumesInputBuilder {
29        &self.inner
30    }
31    /// Wait for `volume_deleted`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<crate::waiters::volume_deleted::VolumeDeletedFinalPoll, crate::waiters::volume_deleted::WaitUntilVolumeDeletedError>
36    {
37        let input = self
38            .inner
39            .build()
40            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
41        let runtime_plugins = crate::operation::describe_volumes::DescribeVolumes::operation_runtime_plugins(
42            self.handle.runtime_plugins.clone(),
43            &self.handle.conf,
44            ::std::option::Option::None,
45        )
46        .with_operation_plugin(crate::sdk_feature_tracker::waiter::WaiterFeatureTrackerRuntimePlugin::new());
47        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
48        let runtime_components_builder = runtime_plugins
49            .apply_client_configuration(&mut cfg)
50            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
51        let time_components = runtime_components_builder.into_time_components();
52        let sleep_impl = time_components.sleep_impl().expect("a sleep impl is required by waiters");
53        let time_source = time_components.time_source().expect("a time source is required by waiters");
54
55        let acceptor = move |result: ::std::result::Result<
56            &crate::operation::describe_volumes::DescribeVolumesOutput,
57            &crate::operation::describe_volumes::DescribeVolumesError,
58        >| {
59            // Matches: {"output":{"path":"Volumes[].State","expected":"deleted","comparator":"allStringEquals"}}
60            if crate::waiters::matchers::match_describe_volumes_b4b8f2ef2f1069b9d(result) {
61                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
62            }
63            // Matches: {"errorType":"InvalidVolume.NotFound"}
64            if crate::waiters::matchers::match_describe_volumes_be0fc7d72f426dbae(result) {
65                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
66            }
67            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
68        };
69        let operation = move || {
70            let input = input.clone();
71            let runtime_plugins = runtime_plugins.clone();
72            async move { crate::operation::describe_volumes::DescribeVolumes::orchestrate(&runtime_plugins, input).await }
73        };
74        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
75            .min_delay(::std::time::Duration::from_secs(15))
76            .max_delay(::std::time::Duration::from_secs(120))
77            .max_wait(max_wait)
78            .time_source(time_source)
79            .sleep_impl(sleep_impl)
80            .acceptor(acceptor)
81            .operation(operation)
82            .build();
83        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
84    }
85    ///
86    /// Appends an item to `VolumeIds`.
87    ///
88    /// To override the contents of this collection use [`set_volume_ids`](Self::set_volume_ids).
89    ///
90    /// <p>The volume IDs. If not specified, then all volumes are included in the response.</p>
91    pub fn volume_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.inner = self.inner.volume_ids(input.into());
93        self
94    }
95    /// <p>The volume IDs. If not specified, then all volumes are included in the response.</p>
96    pub fn set_volume_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
97        self.inner = self.inner.set_volume_ids(input);
98        self
99    }
100    /// <p>The volume IDs. If not specified, then all volumes are included in the response.</p>
101    pub fn get_volume_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
102        self.inner.get_volume_ids()
103    }
104    /// <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>
105    pub fn dry_run(mut self, input: bool) -> Self {
106        self.inner = self.inner.dry_run(input);
107        self
108    }
109    /// <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>
110    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
111        self.inner = self.inner.set_dry_run(input);
112        self
113    }
114    /// <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>
115    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
116        self.inner.get_dry_run()
117    }
118    ///
119    /// Appends an item to `Filters`.
120    ///
121    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
122    ///
123    /// <p>The filters.</p>
124    /// <ul>
125    /// <li>
126    /// <p><code>attachment.attach-time</code> - The time stamp when the attachment initiated.</p></li>
127    /// <li>
128    /// <p><code>attachment.delete-on-termination</code> - Whether the volume is deleted on instance termination.</p></li>
129    /// <li>
130    /// <p><code>attachment.device</code> - The device name specified in the block device mapping (for example, <code>/dev/sda1</code>).</p></li>
131    /// <li>
132    /// <p><code>attachment.instance-id</code> - The ID of the instance the volume is attached to.</p></li>
133    /// <li>
134    /// <p><code>attachment.status</code> - The attachment state (<code>attaching</code> | <code>attached</code> | <code>detaching</code>).</p></li>
135    /// <li>
136    /// <p><code>availability-zone</code> - The Availability Zone in which the volume was created.</p></li>
137    /// <li>
138    /// <p><code>availability-zone-id</code> - The ID of the Availability Zone in which the volume was created.</p></li>
139    /// <li>
140    /// <p><code>create-time</code> - The time stamp when the volume was created.</p></li>
141    /// <li>
142    /// <p><code>encrypted</code> - Indicates whether the volume is encrypted (<code>true</code> | <code>false</code>)</p></li>
143    /// <li>
144    /// <p><code>fast-restored</code> - Indicates whether the volume was created from a snapshot that is enabled for fast snapshot restore (<code>true</code> | <code>false</code>).</p></li>
145    /// <li>
146    /// <p><code>multi-attach-enabled</code> - Indicates whether the volume is enabled for Multi-Attach (<code>true</code> | <code>false</code>)</p></li>
147    /// <li>
148    /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed volume.</p></li>
149    /// <li>
150    /// <p><code>operator.principal</code> - The principal that manages the volume. Only valid for managed volumes, where <code>managed</code> is <code>true</code>.</p></li>
151    /// <li>
152    /// <p><code>size</code> - The size of the volume, in GiB.</p></li>
153    /// <li>
154    /// <p><code>snapshot-id</code> - The snapshot from which the volume was created.</p></li>
155    /// <li>
156    /// <p><code>status</code> - The state of the volume (<code>creating</code> | <code>available</code> | <code>in-use</code> | <code>deleting</code> | <code>deleted</code> | <code>error</code>).</p></li>
157    /// <li>
158    /// <p><code>tag</code>:<key>
159    /// - 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
160    /// <code>Owner</code> and the value
161    /// <code>TeamA</code>, specify
162    /// <code>tag:Owner</code> for the filter name and
163    /// <code>TeamA</code> for the filter value.
164    /// </key></p></li>
165    /// <li>
166    /// <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>
167    /// <li>
168    /// <p><code>volume-id</code> - The volume ID.</p></li>
169    /// <li>
170    /// <p><code>volume-type</code> - The Amazon EBS volume type (<code>gp2</code> | <code>gp3</code> | <code>io1</code> | <code>io2</code> | <code>st1</code> | <code>sc1</code>| <code>standard</code>)</p></li>
171    /// </ul>
172    pub fn filters(mut self, input: crate::types::Filter) -> Self {
173        self.inner = self.inner.filters(input);
174        self
175    }
176    /// <p>The filters.</p>
177    /// <ul>
178    /// <li>
179    /// <p><code>attachment.attach-time</code> - The time stamp when the attachment initiated.</p></li>
180    /// <li>
181    /// <p><code>attachment.delete-on-termination</code> - Whether the volume is deleted on instance termination.</p></li>
182    /// <li>
183    /// <p><code>attachment.device</code> - The device name specified in the block device mapping (for example, <code>/dev/sda1</code>).</p></li>
184    /// <li>
185    /// <p><code>attachment.instance-id</code> - The ID of the instance the volume is attached to.</p></li>
186    /// <li>
187    /// <p><code>attachment.status</code> - The attachment state (<code>attaching</code> | <code>attached</code> | <code>detaching</code>).</p></li>
188    /// <li>
189    /// <p><code>availability-zone</code> - The Availability Zone in which the volume was created.</p></li>
190    /// <li>
191    /// <p><code>availability-zone-id</code> - The ID of the Availability Zone in which the volume was created.</p></li>
192    /// <li>
193    /// <p><code>create-time</code> - The time stamp when the volume was created.</p></li>
194    /// <li>
195    /// <p><code>encrypted</code> - Indicates whether the volume is encrypted (<code>true</code> | <code>false</code>)</p></li>
196    /// <li>
197    /// <p><code>fast-restored</code> - Indicates whether the volume was created from a snapshot that is enabled for fast snapshot restore (<code>true</code> | <code>false</code>).</p></li>
198    /// <li>
199    /// <p><code>multi-attach-enabled</code> - Indicates whether the volume is enabled for Multi-Attach (<code>true</code> | <code>false</code>)</p></li>
200    /// <li>
201    /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed volume.</p></li>
202    /// <li>
203    /// <p><code>operator.principal</code> - The principal that manages the volume. Only valid for managed volumes, where <code>managed</code> is <code>true</code>.</p></li>
204    /// <li>
205    /// <p><code>size</code> - The size of the volume, in GiB.</p></li>
206    /// <li>
207    /// <p><code>snapshot-id</code> - The snapshot from which the volume was created.</p></li>
208    /// <li>
209    /// <p><code>status</code> - The state of the volume (<code>creating</code> | <code>available</code> | <code>in-use</code> | <code>deleting</code> | <code>deleted</code> | <code>error</code>).</p></li>
210    /// <li>
211    /// <p><code>tag</code>:<key>
212    /// - 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
213    /// <code>Owner</code> and the value
214    /// <code>TeamA</code>, specify
215    /// <code>tag:Owner</code> for the filter name and
216    /// <code>TeamA</code> for the filter value.
217    /// </key></p></li>
218    /// <li>
219    /// <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>
220    /// <li>
221    /// <p><code>volume-id</code> - The volume ID.</p></li>
222    /// <li>
223    /// <p><code>volume-type</code> - The Amazon EBS volume type (<code>gp2</code> | <code>gp3</code> | <code>io1</code> | <code>io2</code> | <code>st1</code> | <code>sc1</code>| <code>standard</code>)</p></li>
224    /// </ul>
225    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
226        self.inner = self.inner.set_filters(input);
227        self
228    }
229    /// <p>The filters.</p>
230    /// <ul>
231    /// <li>
232    /// <p><code>attachment.attach-time</code> - The time stamp when the attachment initiated.</p></li>
233    /// <li>
234    /// <p><code>attachment.delete-on-termination</code> - Whether the volume is deleted on instance termination.</p></li>
235    /// <li>
236    /// <p><code>attachment.device</code> - The device name specified in the block device mapping (for example, <code>/dev/sda1</code>).</p></li>
237    /// <li>
238    /// <p><code>attachment.instance-id</code> - The ID of the instance the volume is attached to.</p></li>
239    /// <li>
240    /// <p><code>attachment.status</code> - The attachment state (<code>attaching</code> | <code>attached</code> | <code>detaching</code>).</p></li>
241    /// <li>
242    /// <p><code>availability-zone</code> - The Availability Zone in which the volume was created.</p></li>
243    /// <li>
244    /// <p><code>availability-zone-id</code> - The ID of the Availability Zone in which the volume was created.</p></li>
245    /// <li>
246    /// <p><code>create-time</code> - The time stamp when the volume was created.</p></li>
247    /// <li>
248    /// <p><code>encrypted</code> - Indicates whether the volume is encrypted (<code>true</code> | <code>false</code>)</p></li>
249    /// <li>
250    /// <p><code>fast-restored</code> - Indicates whether the volume was created from a snapshot that is enabled for fast snapshot restore (<code>true</code> | <code>false</code>).</p></li>
251    /// <li>
252    /// <p><code>multi-attach-enabled</code> - Indicates whether the volume is enabled for Multi-Attach (<code>true</code> | <code>false</code>)</p></li>
253    /// <li>
254    /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed volume.</p></li>
255    /// <li>
256    /// <p><code>operator.principal</code> - The principal that manages the volume. Only valid for managed volumes, where <code>managed</code> is <code>true</code>.</p></li>
257    /// <li>
258    /// <p><code>size</code> - The size of the volume, in GiB.</p></li>
259    /// <li>
260    /// <p><code>snapshot-id</code> - The snapshot from which the volume was created.</p></li>
261    /// <li>
262    /// <p><code>status</code> - The state of the volume (<code>creating</code> | <code>available</code> | <code>in-use</code> | <code>deleting</code> | <code>deleted</code> | <code>error</code>).</p></li>
263    /// <li>
264    /// <p><code>tag</code>:<key>
265    /// - 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
266    /// <code>Owner</code> and the value
267    /// <code>TeamA</code>, specify
268    /// <code>tag:Owner</code> for the filter name and
269    /// <code>TeamA</code> for the filter value.
270    /// </key></p></li>
271    /// <li>
272    /// <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>
273    /// <li>
274    /// <p><code>volume-id</code> - The volume ID.</p></li>
275    /// <li>
276    /// <p><code>volume-type</code> - The Amazon EBS volume type (<code>gp2</code> | <code>gp3</code> | <code>io1</code> | <code>io2</code> | <code>st1</code> | <code>sc1</code>| <code>standard</code>)</p></li>
277    /// </ul>
278    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
279        self.inner.get_filters()
280    }
281    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
282    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
283        self.inner = self.inner.next_token(input.into());
284        self
285    }
286    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
287    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
288        self.inner = self.inner.set_next_token(input);
289        self
290    }
291    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
292    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
293        self.inner.get_next_token()
294    }
295    /// <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>
296    pub fn max_results(mut self, input: i32) -> Self {
297        self.inner = self.inner.max_results(input);
298        self
299    }
300    /// <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>
301    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
302        self.inner = self.inner.set_max_results(input);
303        self
304    }
305    /// <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>
306    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
307        self.inner.get_max_results()
308    }
309}
310
311/// Successful return type for the `volume_deleted` waiter.
312pub type VolumeDeletedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
313    crate::operation::describe_volumes::DescribeVolumesOutput,
314    ::aws_smithy_runtime_api::client::result::SdkError<
315        crate::operation::describe_volumes::DescribeVolumesError,
316        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
317    >,
318>;
319
320/// Error type for the `volume_deleted` waiter.
321pub type WaitUntilVolumeDeletedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
322    crate::operation::describe_volumes::DescribeVolumesOutput,
323    crate::operation::describe_volumes::DescribeVolumesError,
324>;