aws_sdk_databasemigration/waiters/
replication_instance_deleted.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `replication_instance_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 ReplicationInstanceDeletedFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_replication_instances::builders::DescribeReplicationInstancesInputBuilder,
18}
19impl ReplicationInstanceDeletedFluentBuilder {
20    /// Creates a new `ReplicationInstanceDeletedFluentBuilder`.
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 DescribeReplicationInstances as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_replication_instances::builders::DescribeReplicationInstancesInputBuilder {
29        &self.inner
30    }
31    /// Wait until DMS replication instance is deleted.
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::replication_instance_deleted::ReplicationInstanceDeletedFinalPoll,
37        crate::waiters::replication_instance_deleted::WaitUntilReplicationInstanceDeletedError,
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_replication_instances::DescribeReplicationInstances::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_replication_instances::DescribeReplicationInstancesOutput,
59            &crate::operation::describe_replication_instances::DescribeReplicationInstancesError,
60        >| {
61            // Matches: {"output":{"path":"ReplicationInstances[].ReplicationInstanceStatus","expected":"available","comparator":"anyStringEquals"}}
62            if crate::waiters::matchers::match_describe_replication_instances_fd0bb3cf35ece9d2b(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
64            }
65            // Matches: {"errorType":"ResourceNotFoundFault"}
66            if crate::waiters::matchers::match_describe_replication_instances_1fde5333d0c106036(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
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_replication_instances::DescribeReplicationInstances::orchestrate(&runtime_plugins, input).await }
75        };
76        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
77            .min_delay(::std::time::Duration::from_secs(15))
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    ///
88    /// Appends an item to `Filters`.
89    ///
90    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
91    ///
92    /// <p>Filters applied to replication instances.</p>
93    /// <p>Valid filter names: replication-instance-arn | replication-instance-id | replication-instance-class | engine-version</p>
94    pub fn filters(mut self, input: crate::types::Filter) -> Self {
95        self.inner = self.inner.filters(input);
96        self
97    }
98    /// <p>Filters applied to replication instances.</p>
99    /// <p>Valid filter names: replication-instance-arn | replication-instance-id | replication-instance-class | engine-version</p>
100    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
101        self.inner = self.inner.set_filters(input);
102        self
103    }
104    /// <p>Filters applied to replication instances.</p>
105    /// <p>Valid filter names: replication-instance-arn | replication-instance-id | replication-instance-class | engine-version</p>
106    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
107        self.inner.get_filters()
108    }
109    /// <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 that the remaining results can be retrieved.</p>
110    /// <p>Default: 100</p>
111    /// <p>Constraints: Minimum 20, maximum 100.</p>
112    pub fn max_records(mut self, input: i32) -> Self {
113        self.inner = self.inner.max_records(input);
114        self
115    }
116    /// <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 that the remaining results can be retrieved.</p>
117    /// <p>Default: 100</p>
118    /// <p>Constraints: Minimum 20, maximum 100.</p>
119    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
120        self.inner = self.inner.set_max_records(input);
121        self
122    }
123    /// <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 that the remaining results can be retrieved.</p>
124    /// <p>Default: 100</p>
125    /// <p>Constraints: Minimum 20, maximum 100.</p>
126    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
127        self.inner.get_max_records()
128    }
129    /// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
130    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.marker(input.into());
132        self
133    }
134    /// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
135    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_marker(input);
137        self
138    }
139    /// <p>An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
140    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_marker()
142    }
143}
144
145/// Successful return type for the `replication_instance_deleted` waiter.
146pub type ReplicationInstanceDeletedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
147    crate::operation::describe_replication_instances::DescribeReplicationInstancesOutput,
148    ::aws_smithy_runtime_api::client::result::SdkError<
149        crate::operation::describe_replication_instances::DescribeReplicationInstancesError,
150        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
151    >,
152>;
153
154/// Error type for the `replication_instance_deleted` waiter.
155pub type WaitUntilReplicationInstanceDeletedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
156    crate::operation::describe_replication_instances::DescribeReplicationInstancesOutput,
157    crate::operation::describe_replication_instances::DescribeReplicationInstancesError,
158>;