Skip to main content

aws_sdk_databasemigration/waiters/
metadata_model_converted.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `metadata_model_converted` 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 MetadataModelConvertedFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_metadata_model_conversions::builders::DescribeMetadataModelConversionsInputBuilder,
18}
19impl MetadataModelConvertedFluentBuilder {
20    /// Creates a new `MetadataModelConvertedFluentBuilder`.
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 DescribeMetadataModelConversions as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_metadata_model_conversions::builders::DescribeMetadataModelConversionsInputBuilder {
29        &self.inner
30    }
31    /// Wait until DMS metadata model is converted.
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::metadata_model_converted::MetadataModelConvertedFinalPoll,
37        crate::waiters::metadata_model_converted::WaitUntilMetadataModelConvertedError,
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_metadata_model_conversions::DescribeMetadataModelConversions::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_metadata_model_conversions::DescribeMetadataModelConversionsOutput,
59            &crate::operation::describe_metadata_model_conversions::DescribeMetadataModelConversionsError,
60        >| {
61            // Matches: {"output":{"path":"Requests[].Status","expected":"SUCCESS","comparator":"allStringEquals"}}
62            if crate::waiters::matchers::match_describe_metadata_model_conversions_6268be19bb3c45d7d(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"output":{"path":"Requests[].Status","expected":"FAILED","comparator":"anyStringEquals"}}
66            if crate::waiters::matchers::match_describe_metadata_model_conversions_dee355b6d23c355e3(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
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 {
75                crate::operation::describe_metadata_model_conversions::DescribeMetadataModelConversions::orchestrate(&runtime_plugins, input).await
76            }
77        };
78        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
79            .min_delay(::std::time::Duration::from_secs(30))
80            .max_delay(::std::time::Duration::from_secs(120))
81            .max_wait(max_wait)
82            .time_source(time_source)
83            .sleep_impl(sleep_impl)
84            .acceptor(acceptor)
85            .operation(operation)
86            .build();
87        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
88    }
89    /// <p>The migration project name or Amazon Resource Name (ARN).</p>
90    pub fn migration_project_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.inner = self.inner.migration_project_identifier(input.into());
92        self
93    }
94    /// <p>The migration project name or Amazon Resource Name (ARN).</p>
95    pub fn set_migration_project_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.inner = self.inner.set_migration_project_identifier(input);
97        self
98    }
99    /// <p>The migration project name or Amazon Resource Name (ARN).</p>
100    pub fn get_migration_project_identifier(&self) -> &::std::option::Option<::std::string::String> {
101        self.inner.get_migration_project_identifier()
102    }
103    ///
104    /// Appends an item to `Filters`.
105    ///
106    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
107    ///
108    /// <p>Filters applied to the metadata model conversions described in the form of key-value pairs.</p>
109    pub fn filters(mut self, input: crate::types::Filter) -> Self {
110        self.inner = self.inner.filters(input);
111        self
112    }
113    /// <p>Filters applied to the metadata model conversions described in the form of key-value pairs.</p>
114    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
115        self.inner = self.inner.set_filters(input);
116        self
117    }
118    /// <p>Filters applied to the metadata model conversions described in the form of key-value pairs.</p>
119    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
120        self.inner.get_filters()
121    }
122    /// <p>Specifies the unique pagination token that makes it possible to display the next page of results. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
123    /// <p>If <code>Marker</code> is returned by a previous response, there are more results available. The value of <code>Marker</code> is a unique pagination token for each page. To retrieve the next page, make the call again using the returned token and keeping all other arguments unchanged.</p>
124    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.inner = self.inner.marker(input.into());
126        self
127    }
128    /// <p>Specifies the unique pagination token that makes it possible to display the next page of results. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
129    /// <p>If <code>Marker</code> is returned by a previous response, there are more results available. The value of <code>Marker</code> is a unique pagination token for each page. To retrieve the next page, make the call again using the returned token and keeping all other arguments unchanged.</p>
130    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_marker(input);
132        self
133    }
134    /// <p>Specifies the unique pagination token that makes it possible to display the next page of results. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by <code>MaxRecords</code>.</p>
135    /// <p>If <code>Marker</code> is returned by a previous response, there are more results available. The value of <code>Marker</code> is a unique pagination token for each page. To retrieve the next page, make the call again using the returned token and keeping all other arguments unchanged.</p>
136    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_marker()
138    }
139    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, DMS includes a pagination token in the response so that you can retrieve the remaining results.</p>
140    pub fn max_records(mut self, input: i32) -> Self {
141        self.inner = self.inner.max_records(input);
142        self
143    }
144    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, DMS includes a pagination token in the response so that you can retrieve the remaining results.</p>
145    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
146        self.inner = self.inner.set_max_records(input);
147        self
148    }
149    /// <p>The maximum number of records to include in the response. If more records exist than the specified <code>MaxRecords</code> value, DMS includes a pagination token in the response so that you can retrieve the remaining results.</p>
150    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
151        self.inner.get_max_records()
152    }
153}
154
155/// Successful return type for the `metadata_model_converted` waiter.
156pub type MetadataModelConvertedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
157    crate::operation::describe_metadata_model_conversions::DescribeMetadataModelConversionsOutput,
158    ::aws_smithy_runtime_api::client::result::SdkError<
159        crate::operation::describe_metadata_model_conversions::DescribeMetadataModelConversionsError,
160        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
161    >,
162>;
163
164/// Error type for the `metadata_model_converted` waiter.
165pub type WaitUntilMetadataModelConvertedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
166    crate::operation::describe_metadata_model_conversions::DescribeMetadataModelConversionsOutput,
167    crate::operation::describe_metadata_model_conversions::DescribeMetadataModelConversionsError,
168>;