aws-sdk-amplify 1.107.0

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

/// <p>Describes the current SSL/TLS certificate that is in use for the domain. If you are using <code>CreateDomainAssociation</code> to create a new domain association, <code>Certificate</code> describes the new certificate that you are creating.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Certificate {
    /// <p>The type of SSL/TLS certificate that you want to use.</p>
    /// <p>Specify <code>AMPLIFY_MANAGED</code> to use the default certificate that Amplify provisions for you.</p>
    /// <p>Specify <code>CUSTOM</code> to use your own certificate that you have already added to Certificate Manager in your Amazon Web Services account. Make sure you request (or import) the certificate in the US East (N. Virginia) Region (us-east-1). For more information about using ACM, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html">Importing certificates into Certificate Manager</a> in the <i>ACM User guide</i>.</p>
    pub r#type: crate::types::CertificateType,
    /// <p>The Amazon resource name (ARN) for a custom certificate that you have already added to Certificate Manager in your Amazon Web Services account.</p>
    /// <p>This field is required only when the certificate type is <code>CUSTOM</code>.</p>
    pub custom_certificate_arn: ::std::option::Option<::std::string::String>,
    /// <p>The DNS record for certificate verification.</p>
    pub certificate_verification_dns_record: ::std::option::Option<::std::string::String>,
}
impl Certificate {
    /// <p>The type of SSL/TLS certificate that you want to use.</p>
    /// <p>Specify <code>AMPLIFY_MANAGED</code> to use the default certificate that Amplify provisions for you.</p>
    /// <p>Specify <code>CUSTOM</code> to use your own certificate that you have already added to Certificate Manager in your Amazon Web Services account. Make sure you request (or import) the certificate in the US East (N. Virginia) Region (us-east-1). For more information about using ACM, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html">Importing certificates into Certificate Manager</a> in the <i>ACM User guide</i>.</p>
    pub fn r#type(&self) -> &crate::types::CertificateType {
        &self.r#type
    }
    /// <p>The Amazon resource name (ARN) for a custom certificate that you have already added to Certificate Manager in your Amazon Web Services account.</p>
    /// <p>This field is required only when the certificate type is <code>CUSTOM</code>.</p>
    pub fn custom_certificate_arn(&self) -> ::std::option::Option<&str> {
        self.custom_certificate_arn.as_deref()
    }
    /// <p>The DNS record for certificate verification.</p>
    pub fn certificate_verification_dns_record(&self) -> ::std::option::Option<&str> {
        self.certificate_verification_dns_record.as_deref()
    }
}
impl Certificate {
    /// Creates a new builder-style object to manufacture [`Certificate`](crate::types::Certificate).
    pub fn builder() -> crate::types::builders::CertificateBuilder {
        crate::types::builders::CertificateBuilder::default()
    }
}

/// A builder for [`Certificate`](crate::types::Certificate).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CertificateBuilder {
    pub(crate) r#type: ::std::option::Option<crate::types::CertificateType>,
    pub(crate) custom_certificate_arn: ::std::option::Option<::std::string::String>,
    pub(crate) certificate_verification_dns_record: ::std::option::Option<::std::string::String>,
}
impl CertificateBuilder {
    /// <p>The type of SSL/TLS certificate that you want to use.</p>
    /// <p>Specify <code>AMPLIFY_MANAGED</code> to use the default certificate that Amplify provisions for you.</p>
    /// <p>Specify <code>CUSTOM</code> to use your own certificate that you have already added to Certificate Manager in your Amazon Web Services account. Make sure you request (or import) the certificate in the US East (N. Virginia) Region (us-east-1). For more information about using ACM, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html">Importing certificates into Certificate Manager</a> in the <i>ACM User guide</i>.</p>
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::CertificateType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of SSL/TLS certificate that you want to use.</p>
    /// <p>Specify <code>AMPLIFY_MANAGED</code> to use the default certificate that Amplify provisions for you.</p>
    /// <p>Specify <code>CUSTOM</code> to use your own certificate that you have already added to Certificate Manager in your Amazon Web Services account. Make sure you request (or import) the certificate in the US East (N. Virginia) Region (us-east-1). For more information about using ACM, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html">Importing certificates into Certificate Manager</a> in the <i>ACM User guide</i>.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::CertificateType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The type of SSL/TLS certificate that you want to use.</p>
    /// <p>Specify <code>AMPLIFY_MANAGED</code> to use the default certificate that Amplify provisions for you.</p>
    /// <p>Specify <code>CUSTOM</code> to use your own certificate that you have already added to Certificate Manager in your Amazon Web Services account. Make sure you request (or import) the certificate in the US East (N. Virginia) Region (us-east-1). For more information about using ACM, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html">Importing certificates into Certificate Manager</a> in the <i>ACM User guide</i>.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::CertificateType> {
        &self.r#type
    }
    /// <p>The Amazon resource name (ARN) for a custom certificate that you have already added to Certificate Manager in your Amazon Web Services account.</p>
    /// <p>This field is required only when the certificate type is <code>CUSTOM</code>.</p>
    pub fn custom_certificate_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.custom_certificate_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon resource name (ARN) for a custom certificate that you have already added to Certificate Manager in your Amazon Web Services account.</p>
    /// <p>This field is required only when the certificate type is <code>CUSTOM</code>.</p>
    pub fn set_custom_certificate_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.custom_certificate_arn = input;
        self
    }
    /// <p>The Amazon resource name (ARN) for a custom certificate that you have already added to Certificate Manager in your Amazon Web Services account.</p>
    /// <p>This field is required only when the certificate type is <code>CUSTOM</code>.</p>
    pub fn get_custom_certificate_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.custom_certificate_arn
    }
    /// <p>The DNS record for certificate verification.</p>
    pub fn certificate_verification_dns_record(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.certificate_verification_dns_record = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The DNS record for certificate verification.</p>
    pub fn set_certificate_verification_dns_record(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.certificate_verification_dns_record = input;
        self
    }
    /// <p>The DNS record for certificate verification.</p>
    pub fn get_certificate_verification_dns_record(&self) -> &::std::option::Option<::std::string::String> {
        &self.certificate_verification_dns_record
    }
    /// Consumes the builder and constructs a [`Certificate`](crate::types::Certificate).
    /// This method will fail if any of the following fields are not set:
    /// - [`r#type`](crate::types::builders::CertificateBuilder::type)
    pub fn build(self) -> ::std::result::Result<crate::types::Certificate, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Certificate {
            r#type: self.r#type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "r#type",
                    "r#type was not specified but it is required when building Certificate",
                )
            })?,
            custom_certificate_arn: self.custom_certificate_arn,
            certificate_verification_dns_record: self.certificate_verification_dns_record,
        })
    }
}