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