aws_sdk_kafka/operation/create_cluster/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_cluster::_create_cluster_output::CreateClusterOutputBuilder;
3
4pub use crate::operation::create_cluster::_create_cluster_input::CreateClusterInputBuilder;
5
6impl crate::operation::create_cluster::builders::CreateClusterInputBuilder {
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::create_cluster::CreateClusterOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_cluster::CreateClusterError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_cluster();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateCluster`.
24///
25/// <p>Creates a new MSK cluster.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateClusterFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_cluster::builders::CreateClusterInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_cluster::CreateClusterOutput,
35        crate::operation::create_cluster::CreateClusterError,
36    > for CreateClusterFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_cluster::CreateClusterOutput,
44            crate::operation::create_cluster::CreateClusterError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateClusterFluentBuilder {
51    /// Creates a new `CreateClusterFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateCluster as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_cluster::builders::CreateClusterInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_cluster::CreateClusterOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_cluster::CreateClusterError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_cluster::CreateCluster::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_cluster::CreateCluster::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_cluster::CreateClusterOutput,
97        crate::operation::create_cluster::CreateClusterError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>Information about the broker nodes in the cluster.</p>
112    pub fn broker_node_group_info(mut self, input: crate::types::BrokerNodeGroupInfo) -> Self {
113        self.inner = self.inner.broker_node_group_info(input);
114        self
115    }
116    /// <p>Information about the broker nodes in the cluster.</p>
117    pub fn set_broker_node_group_info(mut self, input: ::std::option::Option<crate::types::BrokerNodeGroupInfo>) -> Self {
118        self.inner = self.inner.set_broker_node_group_info(input);
119        self
120    }
121    /// <p>Information about the broker nodes in the cluster.</p>
122    pub fn get_broker_node_group_info(&self) -> &::std::option::Option<crate::types::BrokerNodeGroupInfo> {
123        self.inner.get_broker_node_group_info()
124    }
125    /// <p>Includes all client authentication related information.</p>
126    pub fn client_authentication(mut self, input: crate::types::ClientAuthentication) -> Self {
127        self.inner = self.inner.client_authentication(input);
128        self
129    }
130    /// <p>Includes all client authentication related information.</p>
131    pub fn set_client_authentication(mut self, input: ::std::option::Option<crate::types::ClientAuthentication>) -> Self {
132        self.inner = self.inner.set_client_authentication(input);
133        self
134    }
135    /// <p>Includes all client authentication related information.</p>
136    pub fn get_client_authentication(&self) -> &::std::option::Option<crate::types::ClientAuthentication> {
137        self.inner.get_client_authentication()
138    }
139    /// <p>The name of the cluster.</p>
140    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.cluster_name(input.into());
142        self
143    }
144    /// <p>The name of the cluster.</p>
145    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_cluster_name(input);
147        self
148    }
149    /// <p>The name of the cluster.</p>
150    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_cluster_name()
152    }
153    /// <p>Represents the configuration that you want MSK to use for the brokers in a cluster.</p>
154    pub fn configuration_info(mut self, input: crate::types::ConfigurationInfo) -> Self {
155        self.inner = self.inner.configuration_info(input);
156        self
157    }
158    /// <p>Represents the configuration that you want MSK to use for the brokers in a cluster.</p>
159    pub fn set_configuration_info(mut self, input: ::std::option::Option<crate::types::ConfigurationInfo>) -> Self {
160        self.inner = self.inner.set_configuration_info(input);
161        self
162    }
163    /// <p>Represents the configuration that you want MSK to use for the brokers in a cluster.</p>
164    pub fn get_configuration_info(&self) -> &::std::option::Option<crate::types::ConfigurationInfo> {
165        self.inner.get_configuration_info()
166    }
167    /// <p>Includes all encryption-related information.</p>
168    pub fn encryption_info(mut self, input: crate::types::EncryptionInfo) -> Self {
169        self.inner = self.inner.encryption_info(input);
170        self
171    }
172    /// <p>Includes all encryption-related information.</p>
173    pub fn set_encryption_info(mut self, input: ::std::option::Option<crate::types::EncryptionInfo>) -> Self {
174        self.inner = self.inner.set_encryption_info(input);
175        self
176    }
177    /// <p>Includes all encryption-related information.</p>
178    pub fn get_encryption_info(&self) -> &::std::option::Option<crate::types::EncryptionInfo> {
179        self.inner.get_encryption_info()
180    }
181    /// <p>Specifies the level of monitoring for the MSK cluster. The possible values are DEFAULT, PER_BROKER, PER_TOPIC_PER_BROKER, and PER_TOPIC_PER_PARTITION.</p>
182    pub fn enhanced_monitoring(mut self, input: crate::types::EnhancedMonitoring) -> Self {
183        self.inner = self.inner.enhanced_monitoring(input);
184        self
185    }
186    /// <p>Specifies the level of monitoring for the MSK cluster. The possible values are DEFAULT, PER_BROKER, PER_TOPIC_PER_BROKER, and PER_TOPIC_PER_PARTITION.</p>
187    pub fn set_enhanced_monitoring(mut self, input: ::std::option::Option<crate::types::EnhancedMonitoring>) -> Self {
188        self.inner = self.inner.set_enhanced_monitoring(input);
189        self
190    }
191    /// <p>Specifies the level of monitoring for the MSK cluster. The possible values are DEFAULT, PER_BROKER, PER_TOPIC_PER_BROKER, and PER_TOPIC_PER_PARTITION.</p>
192    pub fn get_enhanced_monitoring(&self) -> &::std::option::Option<crate::types::EnhancedMonitoring> {
193        self.inner.get_enhanced_monitoring()
194    }
195    /// <p>The settings for open monitoring.</p>
196    pub fn open_monitoring(mut self, input: crate::types::OpenMonitoringInfo) -> Self {
197        self.inner = self.inner.open_monitoring(input);
198        self
199    }
200    /// <p>The settings for open monitoring.</p>
201    pub fn set_open_monitoring(mut self, input: ::std::option::Option<crate::types::OpenMonitoringInfo>) -> Self {
202        self.inner = self.inner.set_open_monitoring(input);
203        self
204    }
205    /// <p>The settings for open monitoring.</p>
206    pub fn get_open_monitoring(&self) -> &::std::option::Option<crate::types::OpenMonitoringInfo> {
207        self.inner.get_open_monitoring()
208    }
209    /// <p>The version of Apache Kafka.</p>
210    pub fn kafka_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.inner = self.inner.kafka_version(input.into());
212        self
213    }
214    /// <p>The version of Apache Kafka.</p>
215    pub fn set_kafka_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.inner = self.inner.set_kafka_version(input);
217        self
218    }
219    /// <p>The version of Apache Kafka.</p>
220    pub fn get_kafka_version(&self) -> &::std::option::Option<::std::string::String> {
221        self.inner.get_kafka_version()
222    }
223    #[allow(missing_docs)] // documentation missing in model
224    pub fn logging_info(mut self, input: crate::types::LoggingInfo) -> Self {
225        self.inner = self.inner.logging_info(input);
226        self
227    }
228    #[allow(missing_docs)] // documentation missing in model
229    pub fn set_logging_info(mut self, input: ::std::option::Option<crate::types::LoggingInfo>) -> Self {
230        self.inner = self.inner.set_logging_info(input);
231        self
232    }
233    #[allow(missing_docs)] // documentation missing in model
234    pub fn get_logging_info(&self) -> &::std::option::Option<crate::types::LoggingInfo> {
235        self.inner.get_logging_info()
236    }
237    /// <p>The number of broker nodes in the cluster.</p>
238    pub fn number_of_broker_nodes(mut self, input: i32) -> Self {
239        self.inner = self.inner.number_of_broker_nodes(input);
240        self
241    }
242    /// <p>The number of broker nodes in the cluster.</p>
243    pub fn set_number_of_broker_nodes(mut self, input: ::std::option::Option<i32>) -> Self {
244        self.inner = self.inner.set_number_of_broker_nodes(input);
245        self
246    }
247    /// <p>The number of broker nodes in the cluster.</p>
248    pub fn get_number_of_broker_nodes(&self) -> &::std::option::Option<i32> {
249        self.inner.get_number_of_broker_nodes()
250    }
251    ///
252    /// Adds a key-value pair to `Tags`.
253    ///
254    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
255    ///
256    /// <p>Create tags when creating the cluster.</p>
257    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
258        self.inner = self.inner.tags(k.into(), v.into());
259        self
260    }
261    /// <p>Create tags when creating the cluster.</p>
262    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
263        self.inner = self.inner.set_tags(input);
264        self
265    }
266    /// <p>Create tags when creating the cluster.</p>
267    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
268        self.inner.get_tags()
269    }
270    /// <p>This controls storage mode for supported storage tiers.</p>
271    pub fn storage_mode(mut self, input: crate::types::StorageMode) -> Self {
272        self.inner = self.inner.storage_mode(input);
273        self
274    }
275    /// <p>This controls storage mode for supported storage tiers.</p>
276    pub fn set_storage_mode(mut self, input: ::std::option::Option<crate::types::StorageMode>) -> Self {
277        self.inner = self.inner.set_storage_mode(input);
278        self
279    }
280    /// <p>This controls storage mode for supported storage tiers.</p>
281    pub fn get_storage_mode(&self) -> &::std::option::Option<crate::types::StorageMode> {
282        self.inner.get_storage_mode()
283    }
284}