aws-sdk-docdbelastic 0.5.0

AWS SDK for Amazon DocumentDB Elastic Clusters
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Returns information about a specific Elastic DocumentDB cluster.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Cluster {
    /// <p>The name of the Elastic DocumentDB cluster.</p>
    #[doc(hidden)]
    pub cluster_name: std::option::Option<std::string::String>,
    /// <p>The arn of the Elastic DocumentDB cluster.</p>
    #[doc(hidden)]
    pub cluster_arn: std::option::Option<std::string::String>,
    /// <p>The status of the Elastic DocumentDB cluster.</p>
    #[doc(hidden)]
    pub status: std::option::Option<crate::types::Status>,
    /// <p>The URL used to connect to the Elastic DocumentDB cluster.</p>
    #[doc(hidden)]
    pub cluster_endpoint: std::option::Option<std::string::String>,
    /// <p>The time when the Elastic DocumentDB cluster was created in Universal Coordinated Time (UTC).</p>
    #[doc(hidden)]
    pub create_time: std::option::Option<std::string::String>,
    /// <p>The name of the Elastic DocumentDB cluster administrator.</p>
    #[doc(hidden)]
    pub admin_user_name: std::option::Option<std::string::String>,
    /// <p>The authentication type for the Elastic DocumentDB cluster.</p>
    #[doc(hidden)]
    pub auth_type: std::option::Option<crate::types::Auth>,
    /// <p>The capacity of each shard in the Elastic DocumentDB cluster.</p>
    #[doc(hidden)]
    pub shard_capacity: std::option::Option<i32>,
    /// <p>The number of shards in the Elastic DocumentDB cluster.</p>
    #[doc(hidden)]
    pub shard_count: std::option::Option<i32>,
    /// <p>A list of EC2 VPC security groups associated with this cluster.</p>
    #[doc(hidden)]
    pub vpc_security_group_ids: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p>The Amazon EC2 subnet IDs for the Elastic DocumentDB cluster.</p>
    #[doc(hidden)]
    pub subnet_ids: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
    /// <p> <i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code> </p>
    #[doc(hidden)]
    pub preferred_maintenance_window: std::option::Option<std::string::String>,
    /// <p>The KMS key identifier to use to encrypt the Elastic DocumentDB cluster.</p>
    #[doc(hidden)]
    pub kms_key_id: std::option::Option<std::string::String>,
}
impl Cluster {
    /// <p>The name of the Elastic DocumentDB cluster.</p>
    pub fn cluster_name(&self) -> std::option::Option<&str> {
        self.cluster_name.as_deref()
    }
    /// <p>The arn of the Elastic DocumentDB cluster.</p>
    pub fn cluster_arn(&self) -> std::option::Option<&str> {
        self.cluster_arn.as_deref()
    }
    /// <p>The status of the Elastic DocumentDB cluster.</p>
    pub fn status(&self) -> std::option::Option<&crate::types::Status> {
        self.status.as_ref()
    }
    /// <p>The URL used to connect to the Elastic DocumentDB cluster.</p>
    pub fn cluster_endpoint(&self) -> std::option::Option<&str> {
        self.cluster_endpoint.as_deref()
    }
    /// <p>The time when the Elastic DocumentDB cluster was created in Universal Coordinated Time (UTC).</p>
    pub fn create_time(&self) -> std::option::Option<&str> {
        self.create_time.as_deref()
    }
    /// <p>The name of the Elastic DocumentDB cluster administrator.</p>
    pub fn admin_user_name(&self) -> std::option::Option<&str> {
        self.admin_user_name.as_deref()
    }
    /// <p>The authentication type for the Elastic DocumentDB cluster.</p>
    pub fn auth_type(&self) -> std::option::Option<&crate::types::Auth> {
        self.auth_type.as_ref()
    }
    /// <p>The capacity of each shard in the Elastic DocumentDB cluster.</p>
    pub fn shard_capacity(&self) -> std::option::Option<i32> {
        self.shard_capacity
    }
    /// <p>The number of shards in the Elastic DocumentDB cluster.</p>
    pub fn shard_count(&self) -> std::option::Option<i32> {
        self.shard_count
    }
    /// <p>A list of EC2 VPC security groups associated with this cluster.</p>
    pub fn vpc_security_group_ids(&self) -> std::option::Option<&[std::string::String]> {
        self.vpc_security_group_ids.as_deref()
    }
    /// <p>The Amazon EC2 subnet IDs for the Elastic DocumentDB cluster.</p>
    pub fn subnet_ids(&self) -> std::option::Option<&[std::string::String]> {
        self.subnet_ids.as_deref()
    }
    /// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
    /// <p> <i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code> </p>
    pub fn preferred_maintenance_window(&self) -> std::option::Option<&str> {
        self.preferred_maintenance_window.as_deref()
    }
    /// <p>The KMS key identifier to use to encrypt the Elastic DocumentDB cluster.</p>
    pub fn kms_key_id(&self) -> std::option::Option<&str> {
        self.kms_key_id.as_deref()
    }
}
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).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct ClusterBuilder {
    pub(crate) cluster_name: std::option::Option<std::string::String>,
    pub(crate) cluster_arn: std::option::Option<std::string::String>,
    pub(crate) status: std::option::Option<crate::types::Status>,
    pub(crate) cluster_endpoint: std::option::Option<std::string::String>,
    pub(crate) create_time: std::option::Option<std::string::String>,
    pub(crate) admin_user_name: std::option::Option<std::string::String>,
    pub(crate) auth_type: std::option::Option<crate::types::Auth>,
    pub(crate) shard_capacity: std::option::Option<i32>,
    pub(crate) shard_count: std::option::Option<i32>,
    pub(crate) vpc_security_group_ids: std::option::Option<std::vec::Vec<std::string::String>>,
    pub(crate) subnet_ids: std::option::Option<std::vec::Vec<std::string::String>>,
    pub(crate) preferred_maintenance_window: std::option::Option<std::string::String>,
    pub(crate) kms_key_id: std::option::Option<std::string::String>,
}
impl ClusterBuilder {
    /// <p>The name of the Elastic DocumentDB cluster.</p>
    pub fn cluster_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.cluster_name = Some(input.into());
        self
    }
    /// <p>The name of the Elastic DocumentDB cluster.</p>
    pub fn set_cluster_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.cluster_name = input;
        self
    }
    /// <p>The arn of the Elastic DocumentDB cluster.</p>
    pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.cluster_arn = Some(input.into());
        self
    }
    /// <p>The arn of the Elastic DocumentDB cluster.</p>
    pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.cluster_arn = input;
        self
    }
    /// <p>The status of the Elastic DocumentDB cluster.</p>
    pub fn status(mut self, input: crate::types::Status) -> Self {
        self.status = Some(input);
        self
    }
    /// <p>The status of the Elastic DocumentDB cluster.</p>
    pub fn set_status(mut self, input: std::option::Option<crate::types::Status>) -> Self {
        self.status = input;
        self
    }
    /// <p>The URL used to connect to the Elastic DocumentDB cluster.</p>
    pub fn cluster_endpoint(mut self, input: impl Into<std::string::String>) -> Self {
        self.cluster_endpoint = Some(input.into());
        self
    }
    /// <p>The URL used to connect to the Elastic DocumentDB cluster.</p>
    pub fn set_cluster_endpoint(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.cluster_endpoint = input;
        self
    }
    /// <p>The time when the Elastic DocumentDB cluster was created in Universal Coordinated Time (UTC).</p>
    pub fn create_time(mut self, input: impl Into<std::string::String>) -> Self {
        self.create_time = Some(input.into());
        self
    }
    /// <p>The time when the Elastic DocumentDB cluster was created in Universal Coordinated Time (UTC).</p>
    pub fn set_create_time(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.create_time = input;
        self
    }
    /// <p>The name of the Elastic DocumentDB cluster administrator.</p>
    pub fn admin_user_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.admin_user_name = Some(input.into());
        self
    }
    /// <p>The name of the Elastic DocumentDB cluster administrator.</p>
    pub fn set_admin_user_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.admin_user_name = input;
        self
    }
    /// <p>The authentication type for the Elastic DocumentDB cluster.</p>
    pub fn auth_type(mut self, input: crate::types::Auth) -> Self {
        self.auth_type = Some(input);
        self
    }
    /// <p>The authentication type for the Elastic DocumentDB cluster.</p>
    pub fn set_auth_type(mut self, input: std::option::Option<crate::types::Auth>) -> Self {
        self.auth_type = input;
        self
    }
    /// <p>The capacity of each shard in the Elastic DocumentDB cluster.</p>
    pub fn shard_capacity(mut self, input: i32) -> Self {
        self.shard_capacity = Some(input);
        self
    }
    /// <p>The capacity of each shard in the Elastic DocumentDB cluster.</p>
    pub fn set_shard_capacity(mut self, input: std::option::Option<i32>) -> Self {
        self.shard_capacity = input;
        self
    }
    /// <p>The number of shards in the Elastic DocumentDB cluster.</p>
    pub fn shard_count(mut self, input: i32) -> Self {
        self.shard_count = Some(input);
        self
    }
    /// <p>The number of shards in the Elastic DocumentDB cluster.</p>
    pub fn set_shard_count(mut self, input: std::option::Option<i32>) -> Self {
        self.shard_count = input;
        self
    }
    /// Appends an item to `vpc_security_group_ids`.
    ///
    /// To override the contents of this collection use [`set_vpc_security_group_ids`](Self::set_vpc_security_group_ids).
    ///
    /// <p>A list of EC2 VPC security groups associated with this cluster.</p>
    pub fn vpc_security_group_ids(mut self, input: impl Into<std::string::String>) -> Self {
        let mut v = self.vpc_security_group_ids.unwrap_or_default();
        v.push(input.into());
        self.vpc_security_group_ids = Some(v);
        self
    }
    /// <p>A list of EC2 VPC security groups associated with this cluster.</p>
    pub fn set_vpc_security_group_ids(
        mut self,
        input: std::option::Option<std::vec::Vec<std::string::String>>,
    ) -> Self {
        self.vpc_security_group_ids = input;
        self
    }
    /// Appends an item to `subnet_ids`.
    ///
    /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
    ///
    /// <p>The Amazon EC2 subnet IDs for the Elastic DocumentDB cluster.</p>
    pub fn subnet_ids(mut self, input: impl Into<std::string::String>) -> Self {
        let mut v = self.subnet_ids.unwrap_or_default();
        v.push(input.into());
        self.subnet_ids = Some(v);
        self
    }
    /// <p>The Amazon EC2 subnet IDs for the Elastic DocumentDB cluster.</p>
    pub fn set_subnet_ids(
        mut self,
        input: std::option::Option<std::vec::Vec<std::string::String>>,
    ) -> Self {
        self.subnet_ids = input;
        self
    }
    /// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
    /// <p> <i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code> </p>
    pub fn preferred_maintenance_window(mut self, input: impl Into<std::string::String>) -> Self {
        self.preferred_maintenance_window = Some(input.into());
        self
    }
    /// <p>The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
    /// <p> <i>Format</i>: <code>ddd:hh24:mi-ddd:hh24:mi</code> </p>
    pub fn set_preferred_maintenance_window(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.preferred_maintenance_window = input;
        self
    }
    /// <p>The KMS key identifier to use to encrypt the Elastic DocumentDB cluster.</p>
    pub fn kms_key_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.kms_key_id = Some(input.into());
        self
    }
    /// <p>The KMS key identifier to use to encrypt the Elastic DocumentDB cluster.</p>
    pub fn set_kms_key_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.kms_key_id = input;
        self
    }
    /// Consumes the builder and constructs a [`Cluster`](crate::types::Cluster).
    pub fn build(self) -> crate::types::Cluster {
        crate::types::Cluster {
            cluster_name: self.cluster_name,
            cluster_arn: self.cluster_arn,
            status: self.status,
            cluster_endpoint: self.cluster_endpoint,
            create_time: self.create_time,
            admin_user_name: self.admin_user_name,
            auth_type: self.auth_type,
            shard_capacity: self.shard_capacity,
            shard_count: self.shard_count,
            vpc_security_group_ids: self.vpc_security_group_ids,
            subnet_ids: self.subnet_ids,
            preferred_maintenance_window: self.preferred_maintenance_window,
            kms_key_id: self.kms_key_id,
        }
    }
}