aws_sdk_databasemigration/waiters/
replication_task_stopped.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `replication_task_stopped` 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 ReplicationTaskStoppedFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_replication_tasks::builders::DescribeReplicationTasksInputBuilder,
18}
19impl ReplicationTaskStoppedFluentBuilder {
20    /// Creates a new `ReplicationTaskStoppedFluentBuilder`.
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 DescribeReplicationTasks as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_replication_tasks::builders::DescribeReplicationTasksInputBuilder {
29        &self.inner
30    }
31    /// Wait until DMS replication task is stopped.
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::replication_task_stopped::ReplicationTaskStoppedFinalPoll,
37        crate::waiters::replication_task_stopped::WaitUntilReplicationTaskStoppedError,
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_tasks::DescribeReplicationTasks::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_tasks::DescribeReplicationTasksOutput,
59            &crate::operation::describe_replication_tasks::DescribeReplicationTasksError,
60        >| {
61            // Matches: {"output":{"path":"ReplicationTasks[].Status","expected":"stopped","comparator":"allStringEquals"}}
62            if crate::waiters::matchers::match_describe_replication_tasks_452b66e112114876a(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"output":{"path":"ReplicationTasks[].Status","expected":"ready","comparator":"anyStringEquals"}}
66            if crate::waiters::matchers::match_describe_replication_tasks_1b25aac82a62b94ba(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
68            }
69            // Matches: {"output":{"path":"ReplicationTasks[].Status","expected":"creating","comparator":"anyStringEquals"}}
70            if crate::waiters::matchers::match_describe_replication_tasks_d4aeee88c7bfd503a(result) {
71                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
72            }
73            // Matches: {"output":{"path":"ReplicationTasks[].Status","expected":"starting","comparator":"anyStringEquals"}}
74            if crate::waiters::matchers::match_describe_replication_tasks_3f7b68c20df47dd3e(result) {
75                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
76            }
77            // Matches: {"output":{"path":"ReplicationTasks[].Status","expected":"failed","comparator":"anyStringEquals"}}
78            if crate::waiters::matchers::match_describe_replication_tasks_ffec3dac7ed61b70a(result) {
79                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
80            }
81            // Matches: {"output":{"path":"ReplicationTasks[].Status","expected":"modifying","comparator":"anyStringEquals"}}
82            if crate::waiters::matchers::match_describe_replication_tasks_407522aecac30ef88(result) {
83                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
84            }
85            // Matches: {"output":{"path":"ReplicationTasks[].Status","expected":"testing","comparator":"anyStringEquals"}}
86            if crate::waiters::matchers::match_describe_replication_tasks_3fec7b96d9cc95eed(result) {
87                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
88            }
89            // Matches: {"output":{"path":"ReplicationTasks[].Status","expected":"deleting","comparator":"anyStringEquals"}}
90            if crate::waiters::matchers::match_describe_replication_tasks_a83ca122dc3e3b2d2(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_replication_tasks::DescribeReplicationTasks::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    ///
112    /// Appends an item to `Filters`.
113    ///
114    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
115    ///
116    /// <p>Filters applied to replication tasks.</p>
117    /// <p>Valid filter names: replication-task-arn | replication-task-id | migration-type | endpoint-arn | replication-instance-arn</p>
118    pub fn filters(mut self, input: crate::types::Filter) -> Self {
119        self.inner = self.inner.filters(input);
120        self
121    }
122    /// <p>Filters applied to replication tasks.</p>
123    /// <p>Valid filter names: replication-task-arn | replication-task-id | migration-type | endpoint-arn | replication-instance-arn</p>
124    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
125        self.inner = self.inner.set_filters(input);
126        self
127    }
128    /// <p>Filters applied to replication tasks.</p>
129    /// <p>Valid filter names: replication-task-arn | replication-task-id | migration-type | endpoint-arn | replication-instance-arn</p>
130    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
131        self.inner.get_filters()
132    }
133    /// <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>
134    /// <p>Default: 100</p>
135    /// <p>Constraints: Minimum 20, maximum 100.</p>
136    pub fn max_records(mut self, input: i32) -> Self {
137        self.inner = self.inner.max_records(input);
138        self
139    }
140    /// <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>
141    /// <p>Default: 100</p>
142    /// <p>Constraints: Minimum 20, maximum 100.</p>
143    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
144        self.inner = self.inner.set_max_records(input);
145        self
146    }
147    /// <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>
148    /// <p>Default: 100</p>
149    /// <p>Constraints: Minimum 20, maximum 100.</p>
150    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
151        self.inner.get_max_records()
152    }
153    /// <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>
154    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.marker(input.into());
156        self
157    }
158    /// <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>
159    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_marker(input);
161        self
162    }
163    /// <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>
164    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_marker()
166    }
167    /// <p>An option to set to avoid returning information about settings. Use this to reduce overhead when setting information is too large. To use this option, choose <code>true</code>; otherwise, choose <code>false</code> (the default).</p>
168    pub fn without_settings(mut self, input: bool) -> Self {
169        self.inner = self.inner.without_settings(input);
170        self
171    }
172    /// <p>An option to set to avoid returning information about settings. Use this to reduce overhead when setting information is too large. To use this option, choose <code>true</code>; otherwise, choose <code>false</code> (the default).</p>
173    pub fn set_without_settings(mut self, input: ::std::option::Option<bool>) -> Self {
174        self.inner = self.inner.set_without_settings(input);
175        self
176    }
177    /// <p>An option to set to avoid returning information about settings. Use this to reduce overhead when setting information is too large. To use this option, choose <code>true</code>; otherwise, choose <code>false</code> (the default).</p>
178    pub fn get_without_settings(&self) -> &::std::option::Option<bool> {
179        self.inner.get_without_settings()
180    }
181}
182
183/// Successful return type for the `replication_task_stopped` waiter.
184pub type ReplicationTaskStoppedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
185    crate::operation::describe_replication_tasks::DescribeReplicationTasksOutput,
186    ::aws_smithy_runtime_api::client::result::SdkError<
187        crate::operation::describe_replication_tasks::DescribeReplicationTasksError,
188        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
189    >,
190>;
191
192/// Error type for the `replication_task_stopped` waiter.
193pub type WaitUntilReplicationTaskStoppedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
194    crate::operation::describe_replication_tasks::DescribeReplicationTasksOutput,
195    crate::operation::describe_replication_tasks::DescribeReplicationTasksError,
196>;