aws-sdk-dsql 1.53.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 created cluster.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateClusterOutput {
    /// <p>The ID of the created cluster.</p>
    pub identifier: ::std::string::String,
    /// <p>The ARN of the created cluster.</p>
    pub arn: ::std::string::String,
    /// <p>The status of the created cluster.</p>
    pub status: crate::types::ClusterStatus,
    /// <p>The time of when created the cluster.</p>
    pub creation_time: ::aws_smithy_types::DateTime,
    /// <p>The multi-Region cluster configuration details that were set during cluster creation</p>
    pub multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
    /// <p>The encryption configuration for the cluster that was specified during the creation process, including the KMS key identifier and encryption state.</p>
    pub encryption_details: ::std::option::Option<crate::types::EncryptionDetails>,
    /// <p>Whether deletion protection is enabled on this cluster.</p>
    pub deletion_protection_enabled: bool,
    /// <p>The connection endpoint for the created cluster.</p>
    pub endpoint: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateClusterOutput {
    /// <p>The ID of the created cluster.</p>
    pub fn identifier(&self) -> &str {
        use std::ops::Deref;
        self.identifier.deref()
    }
    /// <p>The ARN of the created cluster.</p>
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
    /// <p>The status of the created cluster.</p>
    pub fn status(&self) -> &crate::types::ClusterStatus {
        &self.status
    }
    /// <p>The time of when created the cluster.</p>
    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
        &self.creation_time
    }
    /// <p>The multi-Region cluster configuration details that were set during cluster creation</p>
    pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
        self.multi_region_properties.as_ref()
    }
    /// <p>The encryption configuration for the cluster that was specified during the creation process, including the KMS key identifier and encryption state.</p>
    pub fn encryption_details(&self) -> ::std::option::Option<&crate::types::EncryptionDetails> {
        self.encryption_details.as_ref()
    }
    /// <p>Whether deletion protection is enabled on this cluster.</p>
    pub fn deletion_protection_enabled(&self) -> bool {
        self.deletion_protection_enabled
    }
    /// <p>The connection endpoint for the created cluster.</p>
    pub fn endpoint(&self) -> ::std::option::Option<&str> {
        self.endpoint.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for CreateClusterOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateClusterOutput {
    /// Creates a new builder-style object to manufacture [`CreateClusterOutput`](crate::operation::create_cluster::CreateClusterOutput).
    pub fn builder() -> crate::operation::create_cluster::builders::CreateClusterOutputBuilder {
        crate::operation::create_cluster::builders::CreateClusterOutputBuilder::default()
    }
}

/// A builder for [`CreateClusterOutput`](crate::operation::create_cluster::CreateClusterOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateClusterOutputBuilder {
    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) multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
    pub(crate) encryption_details: ::std::option::Option<crate::types::EncryptionDetails>,
    pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
    pub(crate) endpoint: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateClusterOutputBuilder {
    /// <p>The ID of the created 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 created 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 created cluster.</p>
    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.identifier
    }
    /// <p>The ARN of the created 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 created 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 created cluster.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The status of the created 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 created 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 created cluster.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ClusterStatus> {
        &self.status
    }
    /// <p>The time of when created the cluster.</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 created the cluster.</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 created the cluster.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>The multi-Region cluster configuration details that were set during cluster creation</p>
    pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
        self.multi_region_properties = ::std::option::Option::Some(input);
        self
    }
    /// <p>The multi-Region cluster configuration details that were set during cluster creation</p>
    pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
        self.multi_region_properties = input;
        self
    }
    /// <p>The multi-Region cluster configuration details that were set during cluster creation</p>
    pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
        &self.multi_region_properties
    }
    /// <p>The encryption configuration for the cluster that was specified during the creation process, including the KMS key identifier and encryption state.</p>
    pub fn encryption_details(mut self, input: crate::types::EncryptionDetails) -> Self {
        self.encryption_details = ::std::option::Option::Some(input);
        self
    }
    /// <p>The encryption configuration for the cluster that was specified during the creation process, including the KMS key identifier and encryption state.</p>
    pub fn set_encryption_details(mut self, input: ::std::option::Option<crate::types::EncryptionDetails>) -> Self {
        self.encryption_details = input;
        self
    }
    /// <p>The encryption configuration for the cluster that was specified during the creation process, including the KMS key identifier and encryption state.</p>
    pub fn get_encryption_details(&self) -> &::std::option::Option<crate::types::EncryptionDetails> {
        &self.encryption_details
    }
    /// <p>Whether deletion protection is enabled on 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 on 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 on this cluster.</p>
    pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
        &self.deletion_protection_enabled
    }
    /// <p>The connection endpoint for the created 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 created 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 created 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 [`CreateClusterOutput`](crate::operation::create_cluster::CreateClusterOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`identifier`](crate::operation::create_cluster::builders::CreateClusterOutputBuilder::identifier)
    /// - [`arn`](crate::operation::create_cluster::builders::CreateClusterOutputBuilder::arn)
    /// - [`status`](crate::operation::create_cluster::builders::CreateClusterOutputBuilder::status)
    /// - [`creation_time`](crate::operation::create_cluster::builders::CreateClusterOutputBuilder::creation_time)
    /// - [`deletion_protection_enabled`](crate::operation::create_cluster::builders::CreateClusterOutputBuilder::deletion_protection_enabled)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_cluster::CreateClusterOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_cluster::CreateClusterOutput {
            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 CreateClusterOutput",
                )
            })?,
            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 CreateClusterOutput",
                )
            })?,
            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 CreateClusterOutput",
                )
            })?,
            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 CreateClusterOutput",
                )
            })?,
            multi_region_properties: self.multi_region_properties,
            encryption_details: self.encryption_details,
            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 CreateClusterOutput",
                )
            })?,
            endpoint: self.endpoint,
            _request_id: self._request_id,
        })
    }
}