aws_sdk_ssm/waiters/
command_executed.rs1#[derive(::std::clone::Clone, ::std::fmt::Debug)]
15pub struct CommandExecutedFluentBuilder {
16 handle: ::std::sync::Arc<crate::client::Handle>,
17 inner: crate::operation::get_command_invocation::builders::GetCommandInvocationInputBuilder,
18}
19impl CommandExecutedFluentBuilder {
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_command_invocation::builders::GetCommandInvocationInputBuilder {
29 &self.inner
30 }
31 pub async fn wait(
33 self,
34 max_wait: ::std::time::Duration,
35 ) -> ::std::result::Result<
36 crate::waiters::command_executed::CommandExecutedFinalPoll,
37 crate::waiters::command_executed::WaitUntilCommandExecutedError,
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_command_invocation::GetCommandInvocation::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::get_command_invocation::GetCommandInvocationOutput,
59 &crate::operation::get_command_invocation::GetCommandInvocationError,
60 >| {
61 if crate::waiters::matchers::match_get_command_invocation_6f9158f9231e5d6f7(result) {
63 return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
64 }
65 if crate::waiters::matchers::match_get_command_invocation_00bb09b3077ef8fe3(result) {
67 return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
68 }
69 if crate::waiters::matchers::match_get_command_invocation_af4f0e62bb4e2df8e(result) {
71 return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
72 }
73 if crate::waiters::matchers::match_get_command_invocation_1cbdfd792e1f604ca(result) {
75 return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
76 }
77 if crate::waiters::matchers::match_get_command_invocation_c1220f1751678bdb8(result) {
79 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
80 }
81 if crate::waiters::matchers::match_get_command_invocation_6566d5bc527202e21(result) {
83 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
84 }
85 if crate::waiters::matchers::match_get_command_invocation_74e589a66394e154b(result) {
87 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
88 }
89 if crate::waiters::matchers::match_get_command_invocation_f9ea517237b0ffd40(result) {
91 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
92 }
93 if crate::waiters::matchers::match_get_command_invocation_bbe7351a13d015aba(result) {
95 return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
96 }
97 ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
98 };
99 let operation = move || {
100 let input = input.clone();
101 let runtime_plugins = runtime_plugins.clone();
102 async move { crate::operation::get_command_invocation::GetCommandInvocation::orchestrate(&runtime_plugins, input).await }
103 };
104 let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
105 .min_delay(::std::time::Duration::from_secs(5))
106 .max_delay(::std::time::Duration::from_secs(120))
107 .max_wait(max_wait)
108 .time_source(time_source)
109 .sleep_impl(sleep_impl)
110 .acceptor(acceptor)
111 .operation(operation)
112 .build();
113 ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
114 }
115 pub fn command_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117 self.inner = self.inner.command_id(input.into());
118 self
119 }
120 pub fn set_command_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.inner = self.inner.set_command_id(input);
123 self
124 }
125 pub fn get_command_id(&self) -> &::std::option::Option<::std::string::String> {
127 self.inner.get_command_id()
128 }
129 pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.inner = self.inner.instance_id(input.into());
132 self
133 }
134 pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.inner = self.inner.set_instance_id(input);
137 self
138 }
139 pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
141 self.inner.get_instance_id()
142 }
143 pub fn plugin_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.inner = self.inner.plugin_name(input.into());
147 self
148 }
149 pub fn set_plugin_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152 self.inner = self.inner.set_plugin_name(input);
153 self
154 }
155 pub fn get_plugin_name(&self) -> &::std::option::Option<::std::string::String> {
158 self.inner.get_plugin_name()
159 }
160}
161
162pub type CommandExecutedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
164 crate::operation::get_command_invocation::GetCommandInvocationOutput,
165 ::aws_smithy_runtime_api::client::result::SdkError<
166 crate::operation::get_command_invocation::GetCommandInvocationError,
167 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
168 >,
169>;
170
171pub type WaitUntilCommandExecutedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
173 crate::operation::get_command_invocation::GetCommandInvocationOutput,
174 crate::operation::get_command_invocation::GetCommandInvocationError,
175>;