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>Returns information about a cluster.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Cluster {
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies a cluster operation.</p>
    pub active_operation_arn: ::std::option::Option<::std::string::String>,
    /// <p>Cluster Type.</p>
    pub cluster_type: ::std::option::Option<crate::types::ClusterType>,
    /// <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 cluster.</p>
    pub cluster_name: ::std::option::Option<::std::string::String>,
    /// <p>The time when the cluster was created.</p>
    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The current version of the MSK cluster.</p>
    pub current_version: ::std::option::Option<::std::string::String>,
    /// <p>The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING, MAINTENANCE, REBOOTING_BROKER, and UPDATING.</p>
    pub state: ::std::option::Option<crate::types::ClusterState>,
    /// <p>State Info for the Amazon MSK cluster.</p>
    pub state_info: ::std::option::Option<crate::types::StateInfo>,
    /// <p>Tags attached to the cluster.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>Information about the provisioned cluster.</p>
    pub provisioned: ::std::option::Option<crate::types::Provisioned>,
    /// <p>Information about the serverless cluster.</p>
    pub serverless: ::std::option::Option<crate::types::Serverless>,
}
impl Cluster {
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies a cluster operation.</p>
    pub fn active_operation_arn(&self) -> ::std::option::Option<&str> {
        self.active_operation_arn.as_deref()
    }
    /// <p>Cluster Type.</p>
    pub fn cluster_type(&self) -> ::std::option::Option<&crate::types::ClusterType> {
        self.cluster_type.as_ref()
    }
    /// <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 cluster.</p>
    pub fn cluster_name(&self) -> ::std::option::Option<&str> {
        self.cluster_name.as_deref()
    }
    /// <p>The time when the cluster was created.</p>
    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_time.as_ref()
    }
    /// <p>The current version of the MSK cluster.</p>
    pub fn current_version(&self) -> ::std::option::Option<&str> {
        self.current_version.as_deref()
    }
    /// <p>The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING, MAINTENANCE, REBOOTING_BROKER, and UPDATING.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::ClusterState> {
        self.state.as_ref()
    }
    /// <p>State Info for the Amazon MSK cluster.</p>
    pub fn state_info(&self) -> ::std::option::Option<&crate::types::StateInfo> {
        self.state_info.as_ref()
    }
    /// <p>Tags attached to the cluster.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// <p>Information about the provisioned cluster.</p>
    pub fn provisioned(&self) -> ::std::option::Option<&crate::types::Provisioned> {
        self.provisioned.as_ref()
    }
    /// <p>Information about the serverless cluster.</p>
    pub fn serverless(&self) -> ::std::option::Option<&crate::types::Serverless> {
        self.serverless.as_ref()
    }
}
impl Cluster {
    /// Creates a new builder-style object to manufacture [`Cluster`](crate::types::Cluster).
    pub fn builder() -> crate::types::builders::ClusterBuilder {
        crate::types::builders::ClusterBuilder::default()
    }
}

