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