aws_sdk_redshift/waiters/
snapshot_available.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `snapshot_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 SnapshotAvailableFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_cluster_snapshots::builders::DescribeClusterSnapshotsInputBuilder,
18}
19impl SnapshotAvailableFluentBuilder {
20    /// Creates a new `SnapshotAvailableFluentBuilder`.
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 DescribeClusterSnapshots as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_cluster_snapshots::builders::DescribeClusterSnapshotsInputBuilder {
29        &self.inner
30    }
31    /// Wait for `snapshot_available`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::snapshot_available::SnapshotAvailableFinalPoll,
37        crate::waiters::snapshot_available::WaitUntilSnapshotAvailableError,
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_cluster_snapshots::DescribeClusterSnapshots::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_cluster_snapshots::DescribeClusterSnapshotsOutput,
59            &crate::operation::describe_cluster_snapshots::DescribeClusterSnapshotsError,
60        >| {
61            // Matches: {"output":{"path":"Snapshots[].Status","expected":"available","comparator":"allStringEquals"}}
62            if crate::waiters::matchers::match_describe_cluster_snapshots_9940112fa5e89d7d9(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"output":{"path":"Snapshots[].Status","expected":"failed","comparator":"anyStringEquals"}}
66            if crate::waiters::matchers::match_describe_cluster_snapshots_c752b4060229720c6(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
68            }
69            // Matches: {"output":{"path":"Snapshots[].Status","expected":"deleted","comparator":"anyStringEquals"}}
70            if crate::waiters::matchers::match_describe_cluster_snapshots_305bbaff8086662e2(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_cluster_snapshots::DescribeClusterSnapshots::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    /// <p>The identifier of the cluster which generated the requested snapshots.</p>
92    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93        self.inner = self.inner.cluster_identifier(input.into());
94        self
95    }
96    /// <p>The identifier of the cluster which generated the requested snapshots.</p>
97    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98        self.inner = self.inner.set_cluster_identifier(input);
99        self
100    }
101    /// <p>The identifier of the cluster which generated the requested snapshots.</p>
102    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
103        self.inner.get_cluster_identifier()
104    }
105    /// <p>The snapshot identifier of the snapshot about which to return information.</p>
106    pub fn snapshot_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107        self.inner = self.inner.snapshot_identifier(input.into());
108        self
109    }
110    /// <p>The snapshot identifier of the snapshot about which to return information.</p>
111    pub fn set_snapshot_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112        self.inner = self.inner.set_snapshot_identifier(input);
113        self
114    }
115    /// <p>The snapshot identifier of the snapshot about which to return information.</p>
116    pub fn get_snapshot_identifier(&self) -> &::std::option::Option<::std::string::String> {
117        self.inner.get_snapshot_identifier()
118    }
119    /// <p>The Amazon Resource Name (ARN) of the snapshot associated with the message to describe cluster snapshots.</p>
120    pub fn snapshot_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.snapshot_arn(input.into());
122        self
123    }
124    /// <p>The Amazon Resource Name (ARN) of the snapshot associated with the message to describe cluster snapshots.</p>
125    pub fn set_snapshot_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_snapshot_arn(input);
127        self
128    }
129    /// <p>The Amazon Resource Name (ARN) of the snapshot associated with the message to describe cluster snapshots.</p>
130    pub fn get_snapshot_arn(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_snapshot_arn()
132    }
133    /// <p>The type of snapshots for which you are requesting information. By default, snapshots of all types are returned.</p>
134    /// <p>Valid Values: <code>automated</code> | <code>manual</code></p>
135    pub fn snapshot_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.snapshot_type(input.into());
137        self
138    }
139    /// <p>The type of snapshots for which you are requesting information. By default, snapshots of all types are returned.</p>
140    /// <p>Valid Values: <code>automated</code> | <code>manual</code></p>
141    pub fn set_snapshot_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_snapshot_type(input);
143        self
144    }
145    /// <p>The type of snapshots for which you are requesting information. By default, snapshots of all types are returned.</p>
146    /// <p>Valid Values: <code>automated</code> | <code>manual</code></p>
147    pub fn get_snapshot_type(&self) -> &::std::option::Option<::std::string::String> {
148        self.inner.get_snapshot_type()
149    }
150    /// <p>A value that requests only snapshots created at or after the specified time. The time value is specified in ISO 8601 format. For more information about ISO 8601, go to the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO8601 Wikipedia page.</a></p>
151    /// <p>Example: <code>2012-07-16T18:00:00Z</code></p>
152    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
153        self.inner = self.inner.start_time(input);
154        self
155    }
156    /// <p>A value that requests only snapshots created at or after the specified time. The time value is specified in ISO 8601 format. For more information about ISO 8601, go to the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO8601 Wikipedia page.</a></p>
157    /// <p>Example: <code>2012-07-16T18:00:00Z</code></p>
158    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
159        self.inner = self.inner.set_start_time(input);
160        self
161    }
162    /// <p>A value that requests only snapshots created at or after the specified time. The time value is specified in ISO 8601 format. For more information about ISO 8601, go to the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO8601 Wikipedia page.</a></p>
163    /// <p>Example: <code>2012-07-16T18:00:00Z</code></p>
164    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
165        self.inner.get_start_time()
166    }
167    /// <p>A time value that requests only snapshots created at or before the specified time. The time value is specified in ISO 8601 format. For more information about ISO 8601, go to the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO8601 Wikipedia page.</a></p>
168    /// <p>Example: <code>2012-07-16T18:00:00Z</code></p>
169    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
170        self.inner = self.inner.end_time(input);
171        self
172    }
173    /// <p>A time value that requests only snapshots created at or before the specified time. The time value is specified in ISO 8601 format. For more information about ISO 8601, go to the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO8601 Wikipedia page.</a></p>
174    /// <p>Example: <code>2012-07-16T18:00:00Z</code></p>
175    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
176        self.inner = self.inner.set_end_time(input);
177        self
178    }
179    /// <p>A time value that requests only snapshots created at or before the specified time. The time value is specified in ISO 8601 format. For more information about ISO 8601, go to the <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO8601 Wikipedia page.</a></p>
180    /// <p>Example: <code>2012-07-16T18:00:00Z</code></p>
181    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
182        self.inner.get_end_time()
183    }
184    /// <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.</p>
185    /// <p>Default: <code>100</code></p>
186    /// <p>Constraints: minimum 20, maximum 100.</p>
187    pub fn max_records(mut self, input: i32) -> Self {
188        self.inner = self.inner.max_records(input);
189        self
190    }
191    /// <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.</p>
192    /// <p>Default: <code>100</code></p>
193    /// <p>Constraints: minimum 20, maximum 100.</p>
194    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
195        self.inner = self.inner.set_max_records(input);
196        self
197    }
198    /// <p>The maximum number of response records to return in each call. If the number of remaining response records exceeds the specified <code>MaxRecords</code> value, a value is returned in a <code>marker</code> field of the response. You can retrieve the next set of records by retrying the command with the returned marker value.</p>
199    /// <p>Default: <code>100</code></p>
200    /// <p>Constraints: minimum 20, maximum 100.</p>
201    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
202        self.inner.get_max_records()
203    }
204    /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeClusterSnapshots</code> request exceed the value specified in <code>MaxRecords</code>, Amazon Web Services returns a value in the <code>Marker</code> field of the response. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request.</p>
205    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206        self.inner = self.inner.marker(input.into());
207        self
208    }
209    /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeClusterSnapshots</code> request exceed the value specified in <code>MaxRecords</code>, Amazon Web Services returns a value in the <code>Marker</code> field of the response. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request.</p>
210    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
211        self.inner = self.inner.set_marker(input);
212        self
213    }
214    /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeClusterSnapshots</code> request exceed the value specified in <code>MaxRecords</code>, Amazon Web Services returns a value in the <code>Marker</code> field of the response. You can retrieve the next set of response records by providing the returned marker value in the <code>Marker</code> parameter and retrying the request.</p>
215    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
216        self.inner.get_marker()
217    }
218    /// <p>The Amazon Web Services account used to create or copy the snapshot. Use this field to filter the results to snapshots owned by a particular account. To describe snapshots you own, either specify your Amazon Web Services account, or do not specify the parameter.</p>
219    pub fn owner_account(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220        self.inner = self.inner.owner_account(input.into());
221        self
222    }
223    /// <p>The Amazon Web Services account used to create or copy the snapshot. Use this field to filter the results to snapshots owned by a particular account. To describe snapshots you own, either specify your Amazon Web Services account, or do not specify the parameter.</p>
224    pub fn set_owner_account(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
225        self.inner = self.inner.set_owner_account(input);
226        self
227    }
228    /// <p>The Amazon Web Services account used to create or copy the snapshot. Use this field to filter the results to snapshots owned by a particular account. To describe snapshots you own, either specify your Amazon Web Services account, or do not specify the parameter.</p>
229    pub fn get_owner_account(&self) -> &::std::option::Option<::std::string::String> {
230        self.inner.get_owner_account()
231    }
232    ///
233    /// Appends an item to `TagKeys`.
234    ///
235    /// To override the contents of this collection use [`set_tag_keys`](Self::set_tag_keys).
236    ///
237    /// <p>A tag key or keys for which you want to return all matching cluster snapshots that are associated with the specified key or keys. For example, suppose that you have snapshots that are tagged with keys called <code>owner</code> and <code>environment</code>. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the snapshots that have either or both of these tag keys associated with them.</p>
238    pub fn tag_keys(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
239        self.inner = self.inner.tag_keys(input.into());
240        self
241    }
242    /// <p>A tag key or keys for which you want to return all matching cluster snapshots that are associated with the specified key or keys. For example, suppose that you have snapshots that are tagged with keys called <code>owner</code> and <code>environment</code>. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the snapshots that have either or both of these tag keys associated with them.</p>
243    pub fn set_tag_keys(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
244        self.inner = self.inner.set_tag_keys(input);
245        self
246    }
247    /// <p>A tag key or keys for which you want to return all matching cluster snapshots that are associated with the specified key or keys. For example, suppose that you have snapshots that are tagged with keys called <code>owner</code> and <code>environment</code>. If you specify both of these tag keys in the request, Amazon Redshift returns a response with the snapshots that have either or both of these tag keys associated with them.</p>
248    pub fn get_tag_keys(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
249        self.inner.get_tag_keys()
250    }
251    ///
252    /// Appends an item to `TagValues`.
253    ///
254    /// To override the contents of this collection use [`set_tag_values`](Self::set_tag_values).
255    ///
256    /// <p>A tag value or values for which you want to return all matching cluster snapshots that are associated with the specified tag value or values. For example, suppose that you have snapshots that are tagged with values called <code>admin</code> and <code>test</code>. If you specify both of these tag values in the request, Amazon Redshift returns a response with the snapshots that have either or both of these tag values associated with them.</p>
257    pub fn tag_values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
258        self.inner = self.inner.tag_values(input.into());
259        self
260    }
261    /// <p>A tag value or values for which you want to return all matching cluster snapshots that are associated with the specified tag value or values. For example, suppose that you have snapshots that are tagged with values called <code>admin</code> and <code>test</code>. If you specify both of these tag values in the request, Amazon Redshift returns a response with the snapshots that have either or both of these tag values associated with them.</p>
262    pub fn set_tag_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
263        self.inner = self.inner.set_tag_values(input);
264        self
265    }
266    /// <p>A tag value or values for which you want to return all matching cluster snapshots that are associated with the specified tag value or values. For example, suppose that you have snapshots that are tagged with values called <code>admin</code> and <code>test</code>. If you specify both of these tag values in the request, Amazon Redshift returns a response with the snapshots that have either or both of these tag values associated with them.</p>
267    pub fn get_tag_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
268        self.inner.get_tag_values()
269    }
270    /// <p>A value that indicates whether to return snapshots only for an existing cluster. You can perform table-level restore only by using a snapshot of an existing cluster, that is, a cluster that has not been deleted. Values for this parameter work as follows:</p>
271    /// <ul>
272    /// <li>
273    /// <p>If <code>ClusterExists</code> is set to <code>true</code>, <code>ClusterIdentifier</code> is required.</p></li>
274    /// <li>
275    /// <p>If <code>ClusterExists</code> is set to <code>false</code> and <code>ClusterIdentifier</code> isn't specified, all snapshots associated with deleted clusters (orphaned snapshots) are returned.</p></li>
276    /// <li>
277    /// <p>If <code>ClusterExists</code> is set to <code>false</code> and <code>ClusterIdentifier</code> is specified for a deleted cluster, snapshots associated with that cluster are returned.</p></li>
278    /// <li>
279    /// <p>If <code>ClusterExists</code> is set to <code>false</code> and <code>ClusterIdentifier</code> is specified for an existing cluster, no snapshots are returned.</p></li>
280    /// </ul>
281    pub fn cluster_exists(mut self, input: bool) -> Self {
282        self.inner = self.inner.cluster_exists(input);
283        self
284    }
285    /// <p>A value that indicates whether to return snapshots only for an existing cluster. You can perform table-level restore only by using a snapshot of an existing cluster, that is, a cluster that has not been deleted. Values for this parameter work as follows:</p>
286    /// <ul>
287    /// <li>
288    /// <p>If <code>ClusterExists</code> is set to <code>true</code>, <code>ClusterIdentifier</code> is required.</p></li>
289    /// <li>
290    /// <p>If <code>ClusterExists</code> is set to <code>false</code> and <code>ClusterIdentifier</code> isn't specified, all snapshots associated with deleted clusters (orphaned snapshots) are returned.</p></li>
291    /// <li>
292    /// <p>If <code>ClusterExists</code> is set to <code>false</code> and <code>ClusterIdentifier</code> is specified for a deleted cluster, snapshots associated with that cluster are returned.</p></li>
293    /// <li>
294    /// <p>If <code>ClusterExists</code> is set to <code>false</code> and <code>ClusterIdentifier</code> is specified for an existing cluster, no snapshots are returned.</p></li>
295    /// </ul>
296    pub fn set_cluster_exists(mut self, input: ::std::option::Option<bool>) -> Self {
297        self.inner = self.inner.set_cluster_exists(input);
298        self
299    }
300    /// <p>A value that indicates whether to return snapshots only for an existing cluster. You can perform table-level restore only by using a snapshot of an existing cluster, that is, a cluster that has not been deleted. Values for this parameter work as follows:</p>
301    /// <ul>
302    /// <li>
303    /// <p>If <code>ClusterExists</code> is set to <code>true</code>, <code>ClusterIdentifier</code> is required.</p></li>
304    /// <li>
305    /// <p>If <code>ClusterExists</code> is set to <code>false</code> and <code>ClusterIdentifier</code> isn't specified, all snapshots associated with deleted clusters (orphaned snapshots) are returned.</p></li>
306    /// <li>
307    /// <p>If <code>ClusterExists</code> is set to <code>false</code> and <code>ClusterIdentifier</code> is specified for a deleted cluster, snapshots associated with that cluster are returned.</p></li>
308    /// <li>
309    /// <p>If <code>ClusterExists</code> is set to <code>false</code> and <code>ClusterIdentifier</code> is specified for an existing cluster, no snapshots are returned.</p></li>
310    /// </ul>
311    pub fn get_cluster_exists(&self) -> &::std::option::Option<bool> {
312        self.inner.get_cluster_exists()
313    }
314    ///
315    /// Appends an item to `SortingEntities`.
316    ///
317    /// To override the contents of this collection use [`set_sorting_entities`](Self::set_sorting_entities).
318    ///
319    /// <p></p>
320    pub fn sorting_entities(mut self, input: crate::types::SnapshotSortingEntity) -> Self {
321        self.inner = self.inner.sorting_entities(input);
322        self
323    }
324    /// <p></p>
325    pub fn set_sorting_entities(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SnapshotSortingEntity>>) -> Self {
326        self.inner = self.inner.set_sorting_entities(input);
327        self
328    }
329    /// <p></p>
330    pub fn get_sorting_entities(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SnapshotSortingEntity>> {
331        self.inner.get_sorting_entities()
332    }
333}
334
335/// Successful return type for the `snapshot_available` waiter.
336pub type SnapshotAvailableFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
337    crate::operation::describe_cluster_snapshots::DescribeClusterSnapshotsOutput,
338    ::aws_smithy_runtime_api::client::result::SdkError<
339        crate::operation::describe_cluster_snapshots::DescribeClusterSnapshotsError,
340        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
341    >,
342>;
343
344/// Error type for the `snapshot_available` waiter.
345pub type WaitUntilSnapshotAvailableError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
346    crate::operation::describe_cluster_snapshots::DescribeClusterSnapshotsOutput,
347    crate::operation::describe_cluster_snapshots::DescribeClusterSnapshotsError,
348>;