Skip to main content

aws_sdk_databasemigration/waiters/
metadata_model_exported_as_script.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `metadata_model_exported_as_script` 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 MetadataModelExportedAsScriptFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_metadata_model_exports_as_script::builders::DescribeMetadataModelExportsAsScriptInputBuilder,
18}
19impl MetadataModelExportedAsScriptFluentBuilder {
20    /// Creates a new `MetadataModelExportedAsScriptFluentBuilder`.
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 DescribeMetadataModelExportsAsScript as a reference.
28    pub fn as_input(
29        &self,
30    ) -> &crate::operation::describe_metadata_model_exports_as_script::builders::DescribeMetadataModelExportsAsScriptInputBuilder {
31        &self.inner
32    }
33    /// Wait until DMS metadata model is exported as script.
34    pub async fn wait(
35        self,
36        max_wait: ::std::time::Duration,
37    ) -> ::std::result::Result<
38        crate::waiters::metadata_model_exported_as_script::MetadataModelExportedAsScriptFinalPoll,
39        crate::waiters::metadata_model_exported_as_script::WaitUntilMetadataModelExportedAsScriptError,
40    > {
41        let input = self
42            .inner
43            .build()
44            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
45        let runtime_plugins =
46            crate::operation::describe_metadata_model_exports_as_script::DescribeMetadataModelExportsAsScript::operation_runtime_plugins(
47                self.handle.runtime_plugins.clone(),
48                &self.handle.conf,
49                ::std::option::Option::None,
50            )
51            .with_operation_plugin(crate::sdk_feature_tracker::waiter::WaiterFeatureTrackerRuntimePlugin::new());
52        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
53        let runtime_components_builder = runtime_plugins
54            .apply_client_configuration(&mut cfg)
55            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
56        let time_components = runtime_components_builder.into_time_components();
57        let sleep_impl = time_components.sleep_impl().expect("a sleep impl is required by waiters");
58        let time_source = time_components.time_source().expect("a time source is required by waiters");
59
60        let acceptor = move |result: ::std::result::Result<
61            &crate::operation::describe_metadata_model_exports_as_script::DescribeMetadataModelExportsAsScriptOutput,
62            &crate::operation::describe_metadata_model_exports_as_script::DescribeMetadataModelExportsAsScriptError,
63        >| {
64            // Matches: {"output":{"path":"Requests[].Status","expected":"SUCCESS","comparator":"allStringEquals"}}
65            if crate::waiters::matchers::match_describe_metadata_model_exports_as_script_6268be19bb3c45d7d(result) {
66                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
67            }
68            // Matches: {"output":{"path":"Requests[].Status","expected":"FAILED","comparator":"anyStringEquals"}}
69            if crate::waiters::matchers::match_describe_metadata_model_exports_as_script_dee355b6d23c355e3(result) {
70                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
71            }
72            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
73        };
74        let operation = move || {
75            let input = input.clone();
76            let runtime_plugins = runtime_plugins.clone();
77            async move {
78                crate::operation::describe_metadata_model_exports_as_script::DescribeMetadataModelExportsAsScript::orchestrate(
79                    &runtime_plugins,
80                    input,
81                )
82                .await
83            }
84        };
85        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
86            .min_delay(::std::time::Duration::from_secs(20))
87            .max_delay(::std::time::Duration::from_secs(120))
88            .max_wait(max_wait)
89            .time_source(time_source)
90            .sleep_impl(sleep_impl)
91            .acceptor(acceptor)
92            .operation(operation)
93            .build();
94        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
95    }
96    /// <p>The migration project name or Amazon Resource Name (ARN).</p>
97    pub fn migration_project_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.inner = self.inner.migration_project_identifier(input.into());
99        self
100    }
101    /// <p>The migration project name or Amazon Resource Name (ARN).</p>
102    pub fn set_migration_project_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.inner = self.inner.set_migration_project_identifier(input);
104        self
105    }
106    /// <p>The migration project name or Amazon Resource Name (ARN).</p>
107    pub fn get_migration_project_identifier(&self) -> &::std::option::Option<::std::string::String> {
108        self.inner.get_migration_project_identifier()
109    }
110    ///
111    /// Appends an item to `Filters`.
112    ///
113    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
114    ///
115    /// <p>Filters applied to the metadata model exports described in the form of key-value pairs.</p>
116    pub fn filters(mut self, input: crate::types::Filter) -> Self {
117        self.inner = self.inner.filters(input);
118        self
119    }
120    /// <p>Filters applied to the metadata model exports described in the form of key-value pairs.</p>
121    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
122        self.inner = self.inner.set_filters(input);
123        self
124    }
125    /// <p>Filters applied to the metadata model exports described in the form of key-value pairs.</p>
126    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
127        self.inner.get_filters()
128    }
129    /// <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>
130    /// <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>
131    pub fn marker(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.marker(input.into());
133        self
134    }
135    /// <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>
136    /// <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>
137    pub fn set_marker(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_marker(input);
139        self
140    }
141    /// <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>
142    /// <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>
143    pub fn get_marker(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_marker()
145    }
146    /// <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>
147    pub fn max_records(mut self, input: i32) -> Self {
148        self.inner = self.inner.max_records(input);
149        self
150    }
151    /// <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>
152    pub fn set_max_records(mut self, input: ::std::option::Option<i32>) -> Self {
153        self.inner = self.inner.set_max_records(input);
154        self
155    }
156    /// <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>
157    pub fn get_max_records(&self) -> &::std::option::Option<i32> {
158        self.inner.get_max_records()
159    }
160}
161
162/// Successful return type for the `metadata_model_exported_as_script` waiter.
163pub type MetadataModelExportedAsScriptFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
164    crate::operation::describe_metadata_model_exports_as_script::DescribeMetadataModelExportsAsScriptOutput,
165    ::aws_smithy_runtime_api::client::result::SdkError<
166        crate::operation::describe_metadata_model_exports_as_script::DescribeMetadataModelExportsAsScriptError,
167        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
168    >,
169>;
170
171/// Error type for the `metadata_model_exported_as_script` waiter.
172pub type WaitUntilMetadataModelExportedAsScriptError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
173    crate::operation::describe_metadata_model_exports_as_script::DescribeMetadataModelExportsAsScriptOutput,
174    crate::operation::describe_metadata_model_exports_as_script::DescribeMetadataModelExportsAsScriptError,
175>;