aws_sdk_kinesis/operation/stop_stream_encryption/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::stop_stream_encryption::_stop_stream_encryption_output::StopStreamEncryptionOutputBuilder;
3
4pub use crate::operation::stop_stream_encryption::_stop_stream_encryption_input::StopStreamEncryptionInputBuilder;
5
6impl crate::operation::stop_stream_encryption::builders::StopStreamEncryptionInputBuilder {
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::stop_stream_encryption::StopStreamEncryptionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::stop_stream_encryption::StopStreamEncryptionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.stop_stream_encryption();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StopStreamEncryption`.
24///
25/// <p>Disables server-side encryption for a specified stream.</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>Stopping encryption 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>. Stopping encryption normally takes a few seconds to complete, but it can take minutes. You can continue to read and write data to your stream while its status is <code>UPDATING</code>. Once the status of the stream is <code>ACTIVE</code>, records written to the stream are no longer encrypted by Kinesis Data Streams.</p>
29/// <p>API Limits: You can successfully disable server-side encryption 25 times in a rolling 24-hour period.</p>
30/// <p>Note: It can take up to 5 seconds after the stream is in an <code>ACTIVE</code> status before all records written to the stream are no longer subject to encryption. After you disabled encryption, you can verify that encryption is not applied by inspecting the API response from <code>PutRecord</code> or <code>PutRecords</code>.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct StopStreamEncryptionFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::stop_stream_encryption::builders::StopStreamEncryptionInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::stop_stream_encryption::StopStreamEncryptionOutput,
40        crate::operation::stop_stream_encryption::StopStreamEncryptionError,
41    > for StopStreamEncryptionFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::stop_stream_encryption::StopStreamEncryptionOutput,
49            crate::operation::stop_stream_encryption::StopStreamEncryptionError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl StopStreamEncryptionFluentBuilder {
56    /// Creates a new `StopStreamEncryptionFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the StopStreamEncryption as a reference.
65    pub fn as_input(&self) -> &crate::operation::stop_stream_encryption::builders::StopStreamEncryptionInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::stop_stream_encryption::StopStreamEncryptionOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::stop_stream_encryption::StopStreamEncryptionError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::stop_stream_encryption::StopStreamEncryption::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::stop_stream_encryption::StopStreamEncryption::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::stop_stream_encryption::StopStreamEncryptionOutput,
102        crate::operation::stop_stream_encryption::StopStreamEncryptionError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// <p>The name of the stream on which to stop encrypting records.</p>
117    pub fn stream_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.inner = self.inner.stream_name(input.into());
119        self
120    }
121    /// <p>The name of the stream on which to stop encrypting records.</p>
122    pub fn set_stream_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.inner = self.inner.set_stream_name(input);
124        self
125    }
126    /// <p>The name of the stream on which to stop encrypting records.</p>
127    pub fn get_stream_name(&self) -> &::std::option::Option<::std::string::String> {
128        self.inner.get_stream_name()
129    }
130    /// <p>The encryption type. The only valid value is <code>KMS</code>.</p>
131    pub fn encryption_type(mut self, input: crate::types::EncryptionType) -> Self {
132        self.inner = self.inner.encryption_type(input);
133        self
134    }
135    /// <p>The encryption type. The only valid value is <code>KMS</code>.</p>
136    pub fn set_encryption_type(mut self, input: ::std::option::Option<crate::types::EncryptionType>) -> Self {
137        self.inner = self.inner.set_encryption_type(input);
138        self
139    }
140    /// <p>The encryption type. The only valid value is <code>KMS</code>.</p>
141    pub fn get_encryption_type(&self) -> &::std::option::Option<crate::types::EncryptionType> {
142        self.inner.get_encryption_type()
143    }
144    /// <p>The GUID for the customer-managed Amazon Web Services KMS key to use for encryption. This value can be a globally unique identifier, a fully specified Amazon Resource Name (ARN) to either an alias or a key, or an alias name prefixed by "alias/".You can also use a master key owned by Kinesis Data Streams by specifying the alias <code>aws/kinesis</code>.</p>
145    /// <ul>
146    /// <li>
147    /// <p>Key ARN example: <code>arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012</code></p></li>
148    /// <li>
149    /// <p>Alias ARN example: <code>arn:aws:kms:us-east-1:123456789012:alias/MyAliasName</code></p></li>
150    /// <li>
151    /// <p>Globally unique key ID example: <code>12345678-1234-1234-1234-123456789012</code></p></li>
152    /// <li>
153    /// <p>Alias name example: <code>alias/MyAliasName</code></p></li>
154    /// <li>
155    /// <p>Master key owned by Kinesis Data Streams: <code>alias/aws/kinesis</code></p></li>
156    /// </ul>
157    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.key_id(input.into());
159        self
160    }
161    /// <p>The GUID for the customer-managed Amazon Web Services KMS key to use for encryption. This value can be a globally unique identifier, a fully specified Amazon Resource Name (ARN) to either an alias or a key, or an alias name prefixed by "alias/".You can also use a master key owned by Kinesis Data Streams by specifying the alias <code>aws/kinesis</code>.</p>
162    /// <ul>
163    /// <li>
164    /// <p>Key ARN example: <code>arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012</code></p></li>
165    /// <li>
166    /// <p>Alias ARN example: <code>arn:aws:kms:us-east-1:123456789012:alias/MyAliasName</code></p></li>
167    /// <li>
168    /// <p>Globally unique key ID example: <code>12345678-1234-1234-1234-123456789012</code></p></li>
169    /// <li>
170    /// <p>Alias name example: <code>alias/MyAliasName</code></p></li>
171    /// <li>
172    /// <p>Master key owned by Kinesis Data Streams: <code>alias/aws/kinesis</code></p></li>
173    /// </ul>
174    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175        self.inner = self.inner.set_key_id(input);
176        self
177    }
178    /// <p>The GUID for the customer-managed Amazon Web Services KMS key to use for encryption. This value can be a globally unique identifier, a fully specified Amazon Resource Name (ARN) to either an alias or a key, or an alias name prefixed by "alias/".You can also use a master key owned by Kinesis Data Streams by specifying the alias <code>aws/kinesis</code>.</p>
179    /// <ul>
180    /// <li>
181    /// <p>Key ARN example: <code>arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012</code></p></li>
182    /// <li>
183    /// <p>Alias ARN example: <code>arn:aws:kms:us-east-1:123456789012:alias/MyAliasName</code></p></li>
184    /// <li>
185    /// <p>Globally unique key ID example: <code>12345678-1234-1234-1234-123456789012</code></p></li>
186    /// <li>
187    /// <p>Alias name example: <code>alias/MyAliasName</code></p></li>
188    /// <li>
189    /// <p>Master key owned by Kinesis Data Streams: <code>alias/aws/kinesis</code></p></li>
190    /// </ul>
191    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
192        self.inner.get_key_id()
193    }
194    /// <p>The ARN of the stream.</p>
195    pub fn stream_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196        self.inner = self.inner.stream_arn(input.into());
197        self
198    }
199    /// <p>The ARN of the stream.</p>
200    pub fn set_stream_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201        self.inner = self.inner.set_stream_arn(input);
202        self
203    }
204    /// <p>The ARN of the stream.</p>
205    pub fn get_stream_arn(&self) -> &::std::option::Option<::std::string::String> {
206        self.inner.get_stream_arn()
207    }
208}