aws_sdk_deadline/waiters/
queue_scheduling.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `queue_scheduling` 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 QueueSchedulingFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::get_queue::builders::GetQueueInputBuilder,
18}
19impl QueueSchedulingFluentBuilder {
20    /// Creates a new `QueueSchedulingFluentBuilder`.
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 GetQueue as a reference.
28    pub fn as_input(&self) -> &crate::operation::get_queue::builders::GetQueueInputBuilder {
29        &self.inner
30    }
31    /// Wait for `queue_scheduling`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::queue_scheduling::QueueSchedulingFinalPoll,
37        crate::waiters::queue_scheduling::WaitUntilQueueSchedulingError,
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_queue::GetQueue::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 =
58            move |result: ::std::result::Result<&crate::operation::get_queue::GetQueueOutput, &crate::operation::get_queue::GetQueueError>| {
59                // Matches: {"output":{"path":"status","expected":"SCHEDULING","comparator":"stringEquals"}}
60                if crate::waiters::matchers::match_get_queue_ddf7808bf46fc982c(result) {
61                    return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
62                }
63                ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
64            };
65        let operation = move || {
66            let input = input.clone();
67            let runtime_plugins = runtime_plugins.clone();
68            async move { crate::operation::get_queue::GetQueue::orchestrate(&runtime_plugins, input).await }
69        };
70        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
71            .min_delay(::std::time::Duration::from_secs(10))
72            .max_delay(::std::time::Duration::from_secs(700))
73            .max_wait(max_wait)
74            .time_source(time_source)
75            .sleep_impl(sleep_impl)
76            .acceptor(acceptor)
77            .operation(operation)
78            .build();
79        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
80    }
81    /// <p>The farm ID of the farm in the queue.</p>
82    pub fn farm_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.inner = self.inner.farm_id(input.into());
84        self
85    }
86    /// <p>The farm ID of the farm in the queue.</p>
87    pub fn set_farm_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.inner = self.inner.set_farm_id(input);
89        self
90    }
91    /// <p>The farm ID of the farm in the queue.</p>
92    pub fn get_farm_id(&self) -> &::std::option::Option<::std::string::String> {
93        self.inner.get_farm_id()
94    }
95    /// <p>The queue ID for the queue to retrieve.</p>
96    pub fn queue_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.inner = self.inner.queue_id(input.into());
98        self
99    }
100    /// <p>The queue ID for the queue to retrieve.</p>
101    pub fn set_queue_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.inner = self.inner.set_queue_id(input);
103        self
104    }
105    /// <p>The queue ID for the queue to retrieve.</p>
106    pub fn get_queue_id(&self) -> &::std::option::Option<::std::string::String> {
107        self.inner.get_queue_id()
108    }
109}
110
111/// Successful return type for the `queue_scheduling` waiter.
112pub type QueueSchedulingFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
113    crate::operation::get_queue::GetQueueOutput,
114    ::aws_smithy_runtime_api::client::result::SdkError<
115        crate::operation::get_queue::GetQueueError,
116        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
117    >,
118>;
119
120/// Error type for the `queue_scheduling` waiter.
121pub type WaitUntilQueueSchedulingError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
122    crate::operation::get_queue::GetQueueOutput,
123    crate::operation::get_queue::GetQueueError,
124>;