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