aws_sdk_kinesis/operation/delete_stream/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_stream::_delete_stream_output::DeleteStreamOutputBuilder;
3
4pub use crate::operation::delete_stream::_delete_stream_input::DeleteStreamInputBuilder;
5
6impl crate::operation::delete_stream::builders::DeleteStreamInputBuilder {
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::delete_stream::DeleteStreamOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_stream::DeleteStreamError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_stream();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteStream`.
24///
25/// <p>Deletes a Kinesis data stream and all its shards and data. You must shut down any applications that are operating on the stream before you delete the stream. If an application attempts to operate on a deleted stream, it receives the exception <code>ResourceNotFoundException</code>.</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>If the stream is in the <code>ACTIVE</code> state, you can delete it. After a <code>DeleteStream</code> request, the specified stream is in the <code>DELETING</code> state until Kinesis Data Streams completes the deletion.</p>
29/// <p><b>Note:</b> Kinesis Data Streams might continue to accept data read and write operations, such as <code>PutRecord</code>, <code>PutRecords</code>, and <code>GetRecords</code>, on a stream in the <code>DELETING</code> state until the stream deletion is complete.</p>
30/// <p>When you delete a stream, any shards in that stream are also deleted, and any tags are dissociated from the stream.</p>
31/// <p>You can use the <code>DescribeStreamSummary</code> operation to check the state of the stream, which is returned in <code>StreamStatus</code>.</p>
32/// <p><code>DeleteStream</code> has a limit of five transactions per second per account.</p>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct DeleteStreamFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::delete_stream::builders::DeleteStreamInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::delete_stream::DeleteStreamOutput,
42        crate::operation::delete_stream::DeleteStreamError,
43    > for DeleteStreamFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::delete_stream::DeleteStreamOutput,
51            crate::operation::delete_stream::DeleteStreamError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl DeleteStreamFluentBuilder {
58    /// Creates a new `DeleteStreamFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the DeleteStream as a reference.
67    pub fn as_input(&self) -> &crate::operation::delete_stream::builders::DeleteStreamInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::delete_stream::DeleteStreamOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::delete_stream::DeleteStreamError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::delete_stream::DeleteStream::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::delete_stream::DeleteStream::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::delete_stream::DeleteStreamOutput,
104        crate::operation::delete_stream::DeleteStreamError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <p>The name of the stream to delete.</p>
119    pub fn stream_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.stream_name(input.into());
121        self
122    }
123    /// <p>The name of the stream to delete.</p>
124    pub fn set_stream_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_stream_name(input);
126        self
127    }
128    /// <p>The name of the stream to delete.</p>
129    pub fn get_stream_name(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_stream_name()
131    }
132    /// <p>If this parameter is unset (<code>null</code>) or if you set it to <code>false</code>, and the stream has registered consumers, the call to <code>DeleteStream</code> fails with a <code>ResourceInUseException</code>.</p>
133    pub fn enforce_consumer_deletion(mut self, input: bool) -> Self {
134        self.inner = self.inner.enforce_consumer_deletion(input);
135        self
136    }
137    /// <p>If this parameter is unset (<code>null</code>) or if you set it to <code>false</code>, and the stream has registered consumers, the call to <code>DeleteStream</code> fails with a <code>ResourceInUseException</code>.</p>
138    pub fn set_enforce_consumer_deletion(mut self, input: ::std::option::Option<bool>) -> Self {
139        self.inner = self.inner.set_enforce_consumer_deletion(input);
140        self
141    }
142    /// <p>If this parameter is unset (<code>null</code>) or if you set it to <code>false</code>, and the stream has registered consumers, the call to <code>DeleteStream</code> fails with a <code>ResourceInUseException</code>.</p>
143    pub fn get_enforce_consumer_deletion(&self) -> &::std::option::Option<bool> {
144        self.inner.get_enforce_consumer_deletion()
145    }
146    /// <p>The ARN of the stream.</p>
147    pub fn stream_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.stream_arn(input.into());
149        self
150    }
151    /// <p>The ARN of the stream.</p>
152    pub fn set_stream_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_stream_arn(input);
154        self
155    }
156    /// <p>The ARN of the stream.</p>
157    pub fn get_stream_arn(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_stream_arn()
159    }
160}