aws_sdk_elasticache/waiters/
cache_cluster_deleted.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `cache_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 CacheClusterDeletedFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_cache_clusters::builders::DescribeCacheClustersInputBuilder,
18}
19impl CacheClusterDeletedFluentBuilder {
20    /// Creates a new `CacheClusterDeletedFluentBuilder`.
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 DescribeCacheClusters as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_cache_clusters::builders::DescribeCacheClustersInputBuilder {
29        &self.inner
30    }
31    /// Wait until ElastiCache cluster is deleted.
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::cache_cluster_deleted::CacheClusterDeletedFinalPoll,
37        crate::waiters::cache_cluster_deleted::WaitUntilCacheClusterDeletedError,
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_cache_clusters::DescribeCacheClusters::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_cache_clusters::DescribeCacheClustersOutput,
59            &crate::operation::describe_cache_clusters::DescribeCacheClustersError,
60        >| {
61            // Matches: {"output":{"path":"CacheClusters[].CacheClusterStatus","expected":"deleted","comparator":"allStringEquals"}}
62            if crate::waiters::matchers::match_describe_cache_clusters_9b0db4ce0e1cae9d1(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"errorType":"CacheClusterNotFound"}
66            if crate::waiters::matchers::match_describe_cache_clusters_13fb1ec270a894d62(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
68            }
69            // Matches: {"output":{"path":"CacheClusters[].CacheClusterStatus","expected":"available","comparator":"anyStringEquals"}}
70            if crate::waiters::matchers::match_describe_cache_clusters_ddb2abc814c08e34b(result) {
71                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
72            }
73            // Matches: {"output":{"path":"CacheClusters[].CacheClusterStatus","expected":"creating","comparator":"anyStringEquals"}}
74            if crate::waiters::matchers::match_describe_cache_clusters_2041fc59b2bfcabbb(result) {
75                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
76            }
77            // Matches: {"output":{"path":"CacheClusters[].CacheClusterStatus","expected":"incompatible-network","comparator":"anyStringEquals"}}
78            if crate::waiters::matchers::match_describe_cache_clusters_6ff5fd2b4d5851182(result) {
79                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
80            }
81            // Matches: {"output":{"path":"CacheClusters[].CacheClusterStatus","expected":"modifying","comparator":"anyStringEquals"}}
82            if crate::waiters::matchers::match_describe_cache_clusters_5eb6db81edfe1118d(result) {
83                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
84            }
85            // Matches: {"output":{"path":"CacheClusters[].CacheClusterStatus","expected":"restore-failed","comparator":"anyStringEquals"}}
86            if crate::waiters::matchers::match_describe_cache_clusters_723593c7b9870d199(result) {
87                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
88            }
89            // Matches: {"output":{"path":"CacheClusters[].CacheClusterStatus","expected":"snapshotting","comparator":"anyStringEquals"}}
90            if crate::waiters::matchers::match_describe_cache_clusters_2126b8344a1788d4a(result) {
91                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
92            }
93            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
94        };
95        let operation = move || {
96            let input = input.clone();
97            let runtime_plugins = runtime_plugins.clone();
98            async move { crate::operation::describe_cache_clusters::DescribeCacheClusters::orchestrate(&runtime_plugins, input).await }
99        };
100        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
101            .min_delay(::std::time::Duration::from_secs(15))
102            .max_delay(::std::time::Duration::from_secs(120))
103            .max_wait(max_wait)
104            .time_source(time_source)
105            .sleep_impl(sleep_impl)
106            .acceptor(acceptor)
107            .operation(operation)
108            .build();
109        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
110    }
111    /// <p>The user-supplied cluster identifier. If this parameter is specified, only information about that specific cluster is returned. This parameter isn't case sensitive.</p>
112    pub fn cache_cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.cache_cluster_id(input.into());
114        self
115    }
116    /// <p>The user-supplied cluster identifier. If this parameter is specified, only information about that specific cluster is returned. This parameter isn't case sensitive.</p>
117    pub fn set_cache_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_cache_cluster_id(input);
119        self
120    }
121    /// <p>The user-supplied cluster identifier. If this parameter is specified, only information about that specific cluster is returned. This parameter isn't case sensitive.</p>
122    pub fn get_cache_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_cache_cluster_id()
124    }
125    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p>
126    /// <p>Default: 100</p>
127    /// <p>Constraints: minimum 20; maximum 100.</p>
128    pub fn max_records(mut self, input: i32) -> Self {
129        self.inner = self.inner.max_records(input);
130        self
131    }
132    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p>
133    /// <p>Default: 100</p>
134    /// <p>Constraints: minimum 20; maximum 100.</p>
135    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
136        self.inner = self.inner.set_max_records(input);
137        self
138    }
139    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, a marker is included in the response so that the remaining results can be retrieved.</p>
140    /// <p>Default: 100</p>
141    /// <p>Constraints: minimum 20; maximum 100.</p>
142    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
143        self.inner.get_max_records()
144    }
145    /// <p>An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
146    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.marker(input.into());
148        self
149    }
150    /// <p>An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
151    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_marker(input);
153        self
154    }
155    /// <p>An optional marker returned from a prior request. Use this marker for pagination of results from this operation. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
156    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_marker()
158    }
159    /// <p>An optional flag that can be included in the <code>DescribeCacheCluster</code> request to retrieve information about the individual cache nodes.</p>
160    pub fn show_cache_node_info(mut self, input: bool) -> Self {
161        self.inner = self.inner.show_cache_node_info(input);
162        self
163    }
164    /// <p>An optional flag that can be included in the <code>DescribeCacheCluster</code> request to retrieve information about the individual cache nodes.</p>
165    pub fn set_show_cache_node_info(mut self, input: ::std::option::Option<bool>) -> Self {
166        self.inner = self.inner.set_show_cache_node_info(input);
167        self
168    }
169    /// <p>An optional flag that can be included in the <code>DescribeCacheCluster</code> request to retrieve information about the individual cache nodes.</p>
170    pub fn get_show_cache_node_info(&self) -> &::std::option::Option<bool> {
171        self.inner.get_show_cache_node_info()
172    }
173    /// <p>An optional flag that can be included in the <code>DescribeCacheCluster</code> request to show only nodes (API/CLI: clusters) that are not members of a replication group. In practice, this means Memcached and single node Valkey or Redis OSS clusters.</p>
174    pub fn show_cache_clusters_not_in_replication_groups(mut self, input: bool) -> Self {
175        self.inner = self.inner.show_cache_clusters_not_in_replication_groups(input);
176        self
177    }
178    /// <p>An optional flag that can be included in the <code>DescribeCacheCluster</code> request to show only nodes (API/CLI: clusters) that are not members of a replication group. In practice, this means Memcached and single node Valkey or Redis OSS clusters.</p>
179    pub fn set_show_cache_clusters_not_in_replication_groups(mut self, input: ::std::option::Option<bool>) -> Self {
180        self.inner = self.inner.set_show_cache_clusters_not_in_replication_groups(input);
181        self
182    }
183    /// <p>An optional flag that can be included in the <code>DescribeCacheCluster</code> request to show only nodes (API/CLI: clusters) that are not members of a replication group. In practice, this means Memcached and single node Valkey or Redis OSS clusters.</p>
184    pub fn get_show_cache_clusters_not_in_replication_groups(&self) -> &::std::option::Option<bool> {
185        self.inner.get_show_cache_clusters_not_in_replication_groups()
186    }
187}
188
189/// Successful return type for the `cache_cluster_deleted` waiter.
190pub type CacheClusterDeletedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
191    crate::operation::describe_cache_clusters::DescribeCacheClustersOutput,
192    ::aws_smithy_runtime_api::client::result::SdkError<
193        crate::operation::describe_cache_clusters::DescribeCacheClustersError,
194        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
195    >,
196>;
197
198/// Error type for the `cache_cluster_deleted` waiter.
199pub type WaitUntilCacheClusterDeletedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
200    crate::operation::describe_cache_clusters::DescribeCacheClustersOutput,
201    crate::operation::describe_cache_clusters::DescribeCacheClustersError,
202>;