aws-sdk-kafka 1.126.0

AWS SDK for Managed Streaming for Kafka
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_cluster::_create_cluster_input::CreateClusterInputBuilder;

pub use crate::operation::create_cluster::_create_cluster_output::CreateClusterOutputBuilder;

impl crate::operation::create_cluster::builders::CreateClusterInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_cluster::CreateClusterOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_cluster::CreateClusterError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_cluster();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateCluster`.
///
/// <p>Creates a new MSK cluster.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateClusterFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_cluster::builders::CreateClusterInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_cluster::CreateClusterOutput,
        crate::operation::create_cluster::CreateClusterError,
    > for CreateClusterFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_cluster::CreateClusterOutput,
            crate::operation::create_cluster::CreateClusterError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateClusterFluentBuilder {
    /// Creates a new `CreateClusterFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the CreateCluster as a reference.
    pub fn as_input(&self) -> &crate::operation::create_cluster::builders::CreateClusterInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_cluster::CreateClusterOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_cluster::CreateClusterError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::create_cluster::CreateCluster::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_cluster::CreateCluster::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::create_cluster::CreateClusterOutput,
        crate::operation::create_cluster::CreateClusterError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>Information about the broker nodes in the cluster.</p>
    pub fn broker_node_group_info(mut self, input: crate::types::BrokerNodeGroupInfo) -> Self {
        self.inner = self.inner.broker_node_group_info(input);
        self
    }
    /// <p>Information about the broker nodes in the cluster.</p>
    pub fn set_broker_node_group_info(mut self, input: ::std::option::Option<crate::types::BrokerNodeGroupInfo>) -> Self {
        self.inner = self.inner.set_broker_node_group_info(input);
        self
    }
    /// <p>Information about the broker nodes in the cluster.</p>
    pub fn get_broker_node_group_info(&self) -> &::std::option::Option<crate::types::BrokerNodeGroupInfo> {
        self.inner.get_broker_node_group_info()
    }
    /// <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>
    pub fn rebalancing(mut self, input: crate::types::Rebalancing) -> Self {
        self.inner = self.inner.rebalancing(input);
        self
    }
    /// <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>
    pub fn set_rebalancing(mut self, input: ::std::option::Option<crate::types::Rebalancing>) -> Self {
        self.inner = self.inner.set_rebalancing(input);
        self
    }
    /// <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>
    pub fn get_rebalancing(&self) -> &::std::option::Option<crate::types::Rebalancing> {
        self.inner.get_rebalancing()
    }
    /// <p>Includes all client authentication related information.</p>
    pub fn client_authentication(mut self, input: crate::types::ClientAuthentication) -> Self {
        self.inner = self.inner.client_authentication(input);
        self
    }
    /// <p>Includes all client authentication related information.</p>
    pub fn set_client_authentication(mut self, input: ::std::option::Option<crate::types::ClientAuthentication>) -> Self {
        self.inner = self.inner.set_client_authentication(input);
        self
    }
    /// <p>Includes all client authentication related information.</p>
    pub fn get_client_authentication(&self) -> &::std::option::Option<crate::types::ClientAuthentication> {
        self.inner.get_client_authentication()
    }
    /// <p>The name of the cluster.</p>
    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.cluster_name(input.into());
        self
    }
    /// <p>The name of the cluster.</p>
    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_cluster_name(input);
        self
    }
    /// <p>The name of the cluster.</p>
    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_cluster_name()
    }
    /// <p>Represents the configuration that you want MSK to use for the brokers in a cluster.</p>
    pub fn configuration_info(mut self, input: crate::types::ConfigurationInfo) -> Self {
        self.inner = self.inner.configuration_info(input);
        self
    }
    /// <p>Represents the configuration that you want MSK to use for the brokers in a cluster.</p>
    pub fn set_configuration_info(mut self, input: ::std::option::Option<crate::types::ConfigurationInfo>) -> Self {
        self.inner = self.inner.set_configuration_info(input);
        self
    }
    /// <p>Represents the configuration that you want MSK to use for the brokers in a cluster.</p>
    pub fn get_configuration_info(&self) -> &::std::option::Option<crate::types::ConfigurationInfo> {
        self.inner.get_configuration_info()
    }
    /// <p>Includes all encryption-related information.</p>
    pub fn encryption_info(mut self, input: crate::types::EncryptionInfo) -> Self {
        self.inner = self.inner.encryption_info(input);
        self
    }
    /// <p>Includes all encryption-related information.</p>
    pub fn set_encryption_info(mut self, input: ::std::option::Option<crate::types::EncryptionInfo>) -> Self {
        self.inner = self.inner.set_encryption_info(input);
        self
    }
    /// <p>Includes all encryption-related information.</p>
    pub fn get_encryption_info(&self) -> &::std::option::Option<crate::types::EncryptionInfo> {
        self.inner.get_encryption_info()
    }
    /// <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>
    pub fn enhanced_monitoring(mut self, input: crate::types::EnhancedMonitoring) -> Self {
        self.inner = self.inner.enhanced_monitoring(input);
        self
    }
    /// <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>
    pub fn set_enhanced_monitoring(mut self, input: ::std::option::Option<crate::types::EnhancedMonitoring>) -> Self {
        self.inner = self.inner.set_enhanced_monitoring(input);
        self
    }
    /// <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>
    pub fn get_enhanced_monitoring(&self) -> &::std::option::Option<crate::types::EnhancedMonitoring> {
        self.inner.get_enhanced_monitoring()
    }
    /// <p>The settings for open monitoring.</p>
    pub fn open_monitoring(mut self, input: crate::types::OpenMonitoringInfo) -> Self {
        self.inner = self.inner.open_monitoring(input);
        self
    }
    /// <p>The settings for open monitoring.</p>
    pub fn set_open_monitoring(mut self, input: ::std::option::Option<crate::types::OpenMonitoringInfo>) -> Self {
        self.inner = self.inner.set_open_monitoring(input);
        self
    }
    /// <p>The settings for open monitoring.</p>
    pub fn get_open_monitoring(&self) -> &::std::option::Option<crate::types::OpenMonitoringInfo> {
        self.inner.get_open_monitoring()
    }
    /// <p>The version of Apache Kafka.</p>
    pub fn kafka_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.kafka_version(input.into());
        self
    }
    /// <p>The version of Apache Kafka.</p>
    pub fn set_kafka_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_kafka_version(input);
        self
    }
    /// <p>The version of Apache Kafka.</p>
    pub fn get_kafka_version(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_kafka_version()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn logging_info(mut self, input: crate::types::LoggingInfo) -> Self {
        self.inner = self.inner.logging_info(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_logging_info(mut self, input: ::std::option::Option<crate::types::LoggingInfo>) -> Self {
        self.inner = self.inner.set_logging_info(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_logging_info(&self) -> &::std::option::Option<crate::types::LoggingInfo> {
        self.inner.get_logging_info()
    }
    /// <p>The number of broker nodes in the cluster.</p>
    pub fn number_of_broker_nodes(mut self, input: i32) -> Self {
        self.inner = self.inner.number_of_broker_nodes(input);
        self
    }
    /// <p>The number of broker nodes in the cluster.</p>
    pub fn set_number_of_broker_nodes(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_number_of_broker_nodes(input);
        self
    }
    /// <p>The number of broker nodes in the cluster.</p>
    pub fn get_number_of_broker_nodes(&self) -> &::std::option::Option<i32> {
        self.inner.get_number_of_broker_nodes()
    }
    ///
    /// Adds a key-value pair to `Tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Create tags when creating the cluster.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.tags(k.into(), v.into());
        self
    }
    /// <p>Create tags when creating the cluster.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>Create tags when creating the cluster.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
    /// <p>This controls storage mode for supported storage tiers.</p>
    pub fn storage_mode(mut self, input: crate::types::StorageMode) -> Self {
        self.inner = self.inner.storage_mode(input);
        self
    }
    /// <p>This controls storage mode for supported storage tiers.</p>
    pub fn set_storage_mode(mut self, input: ::std::option::Option<crate::types::StorageMode>) -> Self {
        self.inner = self.inner.set_storage_mode(input);
        self
    }
    /// <p>This controls storage mode for supported storage tiers.</p>
    pub fn get_storage_mode(&self) -> &::std::option::Option<crate::types::StorageMode> {
        self.inner.get_storage_mode()
    }
}