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.

/// <p>Creates a Channel that streams records from an Amazon MSK Express cluster topic to Amazon S3 or Apache Iceberg.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateChannelInput {
    /// <p>The name of the channel. Must be unique within the cluster.</p>
    pub channel_name: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the cluster.</p>
    pub cluster_arn: ::std::option::Option<::std::string::String>,
    /// <p>The encryption configuration applied to the channel.</p>
    pub encryption_configuration: ::std::option::Option<crate::types::EncryptionConfiguration>,
    /// <p>The Apache Iceberg destination for the channel. Mutually exclusive with s3DestinationConfiguration.</p>
    pub iceberg_destination_configuration: ::std::option::Option<crate::types::IcebergDestinationConfiguration>,
    /// <p>The Amazon S3 destination for the channel. Mutually exclusive with icebergDestinationConfiguration.</p>
    pub s3_destination_configuration: ::std::option::Option<crate::types::S3DestinationConfiguration>,
    /// <p>The tags attached to the channel.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The list of topic configurations for the channel. Currently exactly one topic must be specified.</p>
    pub topic_configuration_list: ::std::option::Option<::std::vec::Vec<crate::types::TopicConfiguration>>,
    /// <p>The destinations to which the channel publishes operational logs.</p>
    pub logging_info: ::std::option::Option<crate::types::ChannelLoggingInfo>,
}
impl CreateChannelInput {
    /// <p>The name of the channel. Must be unique within the cluster.</p>
    pub fn channel_name(&self) -> ::std::option::Option<&str> {
        self.channel_name.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the cluster.</p>
    pub fn cluster_arn(&self) -> ::std::option::Option<&str> {
        self.cluster_arn.as_deref()
    }
    /// <p>The encryption configuration applied to the channel.</p>
    pub fn encryption_configuration(&self) -> ::std::option::Option<&crate::types::EncryptionConfiguration> {
        self.encryption_configuration.as_ref()
    }
    /// <p>The Apache Iceberg destination for the channel. Mutually exclusive with s3DestinationConfiguration.</p>
    pub fn iceberg_destination_configuration(&self) -> ::std::option::Option<&crate::types::IcebergDestinationConfiguration> {
        self.iceberg_destination_configuration.as_ref()
    }
    /// <p>The Amazon S3 destination for the channel. Mutually exclusive with icebergDestinationConfiguration.</p>
    pub fn s3_destination_configuration(&self) -> ::std::option::Option<&crate::types::S3DestinationConfiguration> {
        self.s3_destination_configuration.as_ref()
    }
    /// <p>The tags attached to the channel.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// <p>The list of topic configurations for the channel. Currently exactly one topic must be specified.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.topic_configuration_list.is_none()`.
    pub fn topic_configuration_list(&self) -> &[crate::types::TopicConfiguration] {
        self.topic_configuration_list.as_deref().unwrap_or_default()
    }
    /// <p>The destinations to which the channel publishes operational logs.</p>
    pub fn logging_info(&self) -> ::std::option::Option<&crate::types::ChannelLoggingInfo> {
        self.logging_info.as_ref()
    }
}
impl CreateChannelInput {
    /// Creates a new builder-style object to manufacture [`CreateChannelInput`](crate::operation::create_channel::CreateChannelInput).
    pub fn builder() -> crate::operation::create_channel::builders::CreateChannelInputBuilder {
        crate::operation::create_channel::builders::CreateChannelInputBuilder::default()
    }
}

/// A builder for [`CreateChannelInput`](crate::operation::create_channel::CreateChannelInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateChannelInputBuilder {
    pub(crate) channel_name: ::std::option::Option<::std::string::String>,
    pub(crate) cluster_arn: ::std::option::Option<::std::string::String>,
    pub(crate) encryption_configuration: ::std::option::Option<crate::types::EncryptionConfiguration>,
    pub(crate) iceberg_destination_configuration: ::std::option::Option<crate::types::IcebergDestinationConfiguration>,
    pub(crate) s3_destination_configuration: ::std::option::Option<crate::types::S3DestinationConfiguration>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) topic_configuration_list: ::std::option::Option<::std::vec::Vec<crate::types::TopicConfiguration>>,
    pub(crate) logging_info: ::std::option::Option<crate::types::ChannelLoggingInfo>,
}
impl CreateChannelInputBuilder {
    /// <p>The name of the channel. Must be unique within the cluster.</p>
    /// This field is required.
    pub fn channel_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.channel_name = ::std::option::Option::Some(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.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.channel_name
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the cluster.</p>
    /// This field is required.
    pub fn cluster_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_arn = ::std::option::Option::Some(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.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.cluster_arn
    }
    /// <p>The encryption configuration applied to the channel.</p>
    pub fn encryption_configuration(mut self, input: crate::types::EncryptionConfiguration) -> Self {
        self.encryption_configuration = ::std::option::Option::Some(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.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.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.iceberg_destination_configuration = ::std::option::Option::Some(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.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.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.s3_destination_configuration = ::std::option::Option::Some(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.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.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 {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        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.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.tags
    }
    /// Appends an item to `topic_configuration_list`.
    ///
    /// 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 {
        let mut v = self.topic_configuration_list.unwrap_or_default();
        v.push(input);
        self.topic_configuration_list = ::std::option::Option::Some(v);
        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.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.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.logging_info = ::std::option::Option::Some(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.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.logging_info
    }
    /// Consumes the builder and constructs a [`CreateChannelInput`](crate::operation::create_channel::CreateChannelInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_channel::CreateChannelInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_channel::CreateChannelInput {
            channel_name: self.channel_name,
            cluster_arn: self.cluster_arn,
            encryption_configuration: self.encryption_configuration,
            iceberg_destination_configuration: self.iceberg_destination_configuration,
            s3_destination_configuration: self.s3_destination_configuration,
            tags: self.tags,
            topic_configuration_list: self.topic_configuration_list,
            logging_info: self.logging_info,
        })
    }
}