aws_sdk_kafkaconnect/operation/create_connector/
_create_connector_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)]
5pub struct CreateConnectorInput {
6    /// <p>Information about the capacity allocated to the connector. Exactly one of the two properties must be specified.</p>
7    pub capacity: ::std::option::Option<crate::types::Capacity>,
8    /// <p>A map of keys to values that represent the configuration for the connector.</p>
9    pub connector_configuration: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
10    /// <p>A summary description of the connector.</p>
11    pub connector_description: ::std::option::Option<::std::string::String>,
12    /// <p>The name of the connector.</p>
13    pub connector_name: ::std::option::Option<::std::string::String>,
14    /// <p>Specifies which Apache Kafka cluster to connect to.</p>
15    pub kafka_cluster: ::std::option::Option<crate::types::KafkaCluster>,
16    /// <p>Details of the client authentication used by the Apache Kafka cluster.</p>
17    pub kafka_cluster_client_authentication: ::std::option::Option<crate::types::KafkaClusterClientAuthentication>,
18    /// <p>Details of encryption in transit to the Apache Kafka cluster.</p>
19    pub kafka_cluster_encryption_in_transit: ::std::option::Option<crate::types::KafkaClusterEncryptionInTransit>,
20    /// <p>The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the plugins.</p>
21    pub kafka_connect_version: ::std::option::Option<::std::string::String>,
22    /// <p>Details about log delivery.</p>
23    pub log_delivery: ::std::option::Option<crate::types::LogDelivery>,
24    /// <important>
25    /// <p>Amazon MSK Connect does not currently support specifying multiple plugins as a list. To use more than one plugin for your connector, you can create a single custom plugin using a ZIP file that bundles multiple plugins together.</p>
26    /// </important>
27    /// <p>Specifies which plugin to use for the connector. You must specify a single-element list containing one <code>customPlugin</code> object.</p>
28    pub plugins: ::std::option::Option<::std::vec::Vec<crate::types::Plugin>>,
29    /// <p>The Amazon Resource Name (ARN) of the IAM role used by the connector to access the Amazon Web Services resources that it needs. The types of resources depends on the logic of the connector. For example, a connector that has Amazon S3 as a destination must have permissions that allow it to write to the S3 destination bucket.</p>
30    pub service_execution_role_arn: ::std::option::Option<::std::string::String>,
31    /// <p>Specifies which worker configuration to use with the connector.</p>
32    pub worker_configuration: ::std::option::Option<crate::types::WorkerConfiguration>,
33    /// <p>The tags you want to attach to the connector.</p>
34    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
35}
36impl CreateConnectorInput {
37    /// <p>Information about the capacity allocated to the connector. Exactly one of the two properties must be specified.</p>
38    pub fn capacity(&self) -> ::std::option::Option<&crate::types::Capacity> {
39        self.capacity.as_ref()
40    }
41    /// <p>A map of keys to values that represent the configuration for the connector.</p>
42    pub fn connector_configuration(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
43        self.connector_configuration.as_ref()
44    }
45    /// <p>A summary description of the connector.</p>
46    pub fn connector_description(&self) -> ::std::option::Option<&str> {
47        self.connector_description.as_deref()
48    }
49    /// <p>The name of the connector.</p>
50    pub fn connector_name(&self) -> ::std::option::Option<&str> {
51        self.connector_name.as_deref()
52    }
53    /// <p>Specifies which Apache Kafka cluster to connect to.</p>
54    pub fn kafka_cluster(&self) -> ::std::option::Option<&crate::types::KafkaCluster> {
55        self.kafka_cluster.as_ref()
56    }
57    /// <p>Details of the client authentication used by the Apache Kafka cluster.</p>
58    pub fn kafka_cluster_client_authentication(&self) -> ::std::option::Option<&crate::types::KafkaClusterClientAuthentication> {
59        self.kafka_cluster_client_authentication.as_ref()
60    }
61    /// <p>Details of encryption in transit to the Apache Kafka cluster.</p>
62    pub fn kafka_cluster_encryption_in_transit(&self) -> ::std::option::Option<&crate::types::KafkaClusterEncryptionInTransit> {
63        self.kafka_cluster_encryption_in_transit.as_ref()
64    }
65    /// <p>The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the plugins.</p>
66    pub fn kafka_connect_version(&self) -> ::std::option::Option<&str> {
67        self.kafka_connect_version.as_deref()
68    }
69    /// <p>Details about log delivery.</p>
70    pub fn log_delivery(&self) -> ::std::option::Option<&crate::types::LogDelivery> {
71        self.log_delivery.as_ref()
72    }
73    /// <important>
74    /// <p>Amazon MSK Connect does not currently support specifying multiple plugins as a list. To use more than one plugin for your connector, you can create a single custom plugin using a ZIP file that bundles multiple plugins together.</p>
75    /// </important>
76    /// <p>Specifies which plugin to use for the connector. You must specify a single-element list containing one <code>customPlugin</code> object.</p>
77    ///
78    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.plugins.is_none()`.
79    pub fn plugins(&self) -> &[crate::types::Plugin] {
80        self.plugins.as_deref().unwrap_or_default()
81    }
82    /// <p>The Amazon Resource Name (ARN) of the IAM role used by the connector to access the Amazon Web Services resources that it needs. The types of resources depends on the logic of the connector. For example, a connector that has Amazon S3 as a destination must have permissions that allow it to write to the S3 destination bucket.</p>
83    pub fn service_execution_role_arn(&self) -> ::std::option::Option<&str> {
84        self.service_execution_role_arn.as_deref()
85    }
86    /// <p>Specifies which worker configuration to use with the connector.</p>
87    pub fn worker_configuration(&self) -> ::std::option::Option<&crate::types::WorkerConfiguration> {
88        self.worker_configuration.as_ref()
89    }
90    /// <p>The tags you want to attach to the connector.</p>
91    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
92        self.tags.as_ref()
93    }
94}
95impl ::std::fmt::Debug for CreateConnectorInput {
96    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
97        let mut formatter = f.debug_struct("CreateConnectorInput");
98        formatter.field("capacity", &self.capacity);
99        formatter.field("connector_configuration", &"*** Sensitive Data Redacted ***");
100        formatter.field("connector_description", &self.connector_description);
101        formatter.field("connector_name", &self.connector_name);
102        formatter.field("kafka_cluster", &self.kafka_cluster);
103        formatter.field("kafka_cluster_client_authentication", &self.kafka_cluster_client_authentication);
104        formatter.field("kafka_cluster_encryption_in_transit", &self.kafka_cluster_encryption_in_transit);
105        formatter.field("kafka_connect_version", &self.kafka_connect_version);
106        formatter.field("log_delivery", &self.log_delivery);
107        formatter.field("plugins", &self.plugins);
108        formatter.field("service_execution_role_arn", &self.service_execution_role_arn);
109        formatter.field("worker_configuration", &self.worker_configuration);
110        formatter.field("tags", &self.tags);
111        formatter.finish()
112    }
113}
114impl CreateConnectorInput {
115    /// Creates a new builder-style object to manufacture [`CreateConnectorInput`](crate::operation::create_connector::CreateConnectorInput).
116    pub fn builder() -> crate::operation::create_connector::builders::CreateConnectorInputBuilder {
117        crate::operation::create_connector::builders::CreateConnectorInputBuilder::default()
118    }
119}
120
121/// A builder for [`CreateConnectorInput`](crate::operation::create_connector::CreateConnectorInput).
122#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
123#[non_exhaustive]
124pub struct CreateConnectorInputBuilder {
125    pub(crate) capacity: ::std::option::Option<crate::types::Capacity>,
126    pub(crate) connector_configuration: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
127    pub(crate) connector_description: ::std::option::Option<::std::string::String>,
128    pub(crate) connector_name: ::std::option::Option<::std::string::String>,
129    pub(crate) kafka_cluster: ::std::option::Option<crate::types::KafkaCluster>,
130    pub(crate) kafka_cluster_client_authentication: ::std::option::Option<crate::types::KafkaClusterClientAuthentication>,
131    pub(crate) kafka_cluster_encryption_in_transit: ::std::option::Option<crate::types::KafkaClusterEncryptionInTransit>,
132    pub(crate) kafka_connect_version: ::std::option::Option<::std::string::String>,
133    pub(crate) log_delivery: ::std::option::Option<crate::types::LogDelivery>,
134    pub(crate) plugins: ::std::option::Option<::std::vec::Vec<crate::types::Plugin>>,
135    pub(crate) service_execution_role_arn: ::std::option::Option<::std::string::String>,
136    pub(crate) worker_configuration: ::std::option::Option<crate::types::WorkerConfiguration>,
137    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
138}
139impl CreateConnectorInputBuilder {
140    /// <p>Information about the capacity allocated to the connector. Exactly one of the two properties must be specified.</p>
141    /// This field is required.
142    pub fn capacity(mut self, input: crate::types::Capacity) -> Self {
143        self.capacity = ::std::option::Option::Some(input);
144        self
145    }
146    /// <p>Information about the capacity allocated to the connector. Exactly one of the two properties must be specified.</p>
147    pub fn set_capacity(mut self, input: ::std::option::Option<crate::types::Capacity>) -> Self {
148        self.capacity = input;
149        self
150    }
151    /// <p>Information about the capacity allocated to the connector. Exactly one of the two properties must be specified.</p>
152    pub fn get_capacity(&self) -> &::std::option::Option<crate::types::Capacity> {
153        &self.capacity
154    }
155    /// Adds a key-value pair to `connector_configuration`.
156    ///
157    /// To override the contents of this collection use [`set_connector_configuration`](Self::set_connector_configuration).
158    ///
159    /// <p>A map of keys to values that represent the configuration for the connector.</p>
160    pub fn connector_configuration(
161        mut self,
162        k: impl ::std::convert::Into<::std::string::String>,
163        v: impl ::std::convert::Into<::std::string::String>,
164    ) -> Self {
165        let mut hash_map = self.connector_configuration.unwrap_or_default();
166        hash_map.insert(k.into(), v.into());
167        self.connector_configuration = ::std::option::Option::Some(hash_map);
168        self
169    }
170    /// <p>A map of keys to values that represent the configuration for the connector.</p>
171    pub fn set_connector_configuration(
172        mut self,
173        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
174    ) -> Self {
175        self.connector_configuration = input;
176        self
177    }
178    /// <p>A map of keys to values that represent the configuration for the connector.</p>
179    pub fn get_connector_configuration(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
180        &self.connector_configuration
181    }
182    /// <p>A summary description of the connector.</p>
183    pub fn connector_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.connector_description = ::std::option::Option::Some(input.into());
185        self
186    }
187    /// <p>A summary description of the connector.</p>
188    pub fn set_connector_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.connector_description = input;
190        self
191    }
192    /// <p>A summary description of the connector.</p>
193    pub fn get_connector_description(&self) -> &::std::option::Option<::std::string::String> {
194        &self.connector_description
195    }
196    /// <p>The name of the connector.</p>
197    /// This field is required.
198    pub fn connector_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.connector_name = ::std::option::Option::Some(input.into());
200        self
201    }
202    /// <p>The name of the connector.</p>
203    pub fn set_connector_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.connector_name = input;
205        self
206    }
207    /// <p>The name of the connector.</p>
208    pub fn get_connector_name(&self) -> &::std::option::Option<::std::string::String> {
209        &self.connector_name
210    }
211    /// <p>Specifies which Apache Kafka cluster to connect to.</p>
212    /// This field is required.
213    pub fn kafka_cluster(mut self, input: crate::types::KafkaCluster) -> Self {
214        self.kafka_cluster = ::std::option::Option::Some(input);
215        self
216    }
217    /// <p>Specifies which Apache Kafka cluster to connect to.</p>
218    pub fn set_kafka_cluster(mut self, input: ::std::option::Option<crate::types::KafkaCluster>) -> Self {
219        self.kafka_cluster = input;
220        self
221    }
222    /// <p>Specifies which Apache Kafka cluster to connect to.</p>
223    pub fn get_kafka_cluster(&self) -> &::std::option::Option<crate::types::KafkaCluster> {
224        &self.kafka_cluster
225    }
226    /// <p>Details of the client authentication used by the Apache Kafka cluster.</p>
227    /// This field is required.
228    pub fn kafka_cluster_client_authentication(mut self, input: crate::types::KafkaClusterClientAuthentication) -> Self {
229        self.kafka_cluster_client_authentication = ::std::option::Option::Some(input);
230        self
231    }
232    /// <p>Details of the client authentication used by the Apache Kafka cluster.</p>
233    pub fn set_kafka_cluster_client_authentication(mut self, input: ::std::option::Option<crate::types::KafkaClusterClientAuthentication>) -> Self {
234        self.kafka_cluster_client_authentication = input;
235        self
236    }
237    /// <p>Details of the client authentication used by the Apache Kafka cluster.</p>
238    pub fn get_kafka_cluster_client_authentication(&self) -> &::std::option::Option<crate::types::KafkaClusterClientAuthentication> {
239        &self.kafka_cluster_client_authentication
240    }
241    /// <p>Details of encryption in transit to the Apache Kafka cluster.</p>
242    /// This field is required.
243    pub fn kafka_cluster_encryption_in_transit(mut self, input: crate::types::KafkaClusterEncryptionInTransit) -> Self {
244        self.kafka_cluster_encryption_in_transit = ::std::option::Option::Some(input);
245        self
246    }
247    /// <p>Details of encryption in transit to the Apache Kafka cluster.</p>
248    pub fn set_kafka_cluster_encryption_in_transit(mut self, input: ::std::option::Option<crate::types::KafkaClusterEncryptionInTransit>) -> Self {
249        self.kafka_cluster_encryption_in_transit = input;
250        self
251    }
252    /// <p>Details of encryption in transit to the Apache Kafka cluster.</p>
253    pub fn get_kafka_cluster_encryption_in_transit(&self) -> &::std::option::Option<crate::types::KafkaClusterEncryptionInTransit> {
254        &self.kafka_cluster_encryption_in_transit
255    }
256    /// <p>The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the plugins.</p>
257    /// This field is required.
258    pub fn kafka_connect_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
259        self.kafka_connect_version = ::std::option::Option::Some(input.into());
260        self
261    }
262    /// <p>The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the plugins.</p>
263    pub fn set_kafka_connect_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
264        self.kafka_connect_version = input;
265        self
266    }
267    /// <p>The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the plugins.</p>
268    pub fn get_kafka_connect_version(&self) -> &::std::option::Option<::std::string::String> {
269        &self.kafka_connect_version
270    }
271    /// <p>Details about log delivery.</p>
272    pub fn log_delivery(mut self, input: crate::types::LogDelivery) -> Self {
273        self.log_delivery = ::std::option::Option::Some(input);
274        self
275    }
276    /// <p>Details about log delivery.</p>
277    pub fn set_log_delivery(mut self, input: ::std::option::Option<crate::types::LogDelivery>) -> Self {
278        self.log_delivery = input;
279        self
280    }
281    /// <p>Details about log delivery.</p>
282    pub fn get_log_delivery(&self) -> &::std::option::Option<crate::types::LogDelivery> {
283        &self.log_delivery
284    }
285    /// Appends an item to `plugins`.
286    ///
287    /// To override the contents of this collection use [`set_plugins`](Self::set_plugins).
288    ///
289    /// <important>
290    /// <p>Amazon MSK Connect does not currently support specifying multiple plugins as a list. To use more than one plugin for your connector, you can create a single custom plugin using a ZIP file that bundles multiple plugins together.</p>
291    /// </important>
292    /// <p>Specifies which plugin to use for the connector. You must specify a single-element list containing one <code>customPlugin</code> object.</p>
293    pub fn plugins(mut self, input: crate::types::Plugin) -> Self {
294        let mut v = self.plugins.unwrap_or_default();
295        v.push(input);
296        self.plugins = ::std::option::Option::Some(v);
297        self
298    }
299    /// <important>
300    /// <p>Amazon MSK Connect does not currently support specifying multiple plugins as a list. To use more than one plugin for your connector, you can create a single custom plugin using a ZIP file that bundles multiple plugins together.</p>
301    /// </important>
302    /// <p>Specifies which plugin to use for the connector. You must specify a single-element list containing one <code>customPlugin</code> object.</p>
303    pub fn set_plugins(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Plugin>>) -> Self {
304        self.plugins = input;
305        self
306    }
307    /// <important>
308    /// <p>Amazon MSK Connect does not currently support specifying multiple plugins as a list. To use more than one plugin for your connector, you can create a single custom plugin using a ZIP file that bundles multiple plugins together.</p>
309    /// </important>
310    /// <p>Specifies which plugin to use for the connector. You must specify a single-element list containing one <code>customPlugin</code> object.</p>
311    pub fn get_plugins(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Plugin>> {
312        &self.plugins
313    }
314    /// <p>The Amazon Resource Name (ARN) of the IAM role used by the connector to access the Amazon Web Services resources that it needs. The types of resources depends on the logic of the connector. For example, a connector that has Amazon S3 as a destination must have permissions that allow it to write to the S3 destination bucket.</p>
315    /// This field is required.
316    pub fn service_execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
317        self.service_execution_role_arn = ::std::option::Option::Some(input.into());
318        self
319    }
320    /// <p>The Amazon Resource Name (ARN) of the IAM role used by the connector to access the Amazon Web Services resources that it needs. The types of resources depends on the logic of the connector. For example, a connector that has Amazon S3 as a destination must have permissions that allow it to write to the S3 destination bucket.</p>
321    pub fn set_service_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
322        self.service_execution_role_arn = input;
323        self
324    }
325    /// <p>The Amazon Resource Name (ARN) of the IAM role used by the connector to access the Amazon Web Services resources that it needs. The types of resources depends on the logic of the connector. For example, a connector that has Amazon S3 as a destination must have permissions that allow it to write to the S3 destination bucket.</p>
326    pub fn get_service_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
327        &self.service_execution_role_arn
328    }
329    /// <p>Specifies which worker configuration to use with the connector.</p>
330    pub fn worker_configuration(mut self, input: crate::types::WorkerConfiguration) -> Self {
331        self.worker_configuration = ::std::option::Option::Some(input);
332        self
333    }
334    /// <p>Specifies which worker configuration to use with the connector.</p>
335    pub fn set_worker_configuration(mut self, input: ::std::option::Option<crate::types::WorkerConfiguration>) -> Self {
336        self.worker_configuration = input;
337        self
338    }
339    /// <p>Specifies which worker configuration to use with the connector.</p>
340    pub fn get_worker_configuration(&self) -> &::std::option::Option<crate::types::WorkerConfiguration> {
341        &self.worker_configuration
342    }
343    /// Adds a key-value pair to `tags`.
344    ///
345    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
346    ///
347    /// <p>The tags you want to attach to the connector.</p>
348    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
349        let mut hash_map = self.tags.unwrap_or_default();
350        hash_map.insert(k.into(), v.into());
351        self.tags = ::std::option::Option::Some(hash_map);
352        self
353    }
354    /// <p>The tags you want to attach to the connector.</p>
355    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
356        self.tags = input;
357        self
358    }
359    /// <p>The tags you want to attach to the connector.</p>
360    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
361        &self.tags
362    }
363    /// Consumes the builder and constructs a [`CreateConnectorInput`](crate::operation::create_connector::CreateConnectorInput).
364    pub fn build(
365        self,
366    ) -> ::std::result::Result<crate::operation::create_connector::CreateConnectorInput, ::aws_smithy_types::error::operation::BuildError> {
367        ::std::result::Result::Ok(crate::operation::create_connector::CreateConnectorInput {
368            capacity: self.capacity,
369            connector_configuration: self.connector_configuration,
370            connector_description: self.connector_description,
371            connector_name: self.connector_name,
372            kafka_cluster: self.kafka_cluster,
373            kafka_cluster_client_authentication: self.kafka_cluster_client_authentication,
374            kafka_cluster_encryption_in_transit: self.kafka_cluster_encryption_in_transit,
375            kafka_connect_version: self.kafka_connect_version,
376            log_delivery: self.log_delivery,
377            plugins: self.plugins,
378            service_execution_role_arn: self.service_execution_role_arn,
379            worker_configuration: self.worker_configuration,
380            tags: self.tags,
381        })
382    }
383}
384impl ::std::fmt::Debug for CreateConnectorInputBuilder {
385    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
386        let mut formatter = f.debug_struct("CreateConnectorInputBuilder");
387        formatter.field("capacity", &self.capacity);
388        formatter.field("connector_configuration", &"*** Sensitive Data Redacted ***");
389        formatter.field("connector_description", &self.connector_description);
390        formatter.field("connector_name", &self.connector_name);
391        formatter.field("kafka_cluster", &self.kafka_cluster);
392        formatter.field("kafka_cluster_client_authentication", &self.kafka_cluster_client_authentication);
393        formatter.field("kafka_cluster_encryption_in_transit", &self.kafka_cluster_encryption_in_transit);
394        formatter.field("kafka_connect_version", &self.kafka_connect_version);
395        formatter.field("log_delivery", &self.log_delivery);
396        formatter.field("plugins", &self.plugins);
397        formatter.field("service_execution_role_arn", &self.service_execution_role_arn);
398        formatter.field("worker_configuration", &self.worker_configuration);
399        formatter.field("tags", &self.tags);
400        formatter.finish()
401    }
402}