aws-sdk-dsql 1.58.0

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

/// <p>The output of a cluster.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetClusterOutput {
    /// <p>The ID of the retrieved cluster.</p>
    pub identifier: ::std::string::String,
    /// <p>The ARN of the retrieved cluster.</p>
    pub arn: ::std::string::String,
    /// <p>The status of the retrieved cluster.</p>
    pub status: crate::types::ClusterStatus,
    /// <p>The time of when the cluster was created.</p>
    pub creation_time: ::aws_smithy_types::DateTime,
    /// <p>Whether deletion protection is enabled in this cluster.</p>
    pub deletion_protection_enabled: bool,
    /// <p>Returns the current multi-Region cluster configuration, including witness region and linked cluster information.</p>
    pub multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
    /// <p>Map of tags.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The current encryption configuration details for the cluster.</p>
    pub encryption_details: ::std::option::Option<crate::types::EncryptionDetails>,
    /// <p>The connection endpoint for the cluster.</p>
    pub endpoint: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetClusterOutput {
    /// <p>The ID of the retrieved cluster.</p>
    pub fn identifier(&self) -> &str {
        use std::ops::Deref;
        self.identifier.deref()
    }
    /// <p>The ARN of the retrieved cluster.</p>
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
    /// <p>The status of the retrieved cluster.</p>
    pub fn status(&self) -> &crate::types::ClusterStatus {
        &self.status
    }
    /// <p>The time of when the cluster was created.</p>
    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
        &self.creation_time
    }
    /// <p>Whether deletion protection is enabled in this cluster.</p>
    pub fn deletion_protection_enabled(&self) -> bool {
        self.deletion_protection_enabled
    }
    /// <p>Returns the current multi-Region cluster configuration, including witness region and linked cluster information.</p>
    pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
        self.multi_region_properties.as_ref()
    }
    /// <p>Map of tags.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// <p>The current encryption configuration details for the cluster.</p>
    pub fn encryption_details(&self) -> ::std::option::Option<&crate::types::EncryptionDetails> {
        self.encryption_details.as_ref()
    }
    /// <p>The connection endpoint for the cluster.</p>
    pub fn endpoint(&self) -> ::std::option::Option<&str> {
        self.endpoint.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for GetClusterOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetClusterOutput {
    /// Creates a new builder-style object to manufacture [`GetClusterOutput`](crate::operation::get_cluster::GetClusterOutput).
    pub fn builder() -> crate::operation::get_cluster::builders::GetClusterOutputBuilder {
        crate::operation::get_cluster::builders::GetClusterOutputBuilder::default()
    }
}

/// A builder for [`GetClusterOutput`](crate::operation::get_cluster::GetClusterOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetClusterOutputBuilder {
    pub(crate) identifier: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::ClusterStatus>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
    pub(crate) multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) encryption_details: ::std::option::Option<crate::types::EncryptionDetails>,
    pub(crate) endpoint: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetClusterOutputBuilder {
    /// <p>The ID of the retrieved cluster.</p>
    /// This field is required.
    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the retrieved cluster.</p>
    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.identifier = input;
        self
    }
    /// <p>The ID of the retrieved cluster.</p>
    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.identifier
    }
    /// <p>The ARN of the retrieved cluster.</p>
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the retrieved cluster.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The ARN of the retrieved cluster.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The status of the retrieved cluster.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::ClusterStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the retrieved cluster.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ClusterStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the retrieved cluster.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
        &self.status
    }
    /// <p>The time of when the cluster was created.</p>
    /// This field is required.
    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time of 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 of when the cluster was created.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>Whether deletion protection is enabled in this cluster.</p>
    /// This field is required.
    pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
        self.deletion_protection_enabled = ::std::option::Option::Some(input);
        self
    }
    /// <p>Whether deletion protection is enabled in this cluster.</p>
    pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.deletion_protection_enabled = input;
        self
    }
    /// <p>Whether deletion protection is enabled in this cluster.</p>
    pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
        &self.deletion_protection_enabled
    }
    /// <p>Returns the current multi-Region cluster configuration, including witness region and linked cluster information.</p>
    pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
        self.multi_region_properties = ::std::option::Option::Some(input);
        self
    }
    /// <p>Returns the current multi-Region cluster configuration, including witness region and linked cluster information.</p>
    pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
        self.multi_region_properties = input;
        self
    }
    /// <p>Returns the current multi-Region cluster configuration, including witness region and linked cluster information.</p>
    pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
        &self.multi_region_properties
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Map of tags.</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>Map of tags.</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>Map of tags.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// <p>The current encryption configuration details for the cluster.</p>
    pub fn encryption_details(mut self, input: crate::types::EncryptionDetails) -> Self {
        self.encryption_details = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current encryption configuration details for the cluster.</p>
    pub fn set_encryption_details(mut self, input: ::std::option::Option<crate::types::EncryptionDetails>) -> Self {
        self.encryption_details = input;
        self
    }
    /// <p>The current encryption configuration details for the cluster.</p>
    pub fn get_encryption_details(&self) -> &::std::option::Option<crate::types::EncryptionDetails> {
        &self.encryption_details
    }
    /// <p>The connection endpoint for the cluster.</p>
    pub fn endpoint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.endpoint = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The connection endpoint for the cluster.</p>
    pub fn set_endpoint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.endpoint = input;
        self
    }
    /// <p>The connection endpoint for the cluster.</p>
    pub fn get_endpoint(&self) -> &::std::option::Option<::std::string::String> {
        &self.endpoint
    }
    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 [`GetClusterOutput`](crate::operation::get_cluster::GetClusterOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`identifier`](crate::operation::get_cluster::builders::GetClusterOutputBuilder::identifier)
    /// - [`arn`](crate::operation::get_cluster::builders::GetClusterOutputBuilder::arn)
    /// - [`status`](crate::operation::get_cluster::builders::GetClusterOutputBuilder::status)
    /// - [`creation_time`](crate::operation::get_cluster::builders::GetClusterOutputBuilder::creation_time)
    /// - [`deletion_protection_enabled`](crate::operation::get_cluster::builders::GetClusterOutputBuilder::deletion_protection_enabled)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_cluster::GetClusterOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_cluster::GetClusterOutput {
            identifier: self.identifier.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "identifier",
                    "identifier was not specified but it is required when building GetClusterOutput",
                )
            })?,
            arn: self.arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "arn",
                    "arn was not specified but it is required when building GetClusterOutput",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building GetClusterOutput",
                )
            })?,
            creation_time: self.creation_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "creation_time",
                    "creation_time was not specified but it is required when building GetClusterOutput",
                )
            })?,
            deletion_protection_enabled: self.deletion_protection_enabled.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "deletion_protection_enabled",
                    "deletion_protection_enabled was not specified but it is required when building GetClusterOutput",
                )
            })?,
            multi_region_properties: self.multi_region_properties,
            tags: self.tags,
            encryption_details: self.encryption_details,
            endpoint: self.endpoint,
            _request_id: self._request_id,
        })
    }
}