aws_sdk_kinesis/operation/update_stream_warm_throughput/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_stream_warm_throughput::_update_stream_warm_throughput_output::UpdateStreamWarmThroughputOutputBuilder;
3
4pub use crate::operation::update_stream_warm_throughput::_update_stream_warm_throughput_input::UpdateStreamWarmThroughputInputBuilder;
5
6impl crate::operation::update_stream_warm_throughput::builders::UpdateStreamWarmThroughputInputBuilder {
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::update_stream_warm_throughput::UpdateStreamWarmThroughputOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_stream_warm_throughput::UpdateStreamWarmThroughputError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_stream_warm_throughput();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateStreamWarmThroughput`.
24///
25/// <p>Updates the warm throughput configuration for the specified Amazon Kinesis Data Streams on-demand data stream. This operation allows you to proactively scale your on-demand data stream to a specified throughput level, enabling better performance for sudden traffic spikes.</p><note>
26/// <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>
27/// </note>
28/// <p>Updating the warm throughput is an asynchronous operation. Upon receiving the request, Kinesis Data Streams returns immediately and sets the status of the stream to <code>UPDATING</code>. After the update is complete, Kinesis Data Streams sets the status of the stream back to <code>ACTIVE</code>. Depending on the size of the stream, the scaling action could take a few minutes to complete. You can continue to read and write data to your stream while its status is <code>UPDATING</code>.</p>
29/// <p>This operation is only supported for data streams with the on-demand capacity mode in accounts that have <code>MinimumThroughputBillingCommitment</code> enabled. Provisioned capacity mode streams do not support warm throughput configuration.</p>
30/// <p>This operation has the following default limits. By default, you cannot do the following:</p>
31/// <ul>
32/// <li>
33/// <p>Scale to more than 10 GiBps for an on-demand stream.</p></li>
34/// <li>
35/// <p>This API has a call limit of 5 transactions per second (TPS) for each Amazon Web Services account. TPS over 5 will initiate the <code>LimitExceededException</code>.</p></li>
36/// </ul>
37/// <p>For the default limits for an Amazon Web Services account, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html">Streams Limits</a> in the <i>Amazon Kinesis Data Streams Developer Guide</i>. To request an increase in the call rate limit, the shard limit for this API, or your overall shard limit, use the <a href="https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase&amp;limitType=service-code-kinesis">limits form</a>.</p>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct UpdateStreamWarmThroughputFluentBuilder {
40    handle: ::std::sync::Arc<crate::client::Handle>,
41    inner: crate::operation::update_stream_warm_throughput::builders::UpdateStreamWarmThroughputInputBuilder,
42    config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl
45    crate::client::customize::internal::CustomizableSend<
46        crate::operation::update_stream_warm_throughput::UpdateStreamWarmThroughputOutput,
47        crate::operation::update_stream_warm_throughput::UpdateStreamWarmThroughputError,
48    > for UpdateStreamWarmThroughputFluentBuilder
49{
50    fn send(
51        self,
52        config_override: crate::config::Builder,
53    ) -> crate::client::customize::internal::BoxFuture<
54        crate::client::customize::internal::SendResult<
55            crate::operation::update_stream_warm_throughput::UpdateStreamWarmThroughputOutput,
56            crate::operation::update_stream_warm_throughput::UpdateStreamWarmThroughputError,
57        >,
58    > {
59        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60    }
61}
62impl UpdateStreamWarmThroughputFluentBuilder {
63    /// Creates a new `UpdateStreamWarmThroughputFluentBuilder`.
64    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
65        Self {
66            handle,
67            inner: ::std::default::Default::default(),
68            config_override: ::std::option::Option::None,
69        }
70    }
71    /// Access the UpdateStreamWarmThroughput as a reference.
72    pub fn as_input(&self) -> &crate::operation::update_stream_warm_throughput::builders::UpdateStreamWarmThroughputInputBuilder {
73        &self.inner
74    }
75    /// Sends the request and returns the response.
76    ///
77    /// If an error occurs, an `SdkError` will be returned with additional details that
78    /// can be matched against.
79    ///
80    /// By default, any retryable failures will be retried twice. Retry behavior
81    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82    /// set when configuring the client.
83    pub async fn send(
84        self,
85    ) -> ::std::result::Result<
86        crate::operation::update_stream_warm_throughput::UpdateStreamWarmThroughputOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::update_stream_warm_throughput::UpdateStreamWarmThroughputError,
89            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
90        >,
91    > {
92        let input = self
93            .inner
94            .build()
95            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
96        let runtime_plugins = crate::operation::update_stream_warm_throughput::UpdateStreamWarmThroughput::operation_runtime_plugins(
97            self.handle.runtime_plugins.clone(),
98            &self.handle.conf,
99            self.config_override,
100        );
101        crate::operation::update_stream_warm_throughput::UpdateStreamWarmThroughput::orchestrate(&runtime_plugins, input).await
102    }
103
104    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
105    pub fn customize(
106        self,
107    ) -> crate::client::customize::CustomizableOperation<
108        crate::operation::update_stream_warm_throughput::UpdateStreamWarmThroughputOutput,
109        crate::operation::update_stream_warm_throughput::UpdateStreamWarmThroughputError,
110        Self,
111    > {
112        crate::client::customize::CustomizableOperation::new(self)
113    }
114    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
115        self.set_config_override(::std::option::Option::Some(config_override.into()));
116        self
117    }
118
119    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
120        self.config_override = config_override;
121        self
122    }
123    /// <p>The ARN of the stream to be updated.</p>
124    pub fn stream_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.inner = self.inner.stream_arn(input.into());
126        self
127    }
128    /// <p>The ARN of the stream to be updated.</p>
129    pub fn set_stream_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_stream_arn(input);
131        self
132    }
133    /// <p>The ARN of the stream to be updated.</p>
134    pub fn get_stream_arn(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_stream_arn()
136    }
137    /// <p>The name of the stream to be updated.</p>
138    pub fn stream_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.stream_name(input.into());
140        self
141    }
142    /// <p>The name of the stream to be updated.</p>
143    pub fn set_stream_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.inner = self.inner.set_stream_name(input);
145        self
146    }
147    /// <p>The name of the stream to be updated.</p>
148    pub fn get_stream_name(&self) -> &::std::option::Option<::std::string::String> {
149        self.inner.get_stream_name()
150    }
151    /// <p>The target warm throughput in MB/s that the stream should be scaled to handle. This represents the throughput capacity that will be immediately available for write operations.</p>
152    pub fn warm_throughput_mibps(mut self, input: i32) -> Self {
153        self.inner = self.inner.warm_throughput_mibps(input);
154        self
155    }
156    /// <p>The target warm throughput in MB/s that the stream should be scaled to handle. This represents the throughput capacity that will be immediately available for write operations.</p>
157    pub fn set_warm_throughput_mibps(mut self, input: ::std::option::Option<i32>) -> Self {
158        self.inner = self.inner.set_warm_throughput_mibps(input);
159        self
160    }
161    /// <p>The target warm throughput in MB/s that the stream should be scaled to handle. This represents the throughput capacity that will be immediately available for write operations.</p>
162    pub fn get_warm_throughput_mibps(&self) -> &::std::option::Option<i32> {
163        self.inner.get_warm_throughput_mibps()
164    }
165}