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 DescribeTopicOutput {
    /// <p>The Amazon Resource Name (ARN) of the topic.</p>
    pub topic_arn: ::std::option::Option<::std::string::String>,
    /// <p>The Kafka topic name of the topic.</p>
    pub topic_name: ::std::option::Option<::std::string::String>,
    /// <p>The replication factor of the topic.</p>
    pub replication_factor: ::std::option::Option<i32>,
    /// <p>The partition count of the topic.</p>
    pub partition_count: ::std::option::Option<i32>,
    /// <p>Topic configurations encoded as a Base64 string.</p>
    pub configs: ::std::option::Option<::std::string::String>,
    /// <p>The status of the topic.</p>
    pub status: ::std::option::Option<crate::types::TopicState>,
    _request_id: Option<String>,
}
impl DescribeTopicOutput {
    /// <p>The Amazon Resource Name (ARN) of the topic.</p>
    pub fn topic_arn(&self) -> ::std::option::Option<&str> {
        self.topic_arn.as_deref()
    }
    /// <p>The Kafka topic name of the topic.</p>
    pub fn topic_name(&self) -> ::std::option::Option<&str> {
        self.topic_name.as_deref()
    }
    /// <p>The replication factor of the topic.</p>
    pub fn replication_factor(&self) -> ::std::option::Option<i32> {
        self.replication_factor
    }
    /// <p>The partition count of the topic.</p>
    pub fn partition_count(&self) -> ::std::option::Option<i32> {
        self.partition_count
    }
    /// <p>Topic configurations encoded as a Base64 string.</p>
    pub fn configs(&self) -> ::std::option::Option<&str> {
        self.configs.as_deref()
    }
    /// <p>The status of the topic.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::TopicState> {
        self.status.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for DescribeTopicOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeTopicOutput {
    /// Creates a new builder-style object to manufacture [`DescribeTopicOutput`](crate::operation::describe_topic::DescribeTopicOutput).
    pub fn builder() -> crate::operation::describe_topic::builders::DescribeTopicOutputBuilder {
        crate::operation::describe_topic::builders::DescribeTopicOutputBuilder::default()
    }
}

/// A builder for [`DescribeTopicOutput`](crate::operation::describe_topic::DescribeTopicOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeTopicOutputBuilder {
    pub(crate) topic_arn: ::std::option::Option<::std::string::String>,
    pub(crate) topic_name: ::std::option::Option<::std::string::String>,
    pub(crate) replication_factor: ::std::option::Option<i32>,
    pub(crate) partition_count: ::std::option::Option<i32>,
    pub(crate) configs: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::TopicState>,
    _request_id: Option<String>,
}
impl DescribeTopicOutputBuilder {
    /// <p>The Amazon Resource Name (ARN) of the topic.</p>
    pub fn topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.topic_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the topic.</p>
    pub fn set_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.topic_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the topic.</p>
    pub fn get_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.topic_arn
    }
    /// <p>The Kafka topic name of the topic.</p>
    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 Kafka topic name of the topic.</p>
    pub fn set_topic_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.topic_name = input;
        self
    }
    /// <p>The Kafka topic name of the topic.</p>
    pub fn get_topic_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.topic_name
    }
    /// <p>The replication factor of the topic.</p>
    pub fn replication_factor(mut self, input: i32) -> Self {
        self.replication_factor = ::std::option::Option::Some(input);
        self
    }
    /// <p>The replication factor of 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 of the topic.</p>
    pub fn get_replication_factor(&self) -> &::std::option::Option<i32> {
        &self.replication_factor
    }
    /// <p>The partition count of the topic.</p>
    pub fn partition_count(mut self, input: i32) -> Self {
        self.partition_count = ::std::option::Option::Some(input);
        self
    }
    /// <p>The partition count of the topic.</p>
    pub fn set_partition_count(mut self, input: ::std::option::Option<i32>) -> Self {
        self.partition_count = input;
        self
    }
    /// <p>The partition count of the topic.</p>
    pub fn get_partition_count(&self) -> &::std::option::Option<i32> {
        &self.partition_count
    }
    /// <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
    }
    /// <p>The status of the topic.</p>
    pub fn status(mut self, input: crate::types::TopicState) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the topic.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::TopicState>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the topic.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::TopicState> {
        &self.status
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DescribeTopicOutput`](crate::operation::describe_topic::DescribeTopicOutput).
    pub fn build(self) -> crate::operation::describe_topic::DescribeTopicOutput {
        crate::operation::describe_topic::DescribeTopicOutput {
            topic_arn: self.topic_arn,
            topic_name: self.topic_name,
            replication_factor: self.replication_factor,
            partition_count: self.partition_count,
            configs: self.configs,
            status: self.status,
            _request_id: self._request_id,
        }
    }
}