aws_sdk_machinelearning/waiters/
data_source_available.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `data_source_available` 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 DataSourceAvailableFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_data_sources::builders::DescribeDataSourcesInputBuilder,
18}
19impl DataSourceAvailableFluentBuilder {
20    /// Creates a new `DataSourceAvailableFluentBuilder`.
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 DescribeDataSources as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_data_sources::builders::DescribeDataSourcesInputBuilder {
29        &self.inner
30    }
31    /// Wait for `data_source_available`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::data_source_available::DataSourceAvailableFinalPoll,
37        crate::waiters::data_source_available::WaitUntilDataSourceAvailableError,
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_data_sources::DescribeDataSources::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_data_sources::DescribeDataSourcesOutput,
59            &crate::operation::describe_data_sources::DescribeDataSourcesError,
60        >| {
61            // Matches: {"output":{"path":"Results[].Status","expected":"COMPLETED","comparator":"allStringEquals"}}
62            if crate::waiters::matchers::match_describe_data_sources_147c4749b8435ead2(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"output":{"path":"Results[].Status","expected":"FAILED","comparator":"anyStringEquals"}}
66            if crate::waiters::matchers::match_describe_data_sources_772ab1725e6b52e57(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 { crate::operation::describe_data_sources::DescribeDataSources::orchestrate(&runtime_plugins, input).await }
75        };
76        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
77            .min_delay(::std::time::Duration::from_secs(30))
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    /// <p>Use one of the following variables to filter a list of <code>DataSource</code>:</p>
88    /// <ul>
89    /// <li>
90    /// <p><code>CreatedAt</code> - Sets the search criteria to <code>DataSource</code> creation dates.</p></li>
91    /// <li>
92    /// <p><code>Status</code> - Sets the search criteria to <code>DataSource</code> statuses.</p></li>
93    /// <li>
94    /// <p><code>Name</code> - Sets the search criteria to the contents of <code>DataSource</code> <code>Name</code>.</p></li>
95    /// <li>
96    /// <p><code>DataUri</code> - Sets the search criteria to the URI of data files used to create the <code>DataSource</code>. The URI can identify either a file or an Amazon Simple Storage Service (Amazon S3) bucket or directory.</p></li>
97    /// <li>
98    /// <p><code>IAMUser</code> - Sets the search criteria to the user account that invoked the <code>DataSource</code> creation.</p></li>
99    /// </ul>
100    pub fn filter_variable(mut self, input: crate::types::DataSourceFilterVariable) -> Self {
101        self.inner = self.inner.filter_variable(input);
102        self
103    }
104    /// <p>Use one of the following variables to filter a list of <code>DataSource</code>:</p>
105    /// <ul>
106    /// <li>
107    /// <p><code>CreatedAt</code> - Sets the search criteria to <code>DataSource</code> creation dates.</p></li>
108    /// <li>
109    /// <p><code>Status</code> - Sets the search criteria to <code>DataSource</code> statuses.</p></li>
110    /// <li>
111    /// <p><code>Name</code> - Sets the search criteria to the contents of <code>DataSource</code> <code>Name</code>.</p></li>
112    /// <li>
113    /// <p><code>DataUri</code> - Sets the search criteria to the URI of data files used to create the <code>DataSource</code>. The URI can identify either a file or an Amazon Simple Storage Service (Amazon S3) bucket or directory.</p></li>
114    /// <li>
115    /// <p><code>IAMUser</code> - Sets the search criteria to the user account that invoked the <code>DataSource</code> creation.</p></li>
116    /// </ul>
117    pub fn set_filter_variable(mut self, input: ::std::option::Option<crate::types::DataSourceFilterVariable>) -> Self {
118        self.inner = self.inner.set_filter_variable(input);
119        self
120    }
121    /// <p>Use one of the following variables to filter a list of <code>DataSource</code>:</p>
122    /// <ul>
123    /// <li>
124    /// <p><code>CreatedAt</code> - Sets the search criteria to <code>DataSource</code> creation dates.</p></li>
125    /// <li>
126    /// <p><code>Status</code> - Sets the search criteria to <code>DataSource</code> statuses.</p></li>
127    /// <li>
128    /// <p><code>Name</code> - Sets the search criteria to the contents of <code>DataSource</code> <code>Name</code>.</p></li>
129    /// <li>
130    /// <p><code>DataUri</code> - Sets the search criteria to the URI of data files used to create the <code>DataSource</code>. The URI can identify either a file or an Amazon Simple Storage Service (Amazon S3) bucket or directory.</p></li>
131    /// <li>
132    /// <p><code>IAMUser</code> - Sets the search criteria to the user account that invoked the <code>DataSource</code> creation.</p></li>
133    /// </ul>
134    pub fn get_filter_variable(&self) -> &::std::option::Option<crate::types::DataSourceFilterVariable> {
135        self.inner.get_filter_variable()
136    }
137    /// <p>The equal to operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that exactly match the value specified with <code>EQ</code>.</p>
138    pub fn eq(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.eq(input.into());
140        self
141    }
142    /// <p>The equal to operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that exactly match the value specified with <code>EQ</code>.</p>
143    pub fn set_eq(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.inner = self.inner.set_eq(input);
145        self
146    }
147    /// <p>The equal to operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that exactly match the value specified with <code>EQ</code>.</p>
148    pub fn get_eq(&self) -> &::std::option::Option<::std::string::String> {
149        self.inner.get_eq()
150    }
151    /// <p>The greater than operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that are greater than the value specified with <code>GT</code>.</p>
152    pub fn gt(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.gt(input.into());
154        self
155    }
156    /// <p>The greater than operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that are greater than the value specified with <code>GT</code>.</p>
157    pub fn set_gt(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.inner = self.inner.set_gt(input);
159        self
160    }
161    /// <p>The greater than operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that are greater than the value specified with <code>GT</code>.</p>
162    pub fn get_gt(&self) -> &::std::option::Option<::std::string::String> {
163        self.inner.get_gt()
164    }
165    /// <p>The less than operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that are less than the value specified with <code>LT</code>.</p>
166    pub fn lt(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.inner = self.inner.lt(input.into());
168        self
169    }
170    /// <p>The less than operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that are less than the value specified with <code>LT</code>.</p>
171    pub fn set_lt(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.inner = self.inner.set_lt(input);
173        self
174    }
175    /// <p>The less than operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that are less than the value specified with <code>LT</code>.</p>
176    pub fn get_lt(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_lt()
178    }
179    /// <p>The greater than or equal to operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that are greater than or equal to the value specified with <code>GE</code>.</p>
180    pub fn ge(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181        self.inner = self.inner.ge(input.into());
182        self
183    }
184    /// <p>The greater than or equal to operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that are greater than or equal to the value specified with <code>GE</code>.</p>
185    pub fn set_ge(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.inner = self.inner.set_ge(input);
187        self
188    }
189    /// <p>The greater than or equal to operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that are greater than or equal to the value specified with <code>GE</code>.</p>
190    pub fn get_ge(&self) -> &::std::option::Option<::std::string::String> {
191        self.inner.get_ge()
192    }
193    /// <p>The less than or equal to operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that are less than or equal to the value specified with <code>LE</code>.</p>
194    pub fn le(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195        self.inner = self.inner.le(input.into());
196        self
197    }
198    /// <p>The less than or equal to operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that are less than or equal to the value specified with <code>LE</code>.</p>
199    pub fn set_le(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
200        self.inner = self.inner.set_le(input);
201        self
202    }
203    /// <p>The less than or equal to operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values that are less than or equal to the value specified with <code>LE</code>.</p>
204    pub fn get_le(&self) -> &::std::option::Option<::std::string::String> {
205        self.inner.get_le()
206    }
207    /// <p>The not equal to operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values not equal to the value specified with <code>NE</code>.</p>
208    pub fn ne(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
209        self.inner = self.inner.ne(input.into());
210        self
211    }
212    /// <p>The not equal to operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values not equal to the value specified with <code>NE</code>.</p>
213    pub fn set_ne(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
214        self.inner = self.inner.set_ne(input);
215        self
216    }
217    /// <p>The not equal to operator. The <code>DataSource</code> results will have <code>FilterVariable</code> values not equal to the value specified with <code>NE</code>.</p>
218    pub fn get_ne(&self) -> &::std::option::Option<::std::string::String> {
219        self.inner.get_ne()
220    }
221    /// <p>A string that is found at the beginning of a variable, such as <code>Name</code> or <code>Id</code>.</p>
222    /// <p>For example, a <code>DataSource</code> could have the <code>Name</code> <code>2014-09-09-HolidayGiftMailer</code>. To search for this <code>DataSource</code>, select <code>Name</code> for the <code>FilterVariable</code> and any of the following strings for the <code>Prefix</code>:</p>
223    /// <ul>
224    /// <li>
225    /// <p>2014-09</p></li>
226    /// <li>
227    /// <p>2014-09-09</p></li>
228    /// <li>
229    /// <p>2014-09-09-Holiday</p></li>
230    /// </ul>
231    pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232        self.inner = self.inner.prefix(input.into());
233        self
234    }
235    /// <p>A string that is found at the beginning of a variable, such as <code>Name</code> or <code>Id</code>.</p>
236    /// <p>For example, a <code>DataSource</code> could have the <code>Name</code> <code>2014-09-09-HolidayGiftMailer</code>. To search for this <code>DataSource</code>, select <code>Name</code> for the <code>FilterVariable</code> and any of the following strings for the <code>Prefix</code>:</p>
237    /// <ul>
238    /// <li>
239    /// <p>2014-09</p></li>
240    /// <li>
241    /// <p>2014-09-09</p></li>
242    /// <li>
243    /// <p>2014-09-09-Holiday</p></li>
244    /// </ul>
245    pub fn set_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
246        self.inner = self.inner.set_prefix(input);
247        self
248    }
249    /// <p>A string that is found at the beginning of a variable, such as <code>Name</code> or <code>Id</code>.</p>
250    /// <p>For example, a <code>DataSource</code> could have the <code>Name</code> <code>2014-09-09-HolidayGiftMailer</code>. To search for this <code>DataSource</code>, select <code>Name</code> for the <code>FilterVariable</code> and any of the following strings for the <code>Prefix</code>:</p>
251    /// <ul>
252    /// <li>
253    /// <p>2014-09</p></li>
254    /// <li>
255    /// <p>2014-09-09</p></li>
256    /// <li>
257    /// <p>2014-09-09-Holiday</p></li>
258    /// </ul>
259    pub fn get_prefix(&self) -> &::std::option::Option<::std::string::String> {
260        self.inner.get_prefix()
261    }
262    /// <p>A two-value parameter that determines the sequence of the resulting list of <code>DataSource</code>.</p>
263    /// <ul>
264    /// <li>
265    /// <p><code>asc</code> - Arranges the list in ascending order (A-Z, 0-9).</p></li>
266    /// <li>
267    /// <p><code>dsc</code> - Arranges the list in descending order (Z-A, 9-0).</p></li>
268    /// </ul>
269    /// <p>Results are sorted by <code>FilterVariable</code>.</p>
270    pub fn sort_order(mut self, input: crate::types::SortOrder) -> Self {
271        self.inner = self.inner.sort_order(input);
272        self
273    }
274    /// <p>A two-value parameter that determines the sequence of the resulting list of <code>DataSource</code>.</p>
275    /// <ul>
276    /// <li>
277    /// <p><code>asc</code> - Arranges the list in ascending order (A-Z, 0-9).</p></li>
278    /// <li>
279    /// <p><code>dsc</code> - Arranges the list in descending order (Z-A, 9-0).</p></li>
280    /// </ul>
281    /// <p>Results are sorted by <code>FilterVariable</code>.</p>
282    pub fn set_sort_order(mut self, input: ::std::option::Option<crate::types::SortOrder>) -> Self {
283        self.inner = self.inner.set_sort_order(input);
284        self
285    }
286    /// <p>A two-value parameter that determines the sequence of the resulting list of <code>DataSource</code>.</p>
287    /// <ul>
288    /// <li>
289    /// <p><code>asc</code> - Arranges the list in ascending order (A-Z, 0-9).</p></li>
290    /// <li>
291    /// <p><code>dsc</code> - Arranges the list in descending order (Z-A, 9-0).</p></li>
292    /// </ul>
293    /// <p>Results are sorted by <code>FilterVariable</code>.</p>
294    pub fn get_sort_order(&self) -> &::std::option::Option<crate::types::SortOrder> {
295        self.inner.get_sort_order()
296    }
297    /// <p>The ID of the page in the paginated results.</p>
298    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
299        self.inner = self.inner.next_token(input.into());
300        self
301    }
302    /// <p>The ID of the page in the paginated results.</p>
303    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
304        self.inner = self.inner.set_next_token(input);
305        self
306    }
307    /// <p>The ID of the page in the paginated results.</p>
308    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
309        self.inner.get_next_token()
310    }
311    /// <p>The maximum number of <code>DataSource</code> to include in the result.</p>
312    pub fn limit(mut self, input: i32) -> Self {
313        self.inner = self.inner.limit(input);
314        self
315    }
316    /// <p>The maximum number of <code>DataSource</code> to include in the result.</p>
317    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
318        self.inner = self.inner.set_limit(input);
319        self
320    }
321    /// <p>The maximum number of <code>DataSource</code> to include in the result.</p>
322    pub fn get_limit(&self) -> &::std::option::Option<i32> {
323        self.inner.get_limit()
324    }
325}
326
327/// Successful return type for the `data_source_available` waiter.
328pub type DataSourceAvailableFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
329    crate::operation::describe_data_sources::DescribeDataSourcesOutput,
330    ::aws_smithy_runtime_api::client::result::SdkError<
331        crate::operation::describe_data_sources::DescribeDataSourcesError,
332        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
333    >,
334>;
335
336/// Error type for the `data_source_available` waiter.
337pub type WaitUntilDataSourceAvailableError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
338    crate::operation::describe_data_sources::DescribeDataSourcesOutput,
339    crate::operation::describe_data_sources::DescribeDataSourcesError,
340>;