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_channel::_create_channel_input::CreateChannelInputBuilder;

pub use crate::operation::create_channel::_create_channel_output::CreateChannelOutputBuilder;

impl crate::operation::create_channel::builders::CreateChannelInputBuilder {
    /// 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_channel::CreateChannelOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_channel::CreateChannelError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_channel();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateChannel`.
///
/// <p>Creates a Channel that streams records from an Amazon MSK Express cluster topic to Amazon S3 or Apache Iceberg.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateChannelFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_channel::builders::CreateChannelInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_channel::CreateChannelOutput,
        crate::operation::create_channel::CreateChannelError,
    > for CreateChannelFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_channel::CreateChannelOutput,
            crate::operation::create_channel::CreateChannelError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateChannelFluentBuilder {
    /// Creates a new `CreateChannelFluentBuilder`.
    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 CreateChannel as a reference.
    pub fn as_input(&self) -> &crate::operation::create_channel::builders::CreateChannelInputBuilder {
        &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_channel::CreateChannelOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_channel::CreateChannelError,
            ::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_channel::CreateChannel::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_channel::CreateChannel::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_channel::CreateChannelOutput,
        crate::operation::create_channel::CreateChannelError,
        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>The name of the channel. Must be unique within the cluster.</p>
    pub fn channel_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.channel_name(input.into());
        self
    }
    /// <p>The name of the channel. Must be unique within the cluster.</p>
    pub fn set_channel_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_channel_name(input);
        self
    }
    /// <p>The name of the channel. Must be unique within the cluster.</p>
    pub fn get_channel_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_channel_name()
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the cluster.</p>
    pub fn cluster_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.cluster_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the cluster.</p>
    pub fn set_cluster_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_cluster_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the cluster.</p>
    pub fn get_cluster_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_cluster_arn()
    }
    /// <p>The encryption configuration applied to the channel.</p>
    pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
        self.inner = self.inner.encryption_configuration(input);
        self
    }
    /// <p>The encryption configuration applied to the channel.</p>
    pub fn set_encryption_configuration(mut self, input: ::std::option::Option<crate::types::EncryptionConfiguration>) -> Self {
        self.inner = self.inner.set_encryption_configuration(input);
        self
    }
    /// <p>The encryption configuration applied to the channel.</p>
    pub fn get_encryption_configuration(&self) -> &::std::option::Option<crate::types::EncryptionConfiguration> {
        self.inner.get_encryption_configuration()
    }
    /// <p>The Apache Iceberg destination for the channel. Mutually exclusive with s3DestinationConfiguration.</p>
    pub fn iceberg_destination_configuration(mut self, input: crate::types::IcebergDestinationConfiguration) -> Self {
        self.inner = self.inner.iceberg_destination_configuration(input);
        self
    }
    /// <p>The Apache Iceberg destination for the channel. Mutually exclusive with s3DestinationConfiguration.</p>
    pub fn set_iceberg_destination_configuration(mut self, input: ::std::option::Option<crate::types::IcebergDestinationConfiguration>) -> Self {
        self.inner = self.inner.set_iceberg_destination_configuration(input);
        self
    }
    /// <p>The Apache Iceberg destination for the channel. Mutually exclusive with s3DestinationConfiguration.</p>
    pub fn get_iceberg_destination_configuration(&self) -> &::std::option::Option<crate::types::IcebergDestinationConfiguration> {
        self.inner.get_iceberg_destination_configuration()
    }
    /// <p>The Amazon S3 destination for the channel. Mutually exclusive with icebergDestinationConfiguration.</p>
    pub fn s3_destination_configuration(mut self, input: crate::types::S3DestinationConfiguration) -> Self {
        self.inner = self.inner.s3_destination_configuration(input);
        self
    }
    /// <p>The Amazon S3 destination for the channel. Mutually exclusive with icebergDestinationConfiguration.</p>
    pub fn set_s3_destination_configuration(mut self, input: ::std::option::Option<crate::types::S3DestinationConfiguration>) -> Self {
        self.inner = self.inner.set_s3_destination_configuration(input);
        self
    }
    /// <p>The Amazon S3 destination for the channel. Mutually exclusive with icebergDestinationConfiguration.</p>
    pub fn get_s3_destination_configuration(&self) -> &::std::option::Option<crate::types::S3DestinationConfiguration> {
        self.inner.get_s3_destination_configuration()
    }
    ///
    /// Adds a key-value pair to `Tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags attached to the channel.</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>The tags attached to the channel.</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>The tags attached to the channel.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_tags()
    }
    ///
    /// Appends an item to `TopicConfigurationList`.
    ///
    /// To override the contents of this collection use [`set_topic_configuration_list`](Self::set_topic_configuration_list).
    ///
    /// <p>The list of topic configurations for the channel. Currently exactly one topic must be specified.</p>
    pub fn topic_configuration_list(mut self, input: crate::types::TopicConfiguration) -> Self {
        self.inner = self.inner.topic_configuration_list(input);
        self
    }
    /// <p>The list of topic configurations for the channel. Currently exactly one topic must be specified.</p>
    pub fn set_topic_configuration_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TopicConfiguration>>) -> Self {
        self.inner = self.inner.set_topic_configuration_list(input);
        self
    }
    /// <p>The list of topic configurations for the channel. Currently exactly one topic must be specified.</p>
    pub fn get_topic_configuration_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TopicConfiguration>> {
        self.inner.get_topic_configuration_list()
    }
    /// <p>The destinations to which the channel publishes operational logs.</p>
    pub fn logging_info(mut self, input: crate::types::ChannelLoggingInfo) -> Self {
        self.inner = self.inner.logging_info(input);
        self
    }
    /// <p>The destinations to which the channel publishes operational logs.</p>
    pub fn set_logging_info(mut self, input: ::std::option::Option<crate::types::ChannelLoggingInfo>) -> Self {
        self.inner = self.inner.set_logging_info(input);
        self
    }
    /// <p>The destinations to which the channel publishes operational logs.</p>
    pub fn get_logging_info(&self) -> &::std::option::Option<crate::types::ChannelLoggingInfo> {
        self.inner.get_logging_info()
    }
}