aws_sdk_redshift/waiters/
cluster_restored.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `cluster_restored` 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 ClusterRestoredFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_clusters::builders::DescribeClustersInputBuilder,
18}
19impl ClusterRestoredFluentBuilder {
20    /// Creates a new `ClusterRestoredFluentBuilder`.
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 DescribeClusters as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_clusters::builders::DescribeClustersInputBuilder {
29        &self.inner
30    }
31    /// Wait for `cluster_restored`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::cluster_restored::ClusterRestoredFinalPoll,
37        crate::waiters::cluster_restored::WaitUntilClusterRestoredError,
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_clusters::DescribeClusters::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_clusters::DescribeClustersOutput,
59            &crate::operation::describe_clusters::DescribeClustersError,
60        >| {
61            // Matches: {"output":{"path":"Clusters[].RestoreStatus.Status","expected":"completed","comparator":"allStringEquals"}}
62            if crate::waiters::matchers::match_describe_clusters_99b2faa1a0233f771(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"output":{"path":"Clusters[].ClusterStatus","expected":"deleting","comparator":"anyStringEquals"}}
66            if crate::waiters::matchers::match_describe_clusters_36fb459f8f7fb96c3(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
68            }
69            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
70        };
71        let operation = move || {
72            let input = input.clone();
73            let runtime_plugins = runtime_plugins.clone();
74            async move { crate::operation::describe_clusters::DescribeClusters::orchestrate(&runtime_plugins, input).await }
75        };
76        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
77            .min_delay(::std::time::Duration::from_secs(60))
78            .max_delay(::std::time::Duration::from_secs(120))
79            .max_wait(max_wait)
80            .time_source(time_source)
81            .sleep_impl(sleep_impl)
82            .acceptor(acceptor)
83            .operation(operation)
84            .build();
85        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
86    }
87    /// <p>The unique identifier of a cluster whose properties you are requesting. This parameter is case sensitive.</p>
88    /// <p>The default is that all clusters defined for an account are returned.</p>
89    pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.inner = self.inner.cluster_identifier(input.into());
91        self
92    }
93    /// <p>The unique identifier of a cluster whose properties you are requesting. This parameter is case sensitive.</p>
94    /// <p>The default is that all clusters defined for an account are returned.</p>
95    pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.inner = self.inner.set_cluster_identifier(input);
97        self
98    }
99    /// <p>The unique identifier of a cluster whose properties you are requesting. This parameter is case sensitive.</p>
100    /// <p>The default is that all clusters defined for an account are returned.</p>
101    pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
102        self.inner.get_cluster_identifier()
103    }
104    /// <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>
105    /// <p>Default: <code>100</code></p>
106    /// <p>Constraints: minimum 20, maximum 100.</p>
107    pub fn max_records(mut self, input: i32) -> Self {
108        self.inner = self.inner.max_records(input);
109        self
110    }
111    /// <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>
112    /// <p>Default: <code>100</code></p>
113    /// <p>Constraints: minimum 20, maximum 100.</p>
114    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
115        self.inner = self.inner.set_max_records(input);
116        self
117    }
118    /// <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>
119    /// <p>Default: <code>100</code></p>
120    /// <p>Constraints: minimum 20, maximum 100.</p>
121    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
122        self.inner.get_max_records()
123    }
124    /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeClusters</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>
125    /// <p>Constraints: You can specify either the <b>ClusterIdentifier</b> parameter or the <b>Marker</b> parameter, but not both.</p>
126    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.marker(input.into());
128        self
129    }
130    /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeClusters</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>
131    /// <p>Constraints: You can specify either the <b>ClusterIdentifier</b> parameter or the <b>Marker</b> parameter, but not both.</p>
132    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_marker(input);
134        self
135    }
136    /// <p>An optional parameter that specifies the starting point to return a set of response records. When the results of a <code>DescribeClusters</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>
137    /// <p>Constraints: You can specify either the <b>ClusterIdentifier</b> parameter or the <b>Marker</b> parameter, but not both.</p>
138    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_marker()
140    }
141    ///
142    /// Appends an item to `TagKeys`.
143    ///
144    /// To override the contents of this collection use [`set_tag_keys`](Self::set_tag_keys).
145    ///
146    /// <p>A tag key or keys for which you want to return all matching clusters that are associated with the specified key or keys. For example, suppose that you have clusters 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 clusters that have either or both of these tag keys associated with them.</p>
147    pub fn tag_keys(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.tag_keys(input.into());
149        self
150    }
151    /// <p>A tag key or keys for which you want to return all matching clusters that are associated with the specified key or keys. For example, suppose that you have clusters 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 clusters that have either or both of these tag keys associated with them.</p>
152    pub fn set_tag_keys(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
153        self.inner = self.inner.set_tag_keys(input);
154        self
155    }
156    /// <p>A tag key or keys for which you want to return all matching clusters that are associated with the specified key or keys. For example, suppose that you have clusters 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 clusters that have either or both of these tag keys associated with them.</p>
157    pub fn get_tag_keys(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
158        self.inner.get_tag_keys()
159    }
160    ///
161    /// Appends an item to `TagValues`.
162    ///
163    /// To override the contents of this collection use [`set_tag_values`](Self::set_tag_values).
164    ///
165    /// <p>A tag value or values for which you want to return all matching clusters that are associated with the specified tag value or values. For example, suppose that you have clusters 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 clusters that have either or both of these tag values associated with them.</p>
166    pub fn tag_values(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.inner = self.inner.tag_values(input.into());
168        self
169    }
170    /// <p>A tag value or values for which you want to return all matching clusters that are associated with the specified tag value or values. For example, suppose that you have clusters 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 clusters that have either or both of these tag values associated with them.</p>
171    pub fn set_tag_values(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
172        self.inner = self.inner.set_tag_values(input);
173        self
174    }
175    /// <p>A tag value or values for which you want to return all matching clusters that are associated with the specified tag value or values. For example, suppose that you have clusters 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 clusters that have either or both of these tag values associated with them.</p>
176    pub fn get_tag_values(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
177        self.inner.get_tag_values()
178    }
179}
180
181/// Successful return type for the `cluster_restored` waiter.
182pub type ClusterRestoredFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
183    crate::operation::describe_clusters::DescribeClustersOutput,
184    ::aws_smithy_runtime_api::client::result::SdkError<
185        crate::operation::describe_clusters::DescribeClustersError,
186        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
187    >,
188>;
189
190/// Error type for the `cluster_restored` waiter.
191pub type WaitUntilClusterRestoredError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
192    crate::operation::describe_clusters::DescribeClustersOutput,
193    crate::operation::describe_clusters::DescribeClustersError,
194>;