aws_sdk_rds/waiters/db_cluster_snapshot_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_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 DbClusterSnapshotAvailableFluentBuilder {
16 handle: ::std::sync::Arc<crate::client::Handle>,
17 inner: crate::operation::describe_db_cluster_snapshots::builders::DescribeDbClusterSnapshotsInputBuilder,
18}
19impl DbClusterSnapshotAvailableFluentBuilder {
20 /// Creates a new `DbClusterSnapshotAvailableFluentBuilder`.
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 DescribeDBClusterSnapshots as a reference.
28 pub fn as_input(&self) -> &crate::operation::describe_db_cluster_snapshots::builders::DescribeDbClusterSnapshotsInputBuilder {
29 &self.inner
30 }
31 /// Wait for `db_cluster_snapshot_available`
32 pub async fn wait(
33 self,
34 max_wait: ::std::time::Duration,
35 ) -> ::std::result::Result<
36 crate::waiters::db_cluster_snapshot_available::DbClusterSnapshotAvailableFinalPoll,
37 crate::waiters::db_cluster_snapshot_available::WaitUntilDbClusterSnapshotAvailableError,
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_cluster_snapshots::DescribeDBClusterSnapshots::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_cluster_snapshots::DescribeDbClusterSnapshotsOutput,
59 &crate::operation::describe_db_cluster_snapshots::DescribeDBClusterSnapshotsError,
60 >| {
61 // Matches: {"output":{"path":"DBClusterSnapshots[].Status","expected":"available","comparator":"allStringEquals"}}
62 if crate::waiters::matchers::match_describe_db_cluster_snapshots_24cd583c41e1b6f5b(result) {
63 return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64 }
65 // Matches: {"output":{"path":"DBClusterSnapshots[].Status","expected":"deleted","comparator":"anyStringEquals"}}
66 if crate::waiters::matchers::match_describe_db_cluster_snapshots_5427b6f5e4914268c(result) {
67 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
68 }
69 // Matches: {"output":{"path":"DBClusterSnapshots[].Status","expected":"deleting","comparator":"anyStringEquals"}}
70 if crate::waiters::matchers::match_describe_db_cluster_snapshots_af7eba9c0acf7a132(result) {
71 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
72 }
73 // Matches: {"output":{"path":"DBClusterSnapshots[].Status","expected":"failed","comparator":"anyStringEquals"}}
74 if crate::waiters::matchers::match_describe_db_cluster_snapshots_7dfe0a1282e024903(result) {
75 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
76 }
77 // Matches: {"output":{"path":"DBClusterSnapshots[].Status","expected":"incompatible-restore","comparator":"anyStringEquals"}}
78 if crate::waiters::matchers::match_describe_db_cluster_snapshots_cdbd4a65a155a7bf7(result) {
79 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
80 }
81 // Matches: {"output":{"path":"DBClusterSnapshots[].Status","expected":"incompatible-parameters","comparator":"anyStringEquals"}}
82 if crate::waiters::matchers::match_describe_db_cluster_snapshots_48db92f438f307f0d(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_cluster_snapshots::DescribeDBClusterSnapshots::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 ID of the DB cluster to retrieve the list of DB cluster snapshots for. This parameter can't be used in conjunction with the <code>DBClusterSnapshotIdentifier</code> parameter. This parameter isn't case-sensitive.</p>
104 /// <p>Constraints:</p>
105 /// <ul>
106 /// <li>
107 /// <p>If supplied, must match the identifier of an existing DBCluster.</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 ID of the DB cluster to retrieve the list of DB cluster snapshots for. This parameter can't be used in conjunction with the <code>DBClusterSnapshotIdentifier</code> parameter. This parameter isn't case-sensitive.</p>
114 /// <p>Constraints:</p>
115 /// <ul>
116 /// <li>
117 /// <p>If supplied, must match the identifier of an existing DBCluster.</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 ID of the DB cluster to retrieve the list of DB cluster snapshots for. This parameter can't be used in conjunction with the <code>DBClusterSnapshotIdentifier</code> parameter. This parameter isn't case-sensitive.</p>
124 /// <p>Constraints:</p>
125 /// <ul>
126 /// <li>
127 /// <p>If supplied, must match the identifier of an existing DBCluster.</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 /// <p>A specific DB cluster snapshot identifier to describe. This parameter can't be used in conjunction with the <code>DBClusterIdentifier</code> parameter. This value is stored as a lowercase string.</p>
133 /// <p>Constraints:</p>
134 /// <ul>
135 /// <li>
136 /// <p>If supplied, must match the identifier of an existing DBClusterSnapshot.</p></li>
137 /// <li>
138 /// <p>If this identifier is for an automated snapshot, the <code>SnapshotType</code> parameter must also be specified.</p></li>
139 /// </ul>
140 pub fn db_cluster_snapshot_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141 self.inner = self.inner.db_cluster_snapshot_identifier(input.into());
142 self
143 }
144 /// <p>A specific DB cluster snapshot identifier to describe. This parameter can't be used in conjunction with the <code>DBClusterIdentifier</code> parameter. This value is stored as a lowercase string.</p>
145 /// <p>Constraints:</p>
146 /// <ul>
147 /// <li>
148 /// <p>If supplied, must match the identifier of an existing DBClusterSnapshot.</p></li>
149 /// <li>
150 /// <p>If this identifier is for an automated snapshot, the <code>SnapshotType</code> parameter must also be specified.</p></li>
151 /// </ul>
152 pub fn set_db_cluster_snapshot_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153 self.inner = self.inner.set_db_cluster_snapshot_identifier(input);
154 self
155 }
156 /// <p>A specific DB cluster snapshot identifier to describe. This parameter can't be used in conjunction with the <code>DBClusterIdentifier</code> parameter. This value is stored as a lowercase string.</p>
157 /// <p>Constraints:</p>
158 /// <ul>
159 /// <li>
160 /// <p>If supplied, must match the identifier of an existing DBClusterSnapshot.</p></li>
161 /// <li>
162 /// <p>If this identifier is for an automated snapshot, the <code>SnapshotType</code> parameter must also be specified.</p></li>
163 /// </ul>
164 pub fn get_db_cluster_snapshot_identifier(&self) -> &::std::option::Option<::std::string::String> {
165 self.inner.get_db_cluster_snapshot_identifier()
166 }
167 /// <p>The type of DB cluster snapshots to be returned. You can specify one of the following values:</p>
168 /// <ul>
169 /// <li>
170 /// <p><code>automated</code> - Return all DB cluster snapshots that have been automatically taken by Amazon RDS for my Amazon Web Services account.</p></li>
171 /// <li>
172 /// <p><code>manual</code> - Return all DB cluster snapshots that have been taken by my Amazon Web Services account.</p></li>
173 /// <li>
174 /// <p><code>shared</code> - Return all manual DB cluster snapshots that have been shared to my Amazon Web Services account.</p></li>
175 /// <li>
176 /// <p><code>public</code> - Return all DB cluster snapshots that have been marked as public.</p></li>
177 /// </ul>
178 /// <p>If you don't specify a <code>SnapshotType</code> value, then both automated and manual DB cluster snapshots are returned. You can include shared DB cluster snapshots with these results by enabling the <code>IncludeShared</code> parameter. You can include public DB cluster snapshots with these results by enabling the <code>IncludePublic</code> parameter.</p>
179 /// <p>The <code>IncludeShared</code> and <code>IncludePublic</code> parameters don't apply for <code>SnapshotType</code> values of <code>manual</code> or <code>automated</code>. The <code>IncludePublic</code> parameter doesn't apply when <code>SnapshotType</code> is set to <code>shared</code>. The <code>IncludeShared</code> parameter doesn't apply when <code>SnapshotType</code> is set to <code>public</code>.</p>
180 pub fn snapshot_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181 self.inner = self.inner.snapshot_type(input.into());
182 self
183 }
184 /// <p>The type of DB cluster snapshots to be returned. You can specify one of the following values:</p>
185 /// <ul>
186 /// <li>
187 /// <p><code>automated</code> - Return all DB cluster snapshots that have been automatically taken by Amazon RDS for my Amazon Web Services account.</p></li>
188 /// <li>
189 /// <p><code>manual</code> - Return all DB cluster snapshots that have been taken by my Amazon Web Services account.</p></li>
190 /// <li>
191 /// <p><code>shared</code> - Return all manual DB cluster snapshots that have been shared to my Amazon Web Services account.</p></li>
192 /// <li>
193 /// <p><code>public</code> - Return all DB cluster snapshots that have been marked as public.</p></li>
194 /// </ul>
195 /// <p>If you don't specify a <code>SnapshotType</code> value, then both automated and manual DB cluster snapshots are returned. You can include shared DB cluster snapshots with these results by enabling the <code>IncludeShared</code> parameter. You can include public DB cluster snapshots with these results by enabling the <code>IncludePublic</code> parameter.</p>
196 /// <p>The <code>IncludeShared</code> and <code>IncludePublic</code> parameters don't apply for <code>SnapshotType</code> values of <code>manual</code> or <code>automated</code>. The <code>IncludePublic</code> parameter doesn't apply when <code>SnapshotType</code> is set to <code>shared</code>. The <code>IncludeShared</code> parameter doesn't apply when <code>SnapshotType</code> is set to <code>public</code>.</p>
197 pub fn set_snapshot_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
198 self.inner = self.inner.set_snapshot_type(input);
199 self
200 }
201 /// <p>The type of DB cluster snapshots to be returned. You can specify one of the following values:</p>
202 /// <ul>
203 /// <li>
204 /// <p><code>automated</code> - Return all DB cluster snapshots that have been automatically taken by Amazon RDS for my Amazon Web Services account.</p></li>
205 /// <li>
206 /// <p><code>manual</code> - Return all DB cluster snapshots that have been taken by my Amazon Web Services account.</p></li>
207 /// <li>
208 /// <p><code>shared</code> - Return all manual DB cluster snapshots that have been shared to my Amazon Web Services account.</p></li>
209 /// <li>
210 /// <p><code>public</code> - Return all DB cluster snapshots that have been marked as public.</p></li>
211 /// </ul>
212 /// <p>If you don't specify a <code>SnapshotType</code> value, then both automated and manual DB cluster snapshots are returned. You can include shared DB cluster snapshots with these results by enabling the <code>IncludeShared</code> parameter. You can include public DB cluster snapshots with these results by enabling the <code>IncludePublic</code> parameter.</p>
213 /// <p>The <code>IncludeShared</code> and <code>IncludePublic</code> parameters don't apply for <code>SnapshotType</code> values of <code>manual</code> or <code>automated</code>. The <code>IncludePublic</code> parameter doesn't apply when <code>SnapshotType</code> is set to <code>shared</code>. The <code>IncludeShared</code> parameter doesn't apply when <code>SnapshotType</code> is set to <code>public</code>.</p>
214 pub fn get_snapshot_type(&self) -> &::std::option::Option<::std::string::String> {
215 self.inner.get_snapshot_type()
216 }
217 ///
218 /// Appends an item to `Filters`.
219 ///
220 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
221 ///
222 /// <p>A filter that specifies one or more DB cluster snapshots to describe.</p>
223 /// <p>Supported filters:</p>
224 /// <ul>
225 /// <li>
226 /// <p><code>db-cluster-id</code> - Accepts DB cluster identifiers and DB cluster Amazon Resource Names (ARNs).</p></li>
227 /// <li>
228 /// <p><code>db-cluster-snapshot-id</code> - Accepts DB cluster snapshot identifiers.</p></li>
229 /// <li>
230 /// <p><code>snapshot-type</code> - Accepts types of DB cluster snapshots.</p></li>
231 /// <li>
232 /// <p><code>engine</code> - Accepts names of database engines.</p></li>
233 /// </ul>
234 pub fn filters(mut self, input: crate::types::Filter) -> Self {
235 self.inner = self.inner.filters(input);
236 self
237 }
238 /// <p>A filter that specifies one or more DB cluster snapshots to describe.</p>
239 /// <p>Supported filters:</p>
240 /// <ul>
241 /// <li>
242 /// <p><code>db-cluster-id</code> - Accepts DB cluster identifiers and DB cluster Amazon Resource Names (ARNs).</p></li>
243 /// <li>
244 /// <p><code>db-cluster-snapshot-id</code> - Accepts DB cluster snapshot identifiers.</p></li>
245 /// <li>
246 /// <p><code>snapshot-type</code> - Accepts types of DB cluster snapshots.</p></li>
247 /// <li>
248 /// <p><code>engine</code> - Accepts names of database engines.</p></li>
249 /// </ul>
250 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
251 self.inner = self.inner.set_filters(input);
252 self
253 }
254 /// <p>A filter that specifies one or more DB cluster snapshots to describe.</p>
255 /// <p>Supported filters:</p>
256 /// <ul>
257 /// <li>
258 /// <p><code>db-cluster-id</code> - Accepts DB cluster identifiers and DB cluster Amazon Resource Names (ARNs).</p></li>
259 /// <li>
260 /// <p><code>db-cluster-snapshot-id</code> - Accepts DB cluster snapshot identifiers.</p></li>
261 /// <li>
262 /// <p><code>snapshot-type</code> - Accepts types of DB cluster snapshots.</p></li>
263 /// <li>
264 /// <p><code>engine</code> - Accepts names of database engines.</p></li>
265 /// </ul>
266 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
267 self.inner.get_filters()
268 }
269 /// <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>
270 /// <p>Default: 100</p>
271 /// <p>Constraints: Minimum 20, maximum 100.</p>
272 pub fn max_records(mut self, input: i32) -> Self {
273 self.inner = self.inner.max_records(input);
274 self
275 }
276 /// <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>
277 /// <p>Default: 100</p>
278 /// <p>Constraints: Minimum 20, maximum 100.</p>
279 pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
280 self.inner = self.inner.set_max_records(input);
281 self
282 }
283 /// <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>
284 /// <p>Default: 100</p>
285 /// <p>Constraints: Minimum 20, maximum 100.</p>
286 pub fn get_max_records(&self) -> &::std::option::Option<i32> {
287 self.inner.get_max_records()
288 }
289 /// <p>An optional pagination token provided by a previous <code>DescribeDBClusterSnapshots</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>
290 pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
291 self.inner = self.inner.marker(input.into());
292 self
293 }
294 /// <p>An optional pagination token provided by a previous <code>DescribeDBClusterSnapshots</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>
295 pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
296 self.inner = self.inner.set_marker(input);
297 self
298 }
299 /// <p>An optional pagination token provided by a previous <code>DescribeDBClusterSnapshots</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>
300 pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
301 self.inner.get_marker()
302 }
303 /// <p>Specifies whether to include shared manual DB cluster snapshots from other Amazon Web Services accounts that this Amazon Web Services account has been given permission to copy or restore. By default, these snapshots are not included.</p>
304 /// <p>You can give an Amazon Web Services account permission to restore a manual DB cluster snapshot from another Amazon Web Services account by the <code>ModifyDBClusterSnapshotAttribute</code> API action.</p>
305 pub fn include_shared(mut self, input: bool) -> Self {
306 self.inner = self.inner.include_shared(input);
307 self
308 }
309 /// <p>Specifies whether to include shared manual DB cluster snapshots from other Amazon Web Services accounts that this Amazon Web Services account has been given permission to copy or restore. By default, these snapshots are not included.</p>
310 /// <p>You can give an Amazon Web Services account permission to restore a manual DB cluster snapshot from another Amazon Web Services account by the <code>ModifyDBClusterSnapshotAttribute</code> API action.</p>
311 pub fn set_include_shared(mut self, input: ::std::option::Option<bool>) -> Self {
312 self.inner = self.inner.set_include_shared(input);
313 self
314 }
315 /// <p>Specifies whether to include shared manual DB cluster snapshots from other Amazon Web Services accounts that this Amazon Web Services account has been given permission to copy or restore. By default, these snapshots are not included.</p>
316 /// <p>You can give an Amazon Web Services account permission to restore a manual DB cluster snapshot from another Amazon Web Services account by the <code>ModifyDBClusterSnapshotAttribute</code> API action.</p>
317 pub fn get_include_shared(&self) -> &::std::option::Option<bool> {
318 self.inner.get_include_shared()
319 }
320 /// <p>Specifies whether to include manual DB cluster snapshots that are public and can be copied or restored by any Amazon Web Services account. By default, the public snapshots are not included.</p>
321 /// <p>You can share a manual DB cluster snapshot as public by using the <code>ModifyDBClusterSnapshotAttribute</code> API action.</p>
322 pub fn include_public(mut self, input: bool) -> Self {
323 self.inner = self.inner.include_public(input);
324 self
325 }
326 /// <p>Specifies whether to include manual DB cluster snapshots that are public and can be copied or restored by any Amazon Web Services account. By default, the public snapshots are not included.</p>
327 /// <p>You can share a manual DB cluster snapshot as public by using the <code>ModifyDBClusterSnapshotAttribute</code> API action.</p>
328 pub fn set_include_public(mut self, input: ::std::option::Option<bool>) -> Self {
329 self.inner = self.inner.set_include_public(input);
330 self
331 }
332 /// <p>Specifies whether to include manual DB cluster snapshots that are public and can be copied or restored by any Amazon Web Services account. By default, the public snapshots are not included.</p>
333 /// <p>You can share a manual DB cluster snapshot as public by using the <code>ModifyDBClusterSnapshotAttribute</code> API action.</p>
334 pub fn get_include_public(&self) -> &::std::option::Option<bool> {
335 self.inner.get_include_public()
336 }
337 /// <p>A specific DB cluster resource ID to describe.</p>
338 pub fn db_cluster_resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
339 self.inner = self.inner.db_cluster_resource_id(input.into());
340 self
341 }
342 /// <p>A specific DB cluster resource ID to describe.</p>
343 pub fn set_db_cluster_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
344 self.inner = self.inner.set_db_cluster_resource_id(input);
345 self
346 }
347 /// <p>A specific DB cluster resource ID to describe.</p>
348 pub fn get_db_cluster_resource_id(&self) -> &::std::option::Option<::std::string::String> {
349 self.inner.get_db_cluster_resource_id()
350 }
351}
352
353/// Successful return type for the `db_cluster_snapshot_available` waiter.
354pub type DbClusterSnapshotAvailableFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
355 crate::operation::describe_db_cluster_snapshots::DescribeDbClusterSnapshotsOutput,
356 ::aws_smithy_runtime_api::client::result::SdkError<
357 crate::operation::describe_db_cluster_snapshots::DescribeDBClusterSnapshotsError,
358 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
359 >,
360>;
361
362/// Error type for the `db_cluster_snapshot_available` waiter.
363pub type WaitUntilDbClusterSnapshotAvailableError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
364 crate::operation::describe_db_cluster_snapshots::DescribeDbClusterSnapshotsOutput,
365 crate::operation::describe_db_cluster_snapshots::DescribeDBClusterSnapshotsError,
366>;