aws_sdk_lexmodelsv2/waiters/
bot_version_available.rs1#[derive(::std::clone::Clone, ::std::fmt::Debug)]
15pub struct BotVersionAvailableFluentBuilder {
16 handle: ::std::sync::Arc<crate::client::Handle>,
17 inner: crate::operation::describe_bot_version::builders::DescribeBotVersionInputBuilder,
18}
19impl BotVersionAvailableFluentBuilder {
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::describe_bot_version::builders::DescribeBotVersionInputBuilder {
29 &self.inner
30 }
31 pub async fn wait(
33 self,
34 max_wait: ::std::time::Duration,
35 ) -> ::std::result::Result<
36 crate::waiters::bot_version_available::BotVersionAvailableFinalPoll,
37 crate::waiters::bot_version_available::WaitUntilBotVersionAvailableError,
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_bot_version::DescribeBotVersion::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_bot_version::DescribeBotVersionOutput,
59 &crate::operation::describe_bot_version::DescribeBotVersionError,
60 >| {
61 if crate::waiters::matchers::match_describe_bot_version_b02179601eb168096(result) {
63 return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64 }
65 if crate::waiters::matchers::match_describe_bot_version_43ee2b959d4054721(result) {
67 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
68 }
69 if crate::waiters::matchers::match_describe_bot_version_3af10a50de73812c2(result) {
71 return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
72 }
73 if crate::waiters::matchers::match_describe_bot_version_1cce2c05524fb92d4(result) {
75 return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
76 }
77 ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
78 };
79 let operation = move || {
80 let input = input.clone();
81 let runtime_plugins = runtime_plugins.clone();
82 async move { crate::operation::describe_bot_version::DescribeBotVersion::orchestrate(&runtime_plugins, input).await }
83 };
84 let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
85 .min_delay(::std::time::Duration::from_secs(10))
86 .max_delay(::std::time::Duration::from_secs(120))
87 .max_wait(max_wait)
88 .time_source(time_source)
89 .sleep_impl(sleep_impl)
90 .acceptor(acceptor)
91 .operation(operation)
92 .build();
93 ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
94 }
95 pub fn bot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97 self.inner = self.inner.bot_id(input.into());
98 self
99 }
100 pub fn set_bot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102 self.inner = self.inner.set_bot_id(input);
103 self
104 }
105 pub fn get_bot_id(&self) -> &::std::option::Option<::std::string::String> {
107 self.inner.get_bot_id()
108 }
109 pub fn bot_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111 self.inner = self.inner.bot_version(input.into());
112 self
113 }
114 pub fn set_bot_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.inner = self.inner.set_bot_version(input);
117 self
118 }
119 pub fn get_bot_version(&self) -> &::std::option::Option<::std::string::String> {
121 self.inner.get_bot_version()
122 }
123}
124
125pub type BotVersionAvailableFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
127 crate::operation::describe_bot_version::DescribeBotVersionOutput,
128 ::aws_smithy_runtime_api::client::result::SdkError<
129 crate::operation::describe_bot_version::DescribeBotVersionError,
130 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
131 >,
132>;
133
134pub type WaitUntilBotVersionAvailableError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
136 crate::operation::describe_bot_version::DescribeBotVersionOutput,
137 crate::operation::describe_bot_version::DescribeBotVersionError,
138>;