aws_sdk_kinesis/waiters/
stream_not_exists.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3///
4/// Fluent builder for the `stream_not_exists` 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 StreamNotExistsFluentBuilder {
16    handle: ::std::sync::Arc<crate::client::Handle>,
17    inner: crate::operation::describe_stream::builders::DescribeStreamInputBuilder,
18}
19impl StreamNotExistsFluentBuilder {
20    /// Creates a new `StreamNotExistsFluentBuilder`.
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 DescribeStream as a reference.
28    pub fn as_input(&self) -> &crate::operation::describe_stream::builders::DescribeStreamInputBuilder {
29        &self.inner
30    }
31    /// Wait for `stream_not_exists`
32    pub async fn wait(
33        self,
34        max_wait: ::std::time::Duration,
35    ) -> ::std::result::Result<
36        crate::waiters::stream_not_exists::StreamNotExistsFinalPoll,
37        crate::waiters::stream_not_exists::WaitUntilStreamNotExistsError,
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_stream::DescribeStream::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_stream::DescribeStreamOutput,
59            &crate::operation::describe_stream::DescribeStreamError,
60        >| {
61            // Matches: {"errorType":"ResourceNotFoundException"}
62            if crate::waiters::matchers::match_describe_stream_1cce2c05524fb92d4(result) {
63                return ::aws_smithy_runtime::client::waiters::AcceptorState::Success;
64            }
65            ::aws_smithy_runtime::client::waiters::AcceptorState::NoAcceptorsMatched
66        };
67        let operation = move || {
68            let input = input.clone();
69            let runtime_plugins = runtime_plugins.clone();
70            async move { crate::operation::describe_stream::DescribeStream::orchestrate(&runtime_plugins, input).await }
71        };
72        let orchestrator = ::aws_smithy_runtime::client::waiters::WaiterOrchestrator::builder()
73            .min_delay(::std::time::Duration::from_secs(10))
74            .max_delay(::std::time::Duration::from_secs(120))
75            .max_wait(max_wait)
76            .time_source(time_source)
77            .sleep_impl(sleep_impl)
78            .acceptor(acceptor)
79            .operation(operation)
80            .build();
81        ::aws_smithy_runtime::client::waiters::attach_waiter_tracing_span(orchestrator.orchestrate()).await
82    }
83    /// <p>The name of the stream to describe.</p>
84    pub fn stream_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.inner = self.inner.stream_name(input.into());
86        self
87    }
88    /// <p>The name of the stream to describe.</p>
89    pub fn set_stream_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.inner = self.inner.set_stream_name(input);
91        self
92    }
93    /// <p>The name of the stream to describe.</p>
94    pub fn get_stream_name(&self) -> &::std::option::Option<::std::string::String> {
95        self.inner.get_stream_name()
96    }
97    /// <p>The maximum number of shards to return in a single call. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.</p>
98    pub fn limit(mut self, input: i32) -> Self {
99        self.inner = self.inner.limit(input);
100        self
101    }
102    /// <p>The maximum number of shards to return in a single call. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.</p>
103    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
104        self.inner = self.inner.set_limit(input);
105        self
106    }
107    /// <p>The maximum number of shards to return in a single call. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.</p>
108    pub fn get_limit(&self) -> &::std::option::Option<i32> {
109        self.inner.get_limit()
110    }
111    /// <p>The shard ID of the shard to start with.</p>
112    /// <p>Specify this parameter to indicate that you want to describe the stream starting with the shard whose ID immediately follows <code>ExclusiveStartShardId</code>.</p>
113    /// <p>If you don't specify this parameter, the default behavior for <code>DescribeStream</code> is to describe the stream starting with the first shard in the stream.</p>
114    pub fn exclusive_start_shard_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.exclusive_start_shard_id(input.into());
116        self
117    }
118    /// <p>The shard ID of the shard to start with.</p>
119    /// <p>Specify this parameter to indicate that you want to describe the stream starting with the shard whose ID immediately follows <code>ExclusiveStartShardId</code>.</p>
120    /// <p>If you don't specify this parameter, the default behavior for <code>DescribeStream</code> is to describe the stream starting with the first shard in the stream.</p>
121    pub fn set_exclusive_start_shard_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_exclusive_start_shard_id(input);
123        self
124    }
125    /// <p>The shard ID of the shard to start with.</p>
126    /// <p>Specify this parameter to indicate that you want to describe the stream starting with the shard whose ID immediately follows <code>ExclusiveStartShardId</code>.</p>
127    /// <p>If you don't specify this parameter, the default behavior for <code>DescribeStream</code> is to describe the stream starting with the first shard in the stream.</p>
128    pub fn get_exclusive_start_shard_id(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_exclusive_start_shard_id()
130    }
131    /// <p>The ARN of the stream.</p>
132    pub fn stream_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.stream_arn(input.into());
134        self
135    }
136    /// <p>The ARN of the stream.</p>
137    pub fn set_stream_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_stream_arn(input);
139        self
140    }
141    /// <p>The ARN of the stream.</p>
142    pub fn get_stream_arn(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_stream_arn()
144    }
145}
146
147/// Successful return type for the `stream_not_exists` waiter.
148pub type StreamNotExistsFinalPoll = ::aws_smithy_runtime_api::client::waiters::FinalPoll<
149    crate::operation::describe_stream::DescribeStreamOutput,
150    ::aws_smithy_runtime_api::client::result::SdkError<
151        crate::operation::describe_stream::DescribeStreamError,
152        ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
153    >,
154>;
155
156/// Error type for the `stream_not_exists` waiter.
157pub type WaitUntilStreamNotExistsError = ::aws_smithy_runtime_api::client::waiters::error::WaiterError<
158    crate::operation::describe_stream::DescribeStreamOutput,
159    crate::operation::describe_stream::DescribeStreamError,
160>;