aws_sdk_deadline/waiters/
job_create_complete.rs1#[derive(::std::clone::Clone, ::std::fmt::Debug)]
15pub struct JobCreateCompleteFluentBuilder {
16 handle: ::std::sync::Arc<crate::client::Handle>,
17 inner: crate::operation::get_job::builders::GetJobInputBuilder,
18}
19impl JobCreateCompleteFluentBuilder {
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_job::builders::GetJobInputBuilder {
29 &self.inner
30 }
31 pub async fn wait(
33 self,
34 max_wait: ::std::time::Duration,
35 ) -> ::std::result::Result<
36 crate::waiters::job_create_complete::JobCreateCompleteFinalPoll,
37 crate::waiters::job_create_complete::WaitUntilJobCreateCompleteError,
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::get_job::GetJob::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<&crate::operation::get_job::GetJobOutput, &crate::operation::get_job::GetJobError>| {
58 if crate::waiters::matchers::match_get_job_2307992268de7b47c(result) {
60 return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
61 }
62 if crate::waiters::matchers::match_get_job_eb68ae5b6fba1fafd(result) {
64 return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
65 }
66 if crate::waiters::matchers::match_get_job_435a1147a3fcbc7a2(result) {
68 return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
69 }
70 if crate::waiters::matchers::match_get_job_78c97fb68ef47d336(result) {
72 return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
73 }
74 if crate::waiters::matchers::match_get_job_1c445702e42811f6c(result) {
76 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
77 }
78 if crate::waiters::matchers::match_get_job_2d46005885959b4a4(result) {
80 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
81 }
82 ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
83 };
84 let operation = move || {
85 let input = input.clone();
86 let runtime_plugins = runtime_plugins.clone();
87 async move { crate::operation::get_job::GetJob::orchestrate(&runtime_plugins, input).await }
88 };
89 let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
90 .min_delay(::std::time::Duration::from_secs(1))
91 .max_delay(::std::time::Duration::from_secs(120))
92 .max_wait(max_wait)
93 .time_source(time_source)
94 .sleep_impl(sleep_impl)
95 .acceptor(acceptor)
96 .operation(operation)
97 .build();
98 ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
99 }
100 pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102 self.inner = self.inner.farm_id(input.into());
103 self
104 }
105 pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107 self.inner = self.inner.set_farm_id(input);
108 self
109 }
110 pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
112 self.inner.get_farm_id()
113 }
114 pub fn queue_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.queue_id(input.into());
117 self
118 }
119 pub fn set_queue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_queue_id(input);
122 self
123 }
124 pub fn get_queue_id(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_queue_id()
127 }
128 pub fn job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.inner = self.inner.job_id(input.into());
131 self
132 }
133 pub fn set_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.inner = self.inner.set_job_id(input);
136 self
137 }
138 pub fn get_job_id(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_job_id()
141 }
142}
143
144pub type JobCreateCompleteFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
146 crate::operation::get_job::GetJobOutput,
147 ::aws_smithy_runtime_api::client::result::SdkError<
148 crate::operation::get_job::GetJobError,
149 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
150 >,
151>;
152
153pub type WaitUntilJobCreateCompleteError =
155 ::aws_smithy_runtime_api::client::waiters::error::WaiterError<crate::operation::get_job::GetJobOutput, crate::operation::get_job::GetJobError>;