aws_sdk_databasemigration/waiters/
endpoint_deleted.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `endpoint_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 EndpointDeletedFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_endpoints::builders::DescribeEndpointsInputBuilder,
18}
19impl EndpointDeletedFluentBuilder {
20    /// Creates a new `EndpointDeletedFluentBuilder`.
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 DescribeEndpoints as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_endpoints::builders::DescribeEndpointsInputBuilder {
29        &self.inner
30    }
31    /// Wait until testing endpoint is deleted.
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::endpoint_deleted::EndpointDeletedFinalPoll,
37        crate::waiters::endpoint_deleted::WaitUntilEndpointDeletedError,
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_endpoints::DescribeEndpoints::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_endpoints::DescribeEndpointsOutput,
59            &crate::operation::describe_endpoints::DescribeEndpointsError,
60        >| {
61            // Matches: {"errorType":"ResourceNotFoundFault"}
62            if crate::waiters::matchers::match_describe_endpoints_1fde5333d0c106036(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"output":{"path":"Endpoints[].Status","expected":"active","comparator":"anyStringEquals"}}
66            if crate::waiters::matchers::match_describe_endpoints_01e982130e5ce98de(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
68            }
69            // Matches: {"output":{"path":"Endpoints[].Status","expected":"creating","comparator":"anyStringEquals"}}
70            if crate::waiters::matchers::match_describe_endpoints_3de7d2cf38cf7be74(result) {
71                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
72            }
73            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
74        };
75        let operation = move || {
76            let input = input.clone();
77            let runtime_plugins = runtime_plugins.clone();
78            async move { crate::operation::describe_endpoints::DescribeEndpoints::orchestrate(&runtime_plugins, input).await }
79        };
80        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
81            .min_delay(::std::time::Duration::from_secs(5))
82            .max_delay(::std::time::Duration::from_secs(120))
83            .max_wait(max_wait)
84            .time_source(time_source)
85            .sleep_impl(sleep_impl)
86            .acceptor(acceptor)
87            .operation(operation)
88            .build();
89        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
90    }
91    ///
92    /// Appends an item to `Filters`.
93    ///
94    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
95    ///
96    /// <p>Filters applied to the endpoints.</p>
97    /// <p>Valid filter names: endpoint-arn | endpoint-type | endpoint-id | engine-name</p>
98    pub fn filters(mut self, input: crate::types::Filter) -> Self {
99        self.inner = self.inner.filters(input);
100        self
101    }
102    /// <p>Filters applied to the endpoints.</p>
103    /// <p>Valid filter names: endpoint-arn | endpoint-type | endpoint-id | engine-name</p>
104    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
105        self.inner = self.inner.set_filters(input);
106        self
107    }
108    /// <p>Filters applied to the endpoints.</p>
109    /// <p>Valid filter names: endpoint-arn | endpoint-type | endpoint-id | engine-name</p>
110    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
111        self.inner.get_filters()
112    }
113    /// <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>
114    /// <p>Default: 100</p>
115    /// <p>Constraints: Minimum 20, maximum 100.</p>
116    pub fn max_records(mut self, input: i32) -> Self {
117        self.inner = self.inner.max_records(input);
118        self
119    }
120    /// <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>
121    /// <p>Default: 100</p>
122    /// <p>Constraints: Minimum 20, maximum 100.</p>
123    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
124        self.inner = self.inner.set_max_records(input);
125        self
126    }
127    /// <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>
128    /// <p>Default: 100</p>
129    /// <p>Constraints: Minimum 20, maximum 100.</p>
130    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
131        self.inner.get_max_records()
132    }
133    /// <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>
134    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.marker(input.into());
136        self
137    }
138    /// <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>
139    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_marker(input);
141        self
142    }
143    /// <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>
144    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_marker()
146    }
147}
148
149/// Successful return type for the `endpoint_deleted` waiter.
150pub type EndpointDeletedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
151    crate::operation::describe_endpoints::DescribeEndpointsOutput,
152    ::aws_smithy_runtime_api::client::result::SdkError<
153        crate::operation::describe_endpoints::DescribeEndpointsError,
154        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
155    >,
156>;
157
158/// Error type for the `endpoint_deleted` waiter.
159pub type WaitUntilEndpointDeletedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
160    crate::operation::describe_endpoints::DescribeEndpointsOutput,
161    crate::operation::describe_endpoints::DescribeEndpointsError,
162>;