aws_sdk_rds/waiters/
db_cluster_available.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `db_cluster_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 DbClusterAvailableFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_db_clusters::builders::DescribeDbClustersInputBuilder,
18}
19impl DbClusterAvailableFluentBuilder {
20    /// Creates a new `DbClusterAvailableFluentBuilder`.
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 DescribeDBClusters as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_db_clusters::builders::DescribeDbClustersInputBuilder {
29        &self.inner
30    }
31    /// Wait for `db_cluster_available`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::db_cluster_available::DbClusterAvailableFinalPoll,
37        crate::waiters::db_cluster_available::WaitUntilDbClusterAvailableError,
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_db_clusters::DescribeDBClusters::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_db_clusters::DescribeDbClustersOutput,
59            &crate::operation::describe_db_clusters::DescribeDBClustersError,
60        >| {
61            // Matches: {"output":{"path":"DBClusters[].Status","expected":"available","comparator":"allStringEquals"}}
62            if crate::waiters::matchers::match_describe_db_clusters_72c58ef0321a1929c(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"output":{"path":"DBClusters[].Status","expected":"deleted","comparator":"anyStringEquals"}}
66            if crate::waiters::matchers::match_describe_db_clusters_fab1869fde25c3e91(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
68            }
69            // Matches: {"output":{"path":"DBClusters[].Status","expected":"deleting","comparator":"anyStringEquals"}}
70            if crate::waiters::matchers::match_describe_db_clusters_63551110c8319cd53(result) {
71                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
72            }
73            // Matches: {"output":{"path":"DBClusters[].Status","expected":"failed","comparator":"anyStringEquals"}}
74            if crate::waiters::matchers::match_describe_db_clusters_95c1b2832e5ad6ab3(result) {
75                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
76            }
77            // Matches: {"output":{"path":"DBClusters[].Status","expected":"incompatible-restore","comparator":"anyStringEquals"}}
78            if crate::waiters::matchers::match_describe_db_clusters_ec6b4b3c95fa34758(result) {
79                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
80            }
81            // Matches: {"output":{"path":"DBClusters[].Status","expected":"incompatible-parameters","comparator":"anyStringEquals"}}
82            if crate::waiters::matchers::match_describe_db_clusters_facc13e16e2b3303d(result) {
83                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
84            }
85            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
86        };
87        let operation = move || {
88            let input = input.clone();
89            let runtime_plugins = runtime_plugins.clone();
90            async move { crate::operation::describe_db_clusters::DescribeDBClusters::orchestrate(&runtime_plugins, input).await }
91        };
92        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
93            .min_delay(::std::time::Duration::from_secs(30))
94            .max_delay(::std::time::Duration::from_secs(120))
95            .max_wait(max_wait)
96            .time_source(time_source)
97            .sleep_impl(sleep_impl)
98            .acceptor(acceptor)
99            .operation(operation)
100            .build();
101        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
102    }
103    /// <p>The user-supplied DB cluster identifier or the Amazon Resource Name (ARN) of the DB cluster. If this parameter is specified, information for only the specific DB cluster is returned. This parameter isn't case-sensitive.</p>
104    /// <p>Constraints:</p>
105    /// <ul>
106    /// <li>
107    /// <p>If supplied, must match an existing DB cluster identifier.</p></li>
108    /// </ul>
109    pub fn db_cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.inner = self.inner.db_cluster_identifier(input.into());
111        self
112    }
113    /// <p>The user-supplied DB cluster identifier or the Amazon Resource Name (ARN) of the DB cluster. If this parameter is specified, information for only the specific DB cluster is returned. This parameter isn't case-sensitive.</p>
114    /// <p>Constraints:</p>
115    /// <ul>
116    /// <li>
117    /// <p>If supplied, must match an existing DB cluster identifier.</p></li>
118    /// </ul>
119    pub fn set_db_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_db_cluster_identifier(input);
121        self
122    }
123    /// <p>The user-supplied DB cluster identifier or the Amazon Resource Name (ARN) of the DB cluster. If this parameter is specified, information for only the specific DB cluster is returned. This parameter isn't case-sensitive.</p>
124    /// <p>Constraints:</p>
125    /// <ul>
126    /// <li>
127    /// <p>If supplied, must match an existing DB cluster identifier.</p></li>
128    /// </ul>
129    pub fn get_db_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_db_cluster_identifier()
131    }
132    ///
133    /// Appends an item to `Filters`.
134    ///
135    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
136    ///
137    /// <p>A filter that specifies one or more DB clusters to describe.</p>
138    /// <p>Supported Filters:</p>
139    /// <ul>
140    /// <li>
141    /// <p><code>clone-group-id</code> - Accepts clone group identifiers. The results list only includes information about the DB clusters associated with these clone groups.</p></li>
142    /// <li>
143    /// <p><code>db-cluster-id</code> - Accepts DB cluster identifiers and DB cluster Amazon Resource Names (ARNs). The results list only includes information about the DB clusters identified by these ARNs.</p></li>
144    /// <li>
145    /// <p><code>db-cluster-resource-id</code> - Accepts DB cluster resource identifiers. The results list will only include information about the DB clusters identified by these DB cluster resource identifiers.</p></li>
146    /// <li>
147    /// <p><code>domain</code> - Accepts Active Directory directory IDs. The results list only includes information about the DB clusters associated with these domains.</p></li>
148    /// <li>
149    /// <p><code>engine</code> - Accepts engine names. The results list only includes information about the DB clusters for these engines.</p></li>
150    /// </ul>
151    pub fn filters(mut self, input: crate::types::Filter) -> Self {
152        self.inner = self.inner.filters(input);
153        self
154    }
155    /// <p>A filter that specifies one or more DB clusters to describe.</p>
156    /// <p>Supported Filters:</p>
157    /// <ul>
158    /// <li>
159    /// <p><code>clone-group-id</code> - Accepts clone group identifiers. The results list only includes information about the DB clusters associated with these clone groups.</p></li>
160    /// <li>
161    /// <p><code>db-cluster-id</code> - Accepts DB cluster identifiers and DB cluster Amazon Resource Names (ARNs). The results list only includes information about the DB clusters identified by these ARNs.</p></li>
162    /// <li>
163    /// <p><code>db-cluster-resource-id</code> - Accepts DB cluster resource identifiers. The results list will only include information about the DB clusters identified by these DB cluster resource identifiers.</p></li>
164    /// <li>
165    /// <p><code>domain</code> - Accepts Active Directory directory IDs. The results list only includes information about the DB clusters associated with these domains.</p></li>
166    /// <li>
167    /// <p><code>engine</code> - Accepts engine names. The results list only includes information about the DB clusters for these engines.</p></li>
168    /// </ul>
169    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
170        self.inner = self.inner.set_filters(input);
171        self
172    }
173    /// <p>A filter that specifies one or more DB clusters to describe.</p>
174    /// <p>Supported Filters:</p>
175    /// <ul>
176    /// <li>
177    /// <p><code>clone-group-id</code> - Accepts clone group identifiers. The results list only includes information about the DB clusters associated with these clone groups.</p></li>
178    /// <li>
179    /// <p><code>db-cluster-id</code> - Accepts DB cluster identifiers and DB cluster Amazon Resource Names (ARNs). The results list only includes information about the DB clusters identified by these ARNs.</p></li>
180    /// <li>
181    /// <p><code>db-cluster-resource-id</code> - Accepts DB cluster resource identifiers. The results list will only include information about the DB clusters identified by these DB cluster resource identifiers.</p></li>
182    /// <li>
183    /// <p><code>domain</code> - Accepts Active Directory directory IDs. The results list only includes information about the DB clusters associated with these domains.</p></li>
184    /// <li>
185    /// <p><code>engine</code> - Accepts engine names. The results list only includes information about the DB clusters for these engines.</p></li>
186    /// </ul>
187    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
188        self.inner.get_filters()
189    }
190    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a pagination token called a marker is included in the response so you can retrieve the remaining results.</p>
191    /// <p>Default: 100</p>
192    /// <p>Constraints: Minimum 20, maximum 100</p>
193    pub fn max_records(mut self, input: i32) -> Self {
194        self.inner = self.inner.max_records(input);
195        self
196    }
197    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a pagination token called a marker is included in the response so you can retrieve the remaining results.</p>
198    /// <p>Default: 100</p>
199    /// <p>Constraints: Minimum 20, maximum 100</p>
200    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
201        self.inner = self.inner.set_max_records(input);
202        self
203    }
204    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a pagination token called a marker is included in the response so you can retrieve the remaining results.</p>
205    /// <p>Default: 100</p>
206    /// <p>Constraints: Minimum 20, maximum 100</p>
207    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
208        self.inner.get_max_records()
209    }
210    /// <p>An optional pagination token provided by a previous <code>DescribeDBClusters</code> request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
211    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212        self.inner = self.inner.marker(input.into());
213        self
214    }
215    /// <p>An optional pagination token provided by a previous <code>DescribeDBClusters</code> request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
216    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217        self.inner = self.inner.set_marker(input);
218        self
219    }
220    /// <p>An optional pagination token provided by a previous <code>DescribeDBClusters</code> request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
221    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
222        self.inner.get_marker()
223    }
224    /// <p>Specifies whether the output includes information about clusters shared from other Amazon Web Services accounts.</p>
225    pub fn include_shared(mut self, input: bool) -> Self {
226        self.inner = self.inner.include_shared(input);
227        self
228    }
229    /// <p>Specifies whether the output includes information about clusters shared from other Amazon Web Services accounts.</p>
230    pub fn set_include_shared(mut self, input: ::std::option::Option<bool>) -> Self {
231        self.inner = self.inner.set_include_shared(input);
232        self
233    }
234    /// <p>Specifies whether the output includes information about clusters shared from other Amazon Web Services accounts.</p>
235    pub fn get_include_shared(&self) -> &::std::option::Option<bool> {
236        self.inner.get_include_shared()
237    }
238}
239
240/// Successful return type for the `db_cluster_available` waiter.
241pub type DbClusterAvailableFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
242    crate::operation::describe_db_clusters::DescribeDbClustersOutput,
243    ::aws_smithy_runtime_api::client::result::SdkError<
244        crate::operation::describe_db_clusters::DescribeDBClustersError,
245        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
246    >,
247>;
248
249/// Error type for the `db_cluster_available` waiter.
250pub type WaitUntilDbClusterAvailableError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
251    crate::operation::describe_db_clusters::DescribeDbClustersOutput,
252    crate::operation::describe_db_clusters::DescribeDBClustersError,
253>;