aws_sdk_repostspace/waiters/
channel_created.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `channel_created` 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 ChannelCreatedFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::get_channel::builders::GetChannelInputBuilder,
18}
19impl ChannelCreatedFluentBuilder {
20    /// Creates a new `ChannelCreatedFluentBuilder`.
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 GetChannel as a reference.
28    pub fn as_input(&self) -> &crate::operation::get_channel::builders::GetChannelInputBuilder {
29        &self.inner
30    }
31    /// Wait for `channel_created`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<crate::waiters::channel_created::ChannelCreatedFinalPoll, crate::waiters::channel_created::WaitUntilChannelCreatedError>
36    {
37        let input = self
38            .inner
39            .build()
40            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
41        let runtime_plugins = crate::operation::get_channel::GetChannel::operation_runtime_plugins(
42            self.handle.runtime_plugins.clone(),
43            &self.handle.conf,
44            ::std::option::Option::None,
45        )
46        .with_operation_plugin(crate::sdk_feature_tracker::waiter::WaiterFeatureTrackerRuntimePlugin::new());
47        let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base();
48        let runtime_components_builder = runtime_plugins
49            .apply_client_configuration(&mut cfg)
50            .map_err(::aws_smithy_runtime_api::client::waiters::error::WaiterError::construction_failure)?;
51        let time_components = runtime_components_builder.into_time_components();
52        let sleep_impl = time_components.sleep_impl().expect("a sleep impl is required by waiters");
53        let time_source = time_components.time_source().expect("a time source is required by waiters");
54
55        let acceptor = move |result: ::std::result::Result<
56            &crate::operation::get_channel::GetChannelOutput,
57            &crate::operation::get_channel::GetChannelError,
58        >| {
59            // Matches: {"output":{"path":"channelStatus","expected":"CREATED","comparator":"stringEquals"}}
60            if crate::waiters::matchers::match_get_channel_e8b5d995c3c3ce357(result) {
61                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
62            }
63            // Matches: {"output":{"path":"channelStatus","expected":"CREATE_FAILED","comparator":"stringEquals"}}
64            if crate::waiters::matchers::match_get_channel_6ffac86663d1811db(result) {
65                return ::aws_smithy_runtime::client::waiters::AcceptorState::Failure;
66            }
67            // Matches: {"output":{"path":"channelStatus","expected":"CREATING","comparator":"stringEquals"}}
68            if crate::waiters::matchers::match_get_channel_63429972c1ba2a686(result) {
69                return ::aws_smithy_runtime::client::waiters::AcceptorState::Retry;
70            }
71            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
72        };
73        let operation = move || {
74            let input = input.clone();
75            let runtime_plugins = runtime_plugins.clone();
76            async move { crate::operation::get_channel::GetChannel::orchestrate(&runtime_plugins, input).await }
77        };
78        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
79            .min_delay(::std::time::Duration::from_secs(2))
80            .max_delay(::std::time::Duration::from_secs(120))
81            .max_wait(max_wait)
82            .time_source(time_source)
83            .sleep_impl(sleep_impl)
84            .acceptor(acceptor)
85            .operation(operation)
86            .build();
87        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
88    }
89    /// <p>The unique ID of the private re:Post.</p>
90    pub fn space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.inner = self.inner.space_id(input.into());
92        self
93    }
94    /// <p>The unique ID of the private re:Post.</p>
95    pub fn set_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.inner = self.inner.set_space_id(input);
97        self
98    }
99    /// <p>The unique ID of the private re:Post.</p>
100    pub fn get_space_id(&self) -> &::std::option::Option<::std::string::String> {
101        self.inner.get_space_id()
102    }
103    /// <p>The unique ID of the private re:Post channel.</p>
104    pub fn channel_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.inner = self.inner.channel_id(input.into());
106        self
107    }
108    /// <p>The unique ID of the private re:Post channel.</p>
109    pub fn set_channel_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.inner = self.inner.set_channel_id(input);
111        self
112    }
113    /// <p>The unique ID of the private re:Post channel.</p>
114    pub fn get_channel_id(&self) -> &::std::option::Option<::std::string::String> {
115        self.inner.get_channel_id()
116    }
117}
118
119/// Successful return type for the `channel_created` waiter.
120pub type ChannelCreatedFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
121    crate::operation::get_channel::GetChannelOutput,
122    ::aws_smithy_runtime_api::client::result::SdkError<
123        crate::operation::get_channel::GetChannelError,
124        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
125    >,
126>;
127
128/// Error type for the `channel_created` waiter.
129pub type WaitUntilChannelCreatedError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
130    crate::operation::get_channel::GetChannelOutput,
131    crate::operation::get_channel::GetChannelError,
132>;