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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateTopicInput {
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the cluster.</p>
    pub cluster_arn: ::std::option::Option<::std::string::String>,
    /// <p>The name of the topic to create.</p>
    pub topic_name: ::std::option::Option<::std::string::String>,
    /// <p>The number of partitions for the topic.</p>
    pub partition_count: ::std::option::Option<i32>,
    /// <p>The replication factor for the topic.</p>
    pub replication_factor: ::std::option::Option<i32>,
    /// <p>Topic configurations encoded as a Base64 string.</p>
    pub configs: ::std::option::Option<::std::string::String>,
}
impl CreateTopicInput {
    /// <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 name of the topic to create.</p>
    pub fn topic_name(&self) -> ::std::option::Option<&str> {
        self.topic_name.as_deref()
    }
    /// <p>The number of partitions for the topic.</p>
    pub fn partition_count(&self) -> ::std::option::Option<i32> {
        self.partition_count
    }
    /// <p>The replication factor for the topic.</p>
    pub fn replication_factor(&self) -> ::std::option::Option<i32> {
        self.replication_factor
    }
    /// <p>Topic configurations encoded as a Base64 string.</p>
    pub fn configs(&self) -> ::std::option::Option<&str> {
        self.configs.as_deref()
    }
}
impl CreateTopicInput {
    /// Creates a new builder-style object to manufacture [`CreateTopicInput`](crate::operation::create_topic::CreateTopicInput).
    pub fn builder() -> crate::operation::create_topic::builders::CreateTopicInputBuilder {
        crate::operation::create_topic::builders::CreateTopicInputBuilder::default()
    }
}

/// A builder for [`CreateTopicInput`](crate::operation::create_topic::CreateTopicInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateTopicInputBuilder {
    pub(crate) cluster_arn: ::std::option::Option<::std::string::String>,
    pub(crate) topic_name: ::std::option::Option<::std::string::String>,
    pub(crate) partition_count: ::std::option::Option<i32>,
    pub(crate) replication_factor: ::std::option::Option<i32>,
    pub(crate) configs: ::std::option::Option<::std::string::String>,
}
impl CreateTopicInputBuilder {
    /// <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 name of the topic to create.</p>
    /// This field is required.
    pub fn topic_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.topic_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the topic to create.</p>
    pub fn set_topic_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.topic_name = input;
        self
    }
    /// <p>The name of the topic to create.</p>
    pub fn get_topic_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.topic_name
    }
    /// <p>The number of partitions for the topic.</p>
    /// This field is required.
    pub fn partition_count(mut self, input: i32) -> Self {
        self.partition_count = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of partitions for the topic.</p>
    pub fn set_partition_count(mut self, input: ::std::option::Option<i32>) -> Self {
        self.partition_count = input;
        self
    }
    /// <p>The number of partitions for the topic.</p>
    pub fn get_partition_count(&self) -> &::std::option::Option<i32> {
        &self.partition_count
    }
    /// <p>The replication factor for the topic.</p>
    /// This field is required.
    pub fn replication_factor(mut self, input: i32) -> Self {
        self.replication_factor = ::std::option::Option::Some(input);
        self
    }
    /// <p>The replication factor for the topic.</p>
    pub fn set_replication_factor(mut self, input: ::std::option::Option<i32>) -> Self {
        self.replication_factor = input;
        self
    }
    /// <p>The replication factor for the topic.</p>
    pub fn get_replication_factor(&self) -> &::std::option::Option<i32> {
        &self.replication_factor
    }
    /// <p>Topic configurations encoded as a Base64 string.</p>
    pub fn configs(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.configs = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Topic configurations encoded as a Base64 string.</p>
    pub fn set_configs(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.configs = input;
        self
    }
    /// <p>Topic configurations encoded as a Base64 string.</p>
    pub fn get_configs(&self) -> &::std::option::Option<::std::string::String> {
        &self.configs
    }
    /// Consumes the builder and constructs a [`CreateTopicInput`](crate::operation::create_topic::CreateTopicInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::create_topic::CreateTopicInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_topic::CreateTopicInput {
            cluster_arn: self.cluster_arn,
            topic_name: self.topic_name,
            partition_count: self.partition_count,
            replication_factor: self.replication_factor,
            configs: self.configs,
        })
    }
}