/// A builder for [`Cluster`](crate::types::Cluster).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ClusterBuilder {
    pub(crate) active_operation_arn: ::std::option::Option<::std::string::String>,
    pub(crate) cluster_type: ::std::option::Option<crate::types::ClusterType>,
    pub(crate) cluster_arn: ::std::option::Option<::std::string::String>,
    pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) current_version: ::std::option::Option<::std::string::String>,
    pub(crate) state: ::std::option::Option<crate::types::ClusterState>,
    pub(crate) state_info: ::std::option::Option<crate::types::StateInfo>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) provisioned: ::std::option::Option<crate::types::Provisioned>,
    pub(crate) serverless: ::std::option::Option<crate::types::Serverless>,
}
impl ClusterBuilder {
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies a cluster operation.</p>
    pub fn active_operation_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.active_operation_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies a cluster operation.</p>
    pub fn set_active_operation_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.active_operation_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies a cluster operation.</p>
    pub fn get_active_operation_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.active_operation_arn
    }
    /// <p>Cluster Type.</p>
    pub fn cluster_type(mut self, input: crate::types::ClusterType) -> Self {
        self.cluster_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Cluster Type.</p>
    pub fn set_cluster_type(mut self, input: ::std::option::Option<crate::types::ClusterType>) -> Self {
        self.cluster_type = input;
        self
    }
    /// <p>Cluster Type.</p>
    pub fn get_cluster_type(&self) -> &::std::option::Option<crate::types::ClusterType> {
        &self.cluster_type
    }
    /// <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.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 cluster.</p>
    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_name = ::std::option::Option::Some(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.cluster_name = input;
        self
    }
    /// <p>The name of the cluster.</p>
    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_name
    }
    /// <p>The time when the cluster was created.</p>
    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time when the cluster was created.</p>
    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>The time when the cluster was created.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>The current version of the MSK cluster.</p>
    pub fn current_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.current_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The current version of the MSK cluster.</p>
    pub fn set_current_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.current_version = input;
        self
    }
    /// <p>The current version of the MSK cluster.</p>
    pub fn get_current_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.current_version
    }
    /// <p>The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING, MAINTENANCE, REBOOTING_BROKER, and UPDATING.</p>
    pub fn state(mut self, input: crate::types::ClusterState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING, MAINTENANCE, REBOOTING_BROKER, and UPDATING.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ClusterState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, FAILED, HEALING, MAINTENANCE, REBOOTING_BROKER, and UPDATING.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::ClusterState> {
        &self.state
    }
    /// <p>State Info for the Amazon MSK cluster.</p>
    pub fn state_info(mut self, input: crate::types::StateInfo) -> Self {
        self.state_info = ::std::option::Option::Some(input);
        self
    }
    /// <p>State Info for the Amazon MSK cluster.</p>
    pub fn set_state_info(mut self, input: ::std::option::Option<crate::types::StateInfo>) -> Self {
        self.state_info = input;
        self
    }
    /// <p>State Info for the Amazon MSK cluster.</p>
    pub fn get_state_info(&self) -> &::std::option::Option<crate::types::StateInfo> {
        &self.state_info
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Tags attached to 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 {
        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>Tags attached to the cluster.</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>Tags attached to the cluster.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// <p>Information about the provisioned cluster.</p>
    pub fn provisioned(mut self, input: crate::types::Provisioned) -> Self {
        self.provisioned = ::std::option::Option::Some(input);
        self
    }
    /// <p>Information about the provisioned cluster.</p>
    pub fn set_provisioned(mut self, input: ::std::option::Option<crate::types::Provisioned>) -> Self {
        self.provisioned = input;
        self
    }
    /// <p>Information about the provisioned cluster.</p>
    pub fn get_provisioned(&self) -> &::std::option::Option<crate::types::Provisioned> {
        &self.provisioned
    }
    /// <p>Information about the serverless cluster.</p>
    pub fn serverless(mut self, input: crate::types::Serverless) -> Self {
        self.serverless = ::std::option::Option::Some(input);
        self
    }
    /// <p>Information about the serverless cluster.</p>
    pub fn set_serverless(mut self, input: ::std::option::Option<crate::types::Serverless>) -> Self {
        self.serverless = input;
        self
    }
    /// <p>Information about the serverless cluster.</p>
    pub fn get_serverless(&self) -> &::std::option::Option<crate::types::Serverless> {
        &self.serverless
    }
    /// Consumes the builder and constructs a [`Cluster`](crate::types::Cluster).
    pub fn build(self) -> crate::types::Cluster {
        crate::types::Cluster {
            active_operation_arn: self.active_operation_arn,
            cluster_type: self.cluster_type,
            cluster_arn: self.cluster_arn,
            cluster_name: self.cluster_name,
            creation_time: self.creation_time,
            current_version: self.current_version,
            state: self.state,
            state_info: self.state_info,
            tags: self.tags,
            provisioned: self.provisioned,
            serverless: self.serverless,
        }
    }
}