aws_sdk_kafka/operation/create_cluster/
_create_cluster_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateClusterInput {
6    /// <p>Information about the broker nodes in the cluster.</p>
7    pub broker_node_group_info: ::std::option::Option<crate::types::BrokerNodeGroupInfo>,
8    /// <p>Specifies if intelligent rebalancing should be turned on for the new MSK Provisioned cluster with Express brokers. By default, intelligent rebalancing status is ACTIVE for all new clusters.</p>
9    pub rebalancing: ::std::option::Option<crate::types::Rebalancing>,
10    /// <p>Includes all client authentication related information.</p>
11    pub client_authentication: ::std::option::Option<crate::types::ClientAuthentication>,
12    /// <p>The name of the cluster.</p>
13    pub cluster_name: ::std::option::Option<::std::string::String>,
14    /// <p>Represents the configuration that you want MSK to use for the brokers in a cluster.</p>
15    pub configuration_info: ::std::option::Option<crate::types::ConfigurationInfo>,
16    /// <p>Includes all encryption-related information.</p>
17    pub encryption_info: ::std::option::Option<crate::types::EncryptionInfo>,
18    /// <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>
19    pub enhanced_monitoring: ::std::option::Option<crate::types::EnhancedMonitoring>,
20    /// <p>The settings for open monitoring.</p>
21    pub open_monitoring: ::std::option::Option<crate::types::OpenMonitoringInfo>,
22    /// <p>The version of Apache Kafka.</p>
23    pub kafka_version: ::std::option::Option<::std::string::String>,
24    #[allow(missing_docs)] // documentation missing in model
25    pub logging_info: ::std::option::Option<crate::types::LoggingInfo>,
26    /// <p>The number of broker nodes in the cluster.</p>
27    pub number_of_broker_nodes: ::std::option::Option<i32>,
28    /// <p>Create tags when creating the cluster.</p>
29    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
30    /// <p>This controls storage mode for supported storage tiers.</p>
31    pub storage_mode: ::std::option::Option<crate::types::StorageMode>,
32}
33impl CreateClusterInput {
34    /// <p>Information about the broker nodes in the cluster.</p>
35    pub fn broker_node_group_info(&self) -> ::std::option::Option<&crate::types::BrokerNodeGroupInfo> {
36        self.broker_node_group_info.as_ref()
37    }
38    /// <p>Specifies if intelligent rebalancing should be turned on for the new MSK Provisioned cluster with Express brokers. By default, intelligent rebalancing status is ACTIVE for all new clusters.</p>
39    pub fn rebalancing(&self) -> ::std::option::Option<&crate::types::Rebalancing> {
40        self.rebalancing.as_ref()
41    }
42    /// <p>Includes all client authentication related information.</p>
43    pub fn client_authentication(&self) -> ::std::option::Option<&crate::types::ClientAuthentication> {
44        self.client_authentication.as_ref()
45    }
46    /// <p>The name of the cluster.</p>
47    pub fn cluster_name(&self) -> ::std::option::Option<&str> {
48        self.cluster_name.as_deref()
49    }
50    /// <p>Represents the configuration that you want MSK to use for the brokers in a cluster.</p>
51    pub fn configuration_info(&self) -> ::std::option::Option<&crate::types::ConfigurationInfo> {
52        self.configuration_info.as_ref()
53    }
54    /// <p>Includes all encryption-related information.</p>
55    pub fn encryption_info(&self) -> ::std::option::Option<&crate::types::EncryptionInfo> {
56        self.encryption_info.as_ref()
57    }
58    /// <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>
59    pub fn enhanced_monitoring(&self) -> ::std::option::Option<&crate::types::EnhancedMonitoring> {
60        self.enhanced_monitoring.as_ref()
61    }
62    /// <p>The settings for open monitoring.</p>
63    pub fn open_monitoring(&self) -> ::std::option::Option<&crate::types::OpenMonitoringInfo> {
64        self.open_monitoring.as_ref()
65    }
66    /// <p>The version of Apache Kafka.</p>
67    pub fn kafka_version(&self) -> ::std::option::Option<&str> {
68        self.kafka_version.as_deref()
69    }
70    #[allow(missing_docs)] // documentation missing in model
71    pub fn logging_info(&self) -> ::std::option::Option<&crate::types::LoggingInfo> {
72        self.logging_info.as_ref()
73    }
74    /// <p>The number of broker nodes in the cluster.</p>
75    pub fn number_of_broker_nodes(&self) -> ::std::option::Option<i32> {
76        self.number_of_broker_nodes
77    }
78    /// <p>Create tags when creating the cluster.</p>
79    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
80        self.tags.as_ref()
81    }
82    /// <p>This controls storage mode for supported storage tiers.</p>
83    pub fn storage_mode(&self) -> ::std::option::Option<&crate::types::StorageMode> {
84        self.storage_mode.as_ref()
85    }
86}
87impl CreateClusterInput {
88    /// Creates a new builder-style object to manufacture [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
89    pub fn builder() -> crate::operation::create_cluster::builders::CreateClusterInputBuilder {
90        crate::operation::create_cluster::builders::CreateClusterInputBuilder::default()
91    }
92}
93
94/// A builder for [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
95#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
96#[non_exhaustive]
97pub struct CreateClusterInputBuilder {
98    pub(crate) broker_node_group_info: ::std::option::Option<crate::types::BrokerNodeGroupInfo>,
99    pub(crate) rebalancing: ::std::option::Option<crate::types::Rebalancing>,
100    pub(crate) client_authentication: ::std::option::Option<crate::types::ClientAuthentication>,
101    pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
102    pub(crate) configuration_info: ::std::option::Option<crate::types::ConfigurationInfo>,
103    pub(crate) encryption_info: ::std::option::Option<crate::types::EncryptionInfo>,
104    pub(crate) enhanced_monitoring: ::std::option::Option<crate::types::EnhancedMonitoring>,
105    pub(crate) open_monitoring: ::std::option::Option<crate::types::OpenMonitoringInfo>,
106    pub(crate) kafka_version: ::std::option::Option<::std::string::String>,
107    pub(crate) logging_info: ::std::option::Option<crate::types::LoggingInfo>,
108    pub(crate) number_of_broker_nodes: ::std::option::Option<i32>,
109    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
110    pub(crate) storage_mode: ::std::option::Option<crate::types::StorageMode>,
111}
112impl CreateClusterInputBuilder {
113    /// <p>Information about the broker nodes in the cluster.</p>
114    /// This field is required.
115    pub fn broker_node_group_info(mut self, input: crate::types::BrokerNodeGroupInfo) -> Self {
116        self.broker_node_group_info = ::std::option::Option::Some(input);
117        self
118    }
119    /// <p>Information about the broker nodes in the cluster.</p>
120    pub fn set_broker_node_group_info(mut self, input: ::std::option::Option<crate::types::BrokerNodeGroupInfo>) -> Self {
121        self.broker_node_group_info = input;
122        self
123    }
124    /// <p>Information about the broker nodes in the cluster.</p>
125    pub fn get_broker_node_group_info(&self) -> &::std::option::Option<crate::types::BrokerNodeGroupInfo> {
126        &self.broker_node_group_info
127    }
128    /// <p>Specifies if intelligent rebalancing should be turned on for the new MSK Provisioned cluster with Express brokers. By default, intelligent rebalancing status is ACTIVE for all new clusters.</p>
129    pub fn rebalancing(mut self, input: crate::types::Rebalancing) -> Self {
130        self.rebalancing = ::std::option::Option::Some(input);
131        self
132    }
133    /// <p>Specifies if intelligent rebalancing should be turned on for the new MSK Provisioned cluster with Express brokers. By default, intelligent rebalancing status is ACTIVE for all new clusters.</p>
134    pub fn set_rebalancing(mut self, input: ::std::option::Option<crate::types::Rebalancing>) -> Self {
135        self.rebalancing = input;
136        self
137    }
138    /// <p>Specifies if intelligent rebalancing should be turned on for the new MSK Provisioned cluster with Express brokers. By default, intelligent rebalancing status is ACTIVE for all new clusters.</p>
139    pub fn get_rebalancing(&self) -> &::std::option::Option<crate::types::Rebalancing> {
140        &self.rebalancing
141    }
142    /// <p>Includes all client authentication related information.</p>
143    pub fn client_authentication(mut self, input: crate::types::ClientAuthentication) -> Self {
144        self.client_authentication = ::std::option::Option::Some(input);
145        self
146    }
147    /// <p>Includes all client authentication related information.</p>
148    pub fn set_client_authentication(mut self, input: ::std::option::Option<crate::types::ClientAuthentication>) -> Self {
149        self.client_authentication = input;
150        self
151    }
152    /// <p>Includes all client authentication related information.</p>
153    pub fn get_client_authentication(&self) -> &::std::option::Option<crate::types::ClientAuthentication> {
154        &self.client_authentication
155    }
156    /// <p>The name of the cluster.</p>
157    /// This field is required.
158    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.cluster_name = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>The name of the cluster.</p>
163    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.cluster_name = input;
165        self
166    }
167    /// <p>The name of the cluster.</p>
168    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
169        &self.cluster_name
170    }
171    /// <p>Represents the configuration that you want MSK to use for the brokers in a cluster.</p>
172    pub fn configuration_info(mut self, input: crate::types::ConfigurationInfo) -> Self {
173        self.configuration_info = ::std::option::Option::Some(input);
174        self
175    }
176    /// <p>Represents the configuration that you want MSK to use for the brokers in a cluster.</p>
177    pub fn set_configuration_info(mut self, input: ::std::option::Option<crate::types::ConfigurationInfo>) -> Self {
178        self.configuration_info = input;
179        self
180    }
181    /// <p>Represents the configuration that you want MSK to use for the brokers in a cluster.</p>
182    pub fn get_configuration_info(&self) -> &::std::option::Option<crate::types::ConfigurationInfo> {
183        &self.configuration_info
184    }
185    /// <p>Includes all encryption-related information.</p>
186    pub fn encryption_info(mut self, input: crate::types::EncryptionInfo) -> Self {
187        self.encryption_info = ::std::option::Option::Some(input);
188        self
189    }
190    /// <p>Includes all encryption-related information.</p>
191    pub fn set_encryption_info(mut self, input: ::std::option::Option<crate::types::EncryptionInfo>) -> Self {
192        self.encryption_info = input;
193        self
194    }
195    /// <p>Includes all encryption-related information.</p>
196    pub fn get_encryption_info(&self) -> &::std::option::Option<crate::types::EncryptionInfo> {
197        &self.encryption_info
198    }
199    /// <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>
200    pub fn enhanced_monitoring(mut self, input: crate::types::EnhancedMonitoring) -> Self {
201        self.enhanced_monitoring = ::std::option::Option::Some(input);
202        self
203    }
204    /// <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>
205    pub fn set_enhanced_monitoring(mut self, input: ::std::option::Option<crate::types::EnhancedMonitoring>) -> Self {
206        self.enhanced_monitoring = input;
207        self
208    }
209    /// <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>
210    pub fn get_enhanced_monitoring(&self) -> &::std::option::Option<crate::types::EnhancedMonitoring> {
211        &self.enhanced_monitoring
212    }
213    /// <p>The settings for open monitoring.</p>
214    pub fn open_monitoring(mut self, input: crate::types::OpenMonitoringInfo) -> Self {
215        self.open_monitoring = ::std::option::Option::Some(input);
216        self
217    }
218    /// <p>The settings for open monitoring.</p>
219    pub fn set_open_monitoring(mut self, input: ::std::option::Option<crate::types::OpenMonitoringInfo>) -> Self {
220        self.open_monitoring = input;
221        self
222    }
223    /// <p>The settings for open monitoring.</p>
224    pub fn get_open_monitoring(&self) -> &::std::option::Option<crate::types::OpenMonitoringInfo> {
225        &self.open_monitoring
226    }
227    /// <p>The version of Apache Kafka.</p>
228    /// This field is required.
229    pub fn kafka_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230        self.kafka_version = ::std::option::Option::Some(input.into());
231        self
232    }
233    /// <p>The version of Apache Kafka.</p>
234    pub fn set_kafka_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235        self.kafka_version = input;
236        self
237    }
238    /// <p>The version of Apache Kafka.</p>
239    pub fn get_kafka_version(&self) -> &::std::option::Option<::std::string::String> {
240        &self.kafka_version
241    }
242    #[allow(missing_docs)] // documentation missing in model
243    pub fn logging_info(mut self, input: crate::types::LoggingInfo) -> Self {
244        self.logging_info = ::std::option::Option::Some(input);
245        self
246    }
247    #[allow(missing_docs)] // documentation missing in model
248    pub fn set_logging_info(mut self, input: ::std::option::Option<crate::types::LoggingInfo>) -> Self {
249        self.logging_info = input;
250        self
251    }
252    #[allow(missing_docs)] // documentation missing in model
253    pub fn get_logging_info(&self) -> &::std::option::Option<crate::types::LoggingInfo> {
254        &self.logging_info
255    }
256    /// <p>The number of broker nodes in the cluster.</p>
257    /// This field is required.
258    pub fn number_of_broker_nodes(mut self, input: i32) -> Self {
259        self.number_of_broker_nodes = ::std::option::Option::Some(input);
260        self
261    }
262    /// <p>The number of broker nodes in the cluster.</p>
263    pub fn set_number_of_broker_nodes(mut self, input: ::std::option::Option<i32>) -> Self {
264        self.number_of_broker_nodes = input;
265        self
266    }
267    /// <p>The number of broker nodes in the cluster.</p>
268    pub fn get_number_of_broker_nodes(&self) -> &::std::option::Option<i32> {
269        &self.number_of_broker_nodes
270    }
271    /// Adds a key-value pair to `tags`.
272    ///
273    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
274    ///
275    /// <p>Create tags when creating the cluster.</p>
276    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
277        let mut hash_map = self.tags.unwrap_or_default();
278        hash_map.insert(k.into(), v.into());
279        self.tags = ::std::option::Option::Some(hash_map);
280        self
281    }
282    /// <p>Create tags when creating the cluster.</p>
283    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
284        self.tags = input;
285        self
286    }
287    /// <p>Create tags when creating the cluster.</p>
288    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
289        &self.tags
290    }
291    /// <p>This controls storage mode for supported storage tiers.</p>
292    pub fn storage_mode(mut self, input: crate::types::StorageMode) -> Self {
293        self.storage_mode = ::std::option::Option::Some(input);
294        self
295    }
296    /// <p>This controls storage mode for supported storage tiers.</p>
297    pub fn set_storage_mode(mut self, input: ::std::option::Option<crate::types::StorageMode>) -> Self {
298        self.storage_mode = input;
299        self
300    }
301    /// <p>This controls storage mode for supported storage tiers.</p>
302    pub fn get_storage_mode(&self) -> &::std::option::Option<crate::types::StorageMode> {
303        &self.storage_mode
304    }
305    /// Consumes the builder and constructs a [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
306    pub fn build(
307        self,
308    ) -> ::std::result::Result<crate::operation::create_cluster::CreateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
309        ::std::result::Result::Ok(crate::operation::create_cluster::CreateClusterInput {
310            broker_node_group_info: self.broker_node_group_info,
311            rebalancing: self.rebalancing,
312            client_authentication: self.client_authentication,
313            cluster_name: self.cluster_name,
314            configuration_info: self.configuration_info,
315            encryption_info: self.encryption_info,
316            enhanced_monitoring: self.enhanced_monitoring,
317            open_monitoring: self.open_monitoring,
318            kafka_version: self.kafka_version,
319            logging_info: self.logging_info,
320            number_of_broker_nodes: self.number_of_broker_nodes,
321            tags: self.tags,
322            storage_mode: self.storage_mode,
323        })
324    }
325}