aws_sdk_kinesis/operation/describe_stream/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_stream::_describe_stream_output::DescribeStreamOutputBuilder;
3
4pub use crate::operation::describe_stream::_describe_stream_input::DescribeStreamInputBuilder;
5
6impl crate::operation::describe_stream::builders::DescribeStreamInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::describe_stream::DescribeStreamOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_stream::DescribeStreamError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_stream();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeStream`.
24///
25/// <p>Describes the specified Kinesis data stream.</p><note>
26/// <p>This API has been revised. It's highly recommended that you use the <code>DescribeStreamSummary</code> API to get a summarized description of the specified Kinesis data stream and the <code>ListShards</code> API to list the shards in a specified data stream and obtain information about each shard.</p>
27/// </note> <note>
28/// <p>When invoking this API, you must use either the <code>StreamARN</code> or the <code>StreamName</code> parameter, or both. It is recommended that you use the <code>StreamARN</code> input parameter when you invoke this API.</p>
29/// </note>
30/// <p>The information returned includes the stream name, Amazon Resource Name (ARN), creation time, enhanced metric configuration, and shard map. The shard map is an array of shard objects. For each shard object, there is the hash key and sequence number ranges that the shard spans, and the IDs of any earlier shards that played in a role in creating the shard. Every record ingested in the stream is identified by a sequence number, which is assigned when the record is put into the stream.</p>
31/// <p>You can limit the number of shards returned by each call. For more information, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-retrieve-shards.html">Retrieving Shards from a Stream</a> in the <i>Amazon Kinesis Data Streams Developer Guide</i>.</p>
32/// <p>There are no guarantees about the chronological order shards returned. To process shards in chronological order, use the ID of the parent shard to track the lineage to the oldest shard.</p>
33/// <p>This operation has a limit of 10 transactions per second per account.</p>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct DescribeStreamFluentBuilder {
36 handle: ::std::sync::Arc<crate::client::Handle>,
37 inner: crate::operation::describe_stream::builders::DescribeStreamInputBuilder,
38 config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41 crate::client::customize::internal::CustomizableSend<
42 crate::operation::describe_stream::DescribeStreamOutput,
43 crate::operation::describe_stream::DescribeStreamError,
44 > for DescribeStreamFluentBuilder
45{
46 fn send(
47 self,
48 config_override: crate::config::Builder,
49 ) -> crate::client::customize::internal::BoxFuture<
50 crate::client::customize::internal::SendResult<
51 crate::operation::describe_stream::DescribeStreamOutput,
52 crate::operation::describe_stream::DescribeStreamError,
53 >,
54 > {
55 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56 }
57}
58impl DescribeStreamFluentBuilder {
59 /// Creates a new `DescribeStreamFluentBuilder`.
60 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61 Self {
62 handle,
63 inner: ::std::default::Default::default(),
64 config_override: ::std::option::Option::None,
65 }
66 }
67 /// Access the DescribeStream as a reference.
68 pub fn as_input(&self) -> &crate::operation::describe_stream::builders::DescribeStreamInputBuilder {
69 &self.inner
70 }
71 /// Sends the request and returns the response.
72 ///
73 /// If an error occurs, an `SdkError` will be returned with additional details that
74 /// can be matched against.
75 ///
76 /// By default, any retryable failures will be retried twice. Retry behavior
77 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78 /// set when configuring the client.
79 pub async fn send(
80 self,
81 ) -> ::std::result::Result<
82 crate::operation::describe_stream::DescribeStreamOutput,
83 ::aws_smithy_runtime_api::client::result::SdkError<
84 crate::operation::describe_stream::DescribeStreamError,
85 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86 >,
87 > {
88 let input = self
89 .inner
90 .build()
91 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92 let runtime_plugins = crate::operation::describe_stream::DescribeStream::operation_runtime_plugins(
93 self.handle.runtime_plugins.clone(),
94 &self.handle.conf,
95 self.config_override,
96 );
97 crate::operation::describe_stream::DescribeStream::orchestrate(&runtime_plugins, input).await
98 }
99
100 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101 pub fn customize(
102 self,
103 ) -> crate::client::customize::CustomizableOperation<
104 crate::operation::describe_stream::DescribeStreamOutput,
105 crate::operation::describe_stream::DescribeStreamError,
106 Self,
107 > {
108 crate::client::customize::CustomizableOperation::new(self)
109 }
110 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111 self.set_config_override(::std::option::Option::Some(config_override.into()));
112 self
113 }
114
115 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116 self.config_override = config_override;
117 self
118 }
119 /// <p>The name of the stream to describe.</p>
120 pub fn stream_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.stream_name(input.into());
122 self
123 }
124 /// <p>The name of the stream to describe.</p>
125 pub fn set_stream_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.inner = self.inner.set_stream_name(input);
127 self
128 }
129 /// <p>The name of the stream to describe.</p>
130 pub fn get_stream_name(&self) -> &::std::option::Option<::std::string::String> {
131 self.inner.get_stream_name()
132 }
133 /// <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>
134 pub fn limit(mut self, input: i32) -> Self {
135 self.inner = self.inner.limit(input);
136 self
137 }
138 /// <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>
139 pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
140 self.inner = self.inner.set_limit(input);
141 self
142 }
143 /// <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>
144 pub fn get_limit(&self) -> &::std::option::Option<i32> {
145 self.inner.get_limit()
146 }
147 /// <p>The shard ID of the shard to start with.</p>
148 /// <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>
149 /// <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>
150 pub fn exclusive_start_shard_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.inner = self.inner.exclusive_start_shard_id(input.into());
152 self
153 }
154 /// <p>The shard ID of the shard to start with.</p>
155 /// <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>
156 /// <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>
157 pub fn set_exclusive_start_shard_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158 self.inner = self.inner.set_exclusive_start_shard_id(input);
159 self
160 }
161 /// <p>The shard ID of the shard to start with.</p>
162 /// <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>
163 /// <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>
164 pub fn get_exclusive_start_shard_id(&self) -> &::std::option::Option<::std::string::String> {
165 self.inner.get_exclusive_start_shard_id()
166 }
167 /// <p>The ARN of the stream.</p>
168 pub fn stream_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169 self.inner = self.inner.stream_arn(input.into());
170 self
171 }
172 /// <p>The ARN of the stream.</p>
173 pub fn set_stream_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174 self.inner = self.inner.set_stream_arn(input);
175 self
176 }
177 /// <p>The ARN of the stream.</p>
178 pub fn get_stream_arn(&self) -> &::std::option::Option<::std::string::String> {
179 self.inner.get_stream_arn()
180 }
181}