aws_sdk_omics/waiters/
task_completed.rs1#[derive(::std::clone::Clone, ::std::fmt::Debug)]
15pub struct TaskCompletedFluentBuilder {
16 handle: ::std::sync::Arc<crate::client::Handle>,
17 inner: crate::operation::get_run_task::builders::GetRunTaskInputBuilder,
18}
19impl TaskCompletedFluentBuilder {
20 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 pub fn as_input(&self) -> &crate::operation::get_run_task::builders::GetRunTaskInputBuilder {
29 &self.inner
30 }
31 pub async fn wait(
33 self,
34 max_wait: ::std::time::Duration,
35 ) -> ::std::result::Result<crate::waiters::task_completed::TaskCompletedFinalPoll, crate::waiters::task_completed::WaitUntilTaskCompletedError>
36 {
37 let input = self
38 .inner
39 .build()
40 .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
41 let runtime_plugins = crate::operation::get_run_task::GetRunTask::operation_runtime_plugins(
42 self.handle.runtime_plugins.clone(),
43 &self.handle.conf,
44 ::std::option::Option::None,
45 )
46 .with_operation_plugin(crate::sdk_feature_tracker::waiter::WaiterFeatureTrackerRuntimePlugin::new());
47 let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
48 let runtime_components_builder = runtime_plugins
49 .apply_client_configuration(&mut cfg)
50 .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
51 let time_components = runtime_components_builder.into_time_components();
52 let sleep_impl = time_components.sleep_impl().expect("a sleep impl is required by waiters");
53 let time_source = time_components.time_source().expect("a time source is required by waiters");
54
55 let acceptor = move |result: ::std::result::Result<
56 &crate::operation::get_run_task::GetRunTaskOutput,
57 &crate::operation::get_run_task::GetRunTaskError,
58 >| {
59 if crate::waiters::matchers::match_get_run_task_861efe6eafdf84171(result) {
61 return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
62 }
63 if crate::waiters::matchers::match_get_run_task_cf7012a6288344f38(result) {
65 return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
66 }
67 if crate::waiters::matchers::match_get_run_task_52681d39a0a9cabe6(result) {
69 return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
70 }
71 if crate::waiters::matchers::match_get_run_task_7943b3b995e719e2c(result) {
73 return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
74 }
75 if crate::waiters::matchers::match_get_run_task_824819fe20f7c07ec(result) {
77 return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
78 }
79 if crate::waiters::matchers::match_get_run_task_f9c483f08ce8cb218(result) {
81 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
82 }
83 ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
84 };
85 let operation = move || {
86 let input = input.clone();
87 let runtime_plugins = runtime_plugins.clone();
88 async move { crate::operation::get_run_task::GetRunTask::orchestrate(&runtime_plugins, input).await }
89 };
90 let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
91 .min_delay(::std::time::Duration::from_secs(30))
92 .max_delay(::std::time::Duration::from_secs(600))
93 .max_wait(max_wait)
94 .time_source(time_source)
95 .sleep_impl(sleep_impl)
96 .acceptor(acceptor)
97 .operation(operation)
98 .build();
99 ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
100 }
101 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.inner = self.inner.id(input.into());
104 self
105 }
106 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.inner = self.inner.set_id(input);
109 self
110 }
111 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
113 self.inner.get_id()
114 }
115 pub fn task_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117 self.inner = self.inner.task_id(input.into());
118 self
119 }
120 pub fn set_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.inner = self.inner.set_task_id(input);
123 self
124 }
125 pub fn get_task_id(&self) -> &::std::option::Option<::std::string::String> {
127 self.inner.get_task_id()
128 }
129}
130
131pub type TaskCompletedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
133 crate::operation::get_run_task::GetRunTaskOutput,
134 ::aws_smithy_runtime_api::client::result::SdkError<
135 crate::operation::get_run_task::GetRunTaskError,
136 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
137 >,
138>;
139
140pub type WaitUntilTaskCompletedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
142 crate::operation::get_run_task::GetRunTaskOutput,
143 crate::operation::get_run_task::GetRunTaskError,
144>;