aws_sdk_medialive/waiters/
signal_map_monitor_deployed.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `signal_map_monitor_deployed` 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 SignalMapMonitorDeployedFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::get_signal_map::builders::GetSignalMapInputBuilder,
18}
19impl SignalMapMonitorDeployedFluentBuilder {
20    /// Creates a new `SignalMapMonitorDeployedFluentBuilder`.
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 GetSignalMap as a reference.
28    pub fn as_input(&self) -> &crate::operation::get_signal_map::builders::GetSignalMapInputBuilder {
29        &self.inner
30    }
31    /// Wait until a signal map's monitor has been deployed
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::signal_map_monitor_deployed::SignalMapMonitorDeployedFinalPoll,
37        crate::waiters::signal_map_monitor_deployed::WaitUntilSignalMapMonitorDeployedError,
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_signal_map::GetSignalMap::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_signal_map::GetSignalMapOutput,
59            &crate::operation::get_signal_map::GetSignalMapError,
60        >| {
61            // Matches: {"output":{"path":"MonitorDeployment.Status","expected":"DRY_RUN_DEPLOYMENT_COMPLETE","comparator":"stringEquals"}}
62            if crate::waiters::matchers::match_get_signal_map_37ac2c1c3bff11e11(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            // Matches: {"output":{"path":"MonitorDeployment.Status","expected":"DEPLOYMENT_COMPLETE","comparator":"stringEquals"}}
66            if crate::waiters::matchers::match_get_signal_map_2bba0822f48f2e4b7(result) {
67                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
68            }
69            // Matches: {"output":{"path":"MonitorDeployment.Status","expected":"DRY_RUN_DEPLOYMENT_IN_PROGRESS","comparator":"stringEquals"}}
70            if crate::waiters::matchers::match_get_signal_map_84ce42f94df967eaa(result) {
71                return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
72            }
73            // Matches: {"output":{"path":"MonitorDeployment.Status","expected":"DEPLOYMENT_IN_PROGRESS","comparator":"stringEquals"}}
74            if crate::waiters::matchers::match_get_signal_map_a1a4b253b0344e3c2(result) {
75                return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
76            }
77            // Matches: {"output":{"path":"MonitorDeployment.Status","expected":"DRY_RUN_DEPLOYMENT_FAILED","comparator":"stringEquals"}}
78            if crate::waiters::matchers::match_get_signal_map_b43e22c14edb507f5(result) {
79                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
80            }
81            // Matches: {"output":{"path":"MonitorDeployment.Status","expected":"DEPLOYMENT_FAILED","comparator":"stringEquals"}}
82            if crate::waiters::matchers::match_get_signal_map_5a9dc9d12b328f5b7(result) {
83                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
84            }
85            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
86        };
87        let operation = move || {
88            let input = input.clone();
89            let runtime_plugins = runtime_plugins.clone();
90            async move { crate::operation::get_signal_map::GetSignalMap::orchestrate(&runtime_plugins, input).await }
91        };
92        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
93            .min_delay(::std::time::Duration::from_secs(5))
94            .max_delay(::std::time::Duration::from_secs(120))
95            .max_wait(max_wait)
96            .time_source(time_source)
97            .sleep_impl(sleep_impl)
98            .acceptor(acceptor)
99            .operation(operation)
100            .build();
101        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
102    }
103    /// A signal map's identifier. Can be either be its id or current name.
104    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.inner = self.inner.identifier(input.into());
106        self
107    }
108    /// A signal map's identifier. Can be either be its id or current name.
109    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.inner = self.inner.set_identifier(input);
111        self
112    }
113    /// A signal map's identifier. Can be either be its id or current name.
114    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
115        self.inner.get_identifier()
116    }
117}
118
119/// Successful return type for the `signal_map_monitor_deployed` waiter.
120pub type SignalMapMonitorDeployedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
121    crate::operation::get_signal_map::GetSignalMapOutput,
122    ::aws_smithy_runtime_api::client::result::SdkError<
123        crate::operation::get_signal_map::GetSignalMapError,
124        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
125    >,
126>;
127
128/// Error type for the `signal_map_monitor_deployed` waiter.
129pub type WaitUntilSignalMapMonitorDeployedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
130    crate::operation::get_signal_map::GetSignalMapOutput,
131    crate::operation::get_signal_map::GetSignalMapError,
132>;