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>create-time</code> - The time stamp when the volume was created.</p></li>
139 /// <li>
140 /// <p><code>encrypted</code> - Indicates whether the volume is encrypted (<code>true</code> | <code>false</code>)</p></li>
141 /// <li>
142 /// <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>
143 /// <li>
144 /// <p><code>multi-attach-enabled</code> - Indicates whether the volume is enabled for Multi-Attach (<code>true</code> | <code>false</code>)</p></li>
145 /// <li>
146 /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed volume.</p></li>
147 /// <li>
148 /// <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>
149 /// <li>
150 /// <p><code>size</code> - The size of the volume, in GiB.</p></li>
151 /// <li>
152 /// <p><code>snapshot-id</code> - The snapshot from which the volume was created.</p></li>
153 /// <li>
154 /// <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>
155 /// <li>
156 /// <p><code>tag</code>:<key>
157 /// - 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
158 /// <code>Owner</code> and the value
159 /// <code>TeamA</code>, specify
160 /// <code>tag:Owner</code> for the filter name and
161 /// <code>TeamA</code> for the filter value.
162 /// </key></p></li>
163 /// <li>
164 /// <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>
165 /// <li>
166 /// <p><code>volume-id</code> - The volume ID.</p></li>
167 /// <li>
168 /// <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>
169 /// </ul>
170 pub fn filters(mut self, input: crate::types::Filter) -> Self {
171 self.inner = self.inner.filters(input);
172 self
173 }
174 /// <p>The filters.</p>
175 /// <ul>
176 /// <li>
177 /// <p><code>attachment.attach-time</code> - The time stamp when the attachment initiated.</p></li>
178 /// <li>
179 /// <p><code>attachment.delete-on-termination</code> - Whether the volume is deleted on instance termination.</p></li>
180 /// <li>
181 /// <p><code>attachment.device</code> - The device name specified in the block device mapping (for example, <code>/dev/sda1</code>).</p></li>
182 /// <li>
183 /// <p><code>attachment.instance-id</code> - The ID of the instance the volume is attached to.</p></li>
184 /// <li>
185 /// <p><code>attachment.status</code> - The attachment state (<code>attaching</code> | <code>attached</code> | <code>detaching</code>).</p></li>
186 /// <li>
187 /// <p><code>availability-zone</code> - The Availability Zone in which the volume was created.</p></li>
188 /// <li>
189 /// <p><code>create-time</code> - The time stamp when the volume was created.</p></li>
190 /// <li>
191 /// <p><code>encrypted</code> - Indicates whether the volume is encrypted (<code>true</code> | <code>false</code>)</p></li>
192 /// <li>
193 /// <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>
194 /// <li>
195 /// <p><code>multi-attach-enabled</code> - Indicates whether the volume is enabled for Multi-Attach (<code>true</code> | <code>false</code>)</p></li>
196 /// <li>
197 /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed volume.</p></li>
198 /// <li>
199 /// <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>
200 /// <li>
201 /// <p><code>size</code> - The size of the volume, in GiB.</p></li>
202 /// <li>
203 /// <p><code>snapshot-id</code> - The snapshot from which the volume was created.</p></li>
204 /// <li>
205 /// <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>
206 /// <li>
207 /// <p><code>tag</code>:<key>
208 /// - 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
209 /// <code>Owner</code> and the value
210 /// <code>TeamA</code>, specify
211 /// <code>tag:Owner</code> for the filter name and
212 /// <code>TeamA</code> for the filter value.
213 /// </key></p></li>
214 /// <li>
215 /// <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>
216 /// <li>
217 /// <p><code>volume-id</code> - The volume ID.</p></li>
218 /// <li>
219 /// <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>
220 /// </ul>
221 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
222 self.inner = self.inner.set_filters(input);
223 self
224 }
225 /// <p>The filters.</p>
226 /// <ul>
227 /// <li>
228 /// <p><code>attachment.attach-time</code> - The time stamp when the attachment initiated.</p></li>
229 /// <li>
230 /// <p><code>attachment.delete-on-termination</code> - Whether the volume is deleted on instance termination.</p></li>
231 /// <li>
232 /// <p><code>attachment.device</code> - The device name specified in the block device mapping (for example, <code>/dev/sda1</code>).</p></li>
233 /// <li>
234 /// <p><code>attachment.instance-id</code> - The ID of the instance the volume is attached to.</p></li>
235 /// <li>
236 /// <p><code>attachment.status</code> - The attachment state (<code>attaching</code> | <code>attached</code> | <code>detaching</code>).</p></li>
237 /// <li>
238 /// <p><code>availability-zone</code> - The Availability Zone in which the volume was created.</p></li>
239 /// <li>
240 /// <p><code>create-time</code> - The time stamp when the volume was created.</p></li>
241 /// <li>
242 /// <p><code>encrypted</code> - Indicates whether the volume is encrypted (<code>true</code> | <code>false</code>)</p></li>
243 /// <li>
244 /// <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>
245 /// <li>
246 /// <p><code>multi-attach-enabled</code> - Indicates whether the volume is enabled for Multi-Attach (<code>true</code> | <code>false</code>)</p></li>
247 /// <li>
248 /// <p><code>operator.managed</code> - A Boolean that indicates whether this is a managed volume.</p></li>
249 /// <li>
250 /// <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>
251 /// <li>
252 /// <p><code>size</code> - The size of the volume, in GiB.</p></li>
253 /// <li>
254 /// <p><code>snapshot-id</code> - The snapshot from which the volume was created.</p></li>
255 /// <li>
256 /// <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>
257 /// <li>
258 /// <p><code>tag</code>:<key>
259 /// - 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
260 /// <code>Owner</code> and the value
261 /// <code>TeamA</code>, specify
262 /// <code>tag:Owner</code> for the filter name and
263 /// <code>TeamA</code> for the filter value.
264 /// </key></p></li>
265 /// <li>
266 /// <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>
267 /// <li>
268 /// <p><code>volume-id</code> - The volume ID.</p></li>
269 /// <li>
270 /// <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>
271 /// </ul>
272 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
273 self.inner.get_filters()
274 }
275 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
276 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
277 self.inner = self.inner.next_token(input.into());
278 self
279 }
280 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
281 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
282 self.inner = self.inner.set_next_token(input);
283 self
284 }
285 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
286 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
287 self.inner.get_next_token()
288 }
289 /// <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>
290 pub fn max_results(mut self, input: i32) -> Self {
291 self.inner = self.inner.max_results(input);
292 self
293 }
294 /// <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>
295 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
296 self.inner = self.inner.set_max_results(input);
297 self
298 }
299 /// <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>
300 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
301 self.inner.get_max_results()
302 }
303}
304
305/// Successful return type for the `volume_deleted` waiter.
306pub type VolumeDeletedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
307 crate::operation::describe_volumes::DescribeVolumesOutput,
308 ::aws_smithy_runtime_api::client::result::SdkError<
309 crate::operation::describe_volumes::DescribeVolumesError,
310 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
311 >,
312>;
313
314/// Error type for the `volume_deleted` waiter.
315pub type WaitUntilVolumeDeletedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
316 crate::operation::describe_volumes::DescribeVolumesOutput,
317 crate::operation::describe_volumes::DescribeVolumesError,
318>;