Skip to main content

aws_sdk_kafkaconnect/operation/create_connector/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_connector::_create_connector_output::CreateConnectorOutputBuilder;
3
4pub use crate::operation::create_connector::_create_connector_input::CreateConnectorInputBuilder;
5
6impl crate::operation::create_connector::builders::CreateConnectorInputBuilder {
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_connector::CreateConnectorOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_connector::CreateConnectorError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_connector();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateConnector`.
24///
25/// <p>Creates a connector using the specified properties.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateConnectorFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_connector::builders::CreateConnectorInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_connector::CreateConnectorOutput,
35        crate::operation::create_connector::CreateConnectorError,
36    > for CreateConnectorFluentBuilder
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_connector::CreateConnectorOutput,
44            crate::operation::create_connector::CreateConnectorError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateConnectorFluentBuilder {
51    /// Creates a new `CreateConnectorFluentBuilder`.
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 CreateConnector as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_connector::builders::CreateConnectorInputBuilder {
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_connector::CreateConnectorOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_connector::CreateConnectorError,
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_connector::CreateConnector::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_connector::CreateConnector::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_connector::CreateConnectorOutput,
97        crate::operation::create_connector::CreateConnectorError,
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 capacity allocated to the connector. Exactly one of the two properties must be specified.</p>
112    pub fn capacity(mut self, input: crate::types::Capacity) -> Self {
113        self.inner = self.inner.capacity(input);
114        self
115    }
116    /// <p>Information about the capacity allocated to the connector. Exactly one of the two properties must be specified.</p>
117    pub fn set_capacity(mut self, input: ::std::option::Option<crate::types::Capacity>) -> Self {
118        self.inner = self.inner.set_capacity(input);
119        self
120    }
121    /// <p>Information about the capacity allocated to the connector. Exactly one of the two properties must be specified.</p>
122    pub fn get_capacity(&self) -> &::std::option::Option<crate::types::Capacity> {
123        self.inner.get_capacity()
124    }
125    ///
126    /// Adds a key-value pair to `connectorConfiguration`.
127    ///
128    /// To override the contents of this collection use [`set_connector_configuration`](Self::set_connector_configuration).
129    ///
130    /// <p>A map of keys to values that represent the configuration for the connector.</p>
131    pub fn connector_configuration(
132        mut self,
133        k: impl ::std::convert::Into<::std::string::String>,
134        v: impl ::std::convert::Into<::std::string::String>,
135    ) -> Self {
136        self.inner = self.inner.connector_configuration(k.into(), v.into());
137        self
138    }
139    /// <p>A map of keys to values that represent the configuration for the connector.</p>
140    pub fn set_connector_configuration(
141        mut self,
142        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
143    ) -> Self {
144        self.inner = self.inner.set_connector_configuration(input);
145        self
146    }
147    /// <p>A map of keys to values that represent the configuration for the connector.</p>
148    pub fn get_connector_configuration(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
149        self.inner.get_connector_configuration()
150    }
151    /// <p>A summary description of the connector.</p>
152    pub fn connector_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.connector_description(input.into());
154        self
155    }
156    /// <p>A summary description of the connector.</p>
157    pub fn set_connector_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.inner = self.inner.set_connector_description(input);
159        self
160    }
161    /// <p>A summary description of the connector.</p>
162    pub fn get_connector_description(&self) -> &::std::option::Option<::std::string::String> {
163        self.inner.get_connector_description()
164    }
165    /// <p>The name of the connector.</p>
166    pub fn connector_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.inner = self.inner.connector_name(input.into());
168        self
169    }
170    /// <p>The name of the connector.</p>
171    pub fn set_connector_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.inner = self.inner.set_connector_name(input);
173        self
174    }
175    /// <p>The name of the connector.</p>
176    pub fn get_connector_name(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_connector_name()
178    }
179    /// <p>Specifies which Apache Kafka cluster to connect to.</p>
180    pub fn kafka_cluster(mut self, input: crate::types::KafkaCluster) -> Self {
181        self.inner = self.inner.kafka_cluster(input);
182        self
183    }
184    /// <p>Specifies which Apache Kafka cluster to connect to.</p>
185    pub fn set_kafka_cluster(mut self, input: ::std::option::Option<crate::types::KafkaCluster>) -> Self {
186        self.inner = self.inner.set_kafka_cluster(input);
187        self
188    }
189    /// <p>Specifies which Apache Kafka cluster to connect to.</p>
190    pub fn get_kafka_cluster(&self) -> &::std::option::Option<crate::types::KafkaCluster> {
191        self.inner.get_kafka_cluster()
192    }
193    /// <p>Details of the client authentication used by the Apache Kafka cluster.</p>
194    pub fn kafka_cluster_client_authentication(mut self, input: crate::types::KafkaClusterClientAuthentication) -> Self {
195        self.inner = self.inner.kafka_cluster_client_authentication(input);
196        self
197    }
198    /// <p>Details of the client authentication used by the Apache Kafka cluster.</p>
199    pub fn set_kafka_cluster_client_authentication(mut self, input: ::std::option::Option<crate::types::KafkaClusterClientAuthentication>) -> Self {
200        self.inner = self.inner.set_kafka_cluster_client_authentication(input);
201        self
202    }
203    /// <p>Details of the client authentication used by the Apache Kafka cluster.</p>
204    pub fn get_kafka_cluster_client_authentication(&self) -> &::std::option::Option<crate::types::KafkaClusterClientAuthentication> {
205        self.inner.get_kafka_cluster_client_authentication()
206    }
207    /// <p>Details of encryption in transit to the Apache Kafka cluster.</p>
208    pub fn kafka_cluster_encryption_in_transit(mut self, input: crate::types::KafkaClusterEncryptionInTransit) -> Self {
209        self.inner = self.inner.kafka_cluster_encryption_in_transit(input);
210        self
211    }
212    /// <p>Details of encryption in transit to the Apache Kafka cluster.</p>
213    pub fn set_kafka_cluster_encryption_in_transit(mut self, input: ::std::option::Option<crate::types::KafkaClusterEncryptionInTransit>) -> Self {
214        self.inner = self.inner.set_kafka_cluster_encryption_in_transit(input);
215        self
216    }
217    /// <p>Details of encryption in transit to the Apache Kafka cluster.</p>
218    pub fn get_kafka_cluster_encryption_in_transit(&self) -> &::std::option::Option<crate::types::KafkaClusterEncryptionInTransit> {
219        self.inner.get_kafka_cluster_encryption_in_transit()
220    }
221    /// <p>The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the plugins.</p>
222    pub fn kafka_connect_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223        self.inner = self.inner.kafka_connect_version(input.into());
224        self
225    }
226    /// <p>The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the plugins.</p>
227    pub fn set_kafka_connect_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
228        self.inner = self.inner.set_kafka_connect_version(input);
229        self
230    }
231    /// <p>The version of Kafka Connect. It has to be compatible with both the Apache Kafka cluster's version and the plugins.</p>
232    pub fn get_kafka_connect_version(&self) -> &::std::option::Option<::std::string::String> {
233        self.inner.get_kafka_connect_version()
234    }
235    /// <p>Details about log delivery.</p>
236    pub fn log_delivery(mut self, input: crate::types::LogDelivery) -> Self {
237        self.inner = self.inner.log_delivery(input);
238        self
239    }
240    /// <p>Details about log delivery.</p>
241    pub fn set_log_delivery(mut self, input: ::std::option::Option<crate::types::LogDelivery>) -> Self {
242        self.inner = self.inner.set_log_delivery(input);
243        self
244    }
245    /// <p>Details about log delivery.</p>
246    pub fn get_log_delivery(&self) -> &::std::option::Option<crate::types::LogDelivery> {
247        self.inner.get_log_delivery()
248    }
249    /// <p>The network type of the connector. It gives connectors connectivity to either IPv4 (IPV4) or IPv4 and IPv6 (DUAL) destinations. Defaults to IPV4.</p>
250    pub fn network_type(mut self, input: crate::types::NetworkType) -> Self {
251        self.inner = self.inner.network_type(input);
252        self
253    }
254    /// <p>The network type of the connector. It gives connectors connectivity to either IPv4 (IPV4) or IPv4 and IPv6 (DUAL) destinations. Defaults to IPV4.</p>
255    pub fn set_network_type(mut self, input: ::std::option::Option<crate::types::NetworkType>) -> Self {
256        self.inner = self.inner.set_network_type(input);
257        self
258    }
259    /// <p>The network type of the connector. It gives connectors connectivity to either IPv4 (IPV4) or IPv4 and IPv6 (DUAL) destinations. Defaults to IPV4.</p>
260    pub fn get_network_type(&self) -> &::std::option::Option<crate::types::NetworkType> {
261        self.inner.get_network_type()
262    }
263    ///
264    /// Appends an item to `plugins`.
265    ///
266    /// To override the contents of this collection use [`set_plugins`](Self::set_plugins).
267    ///
268    /// <important>
269    /// <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>
270    /// </important>
271    /// <p>Specifies which plugin to use for the connector. You must specify a single-element list containing one <code>customPlugin</code> object.</p>
272    pub fn plugins(mut self, input: crate::types::Plugin) -> Self {
273        self.inner = self.inner.plugins(input);
274        self
275    }
276    /// <important>
277    /// <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>
278    /// </important>
279    /// <p>Specifies which plugin to use for the connector. You must specify a single-element list containing one <code>customPlugin</code> object.</p>
280    pub fn set_plugins(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Plugin>>) -> Self {
281        self.inner = self.inner.set_plugins(input);
282        self
283    }
284    /// <important>
285    /// <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>
286    /// </important>
287    /// <p>Specifies which plugin to use for the connector. You must specify a single-element list containing one <code>customPlugin</code> object.</p>
288    pub fn get_plugins(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Plugin>> {
289        self.inner.get_plugins()
290    }
291    /// <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>
292    pub fn service_execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
293        self.inner = self.inner.service_execution_role_arn(input.into());
294        self
295    }
296    /// <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>
297    pub fn set_service_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
298        self.inner = self.inner.set_service_execution_role_arn(input);
299        self
300    }
301    /// <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>
302    pub fn get_service_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
303        self.inner.get_service_execution_role_arn()
304    }
305    /// <p>Specifies which worker configuration to use with the connector.</p>
306    pub fn worker_configuration(mut self, input: crate::types::WorkerConfiguration) -> Self {
307        self.inner = self.inner.worker_configuration(input);
308        self
309    }
310    /// <p>Specifies which worker configuration to use with the connector.</p>
311    pub fn set_worker_configuration(mut self, input: ::std::option::Option<crate::types::WorkerConfiguration>) -> Self {
312        self.inner = self.inner.set_worker_configuration(input);
313        self
314    }
315    /// <p>Specifies which worker configuration to use with the connector.</p>
316    pub fn get_worker_configuration(&self) -> &::std::option::Option<crate::types::WorkerConfiguration> {
317        self.inner.get_worker_configuration()
318    }
319    ///
320    /// Adds a key-value pair to `tags`.
321    ///
322    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
323    ///
324    /// <p>The tags you want to attach to the connector.</p>
325    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
326        self.inner = self.inner.tags(k.into(), v.into());
327        self
328    }
329    /// <p>The tags you want to attach to the connector.</p>
330    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
331        self.inner = self.inner.set_tags(input);
332        self
333    }
334    /// <p>The tags you want to attach to the connector.</p>
335    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
336        self.inner.get_tags()
337    }
338}