aws-sdk-acm 1.105.0

AWS SDK for AWS Certificate Manager
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct ImportCertificateInput {
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of an imported certificate to replace. To import a new certificate, omit this field.</p>
    pub certificate_arn: ::std::option::Option<::std::string::String>,
    /// <p>The certificate to import.</p>
    pub certificate: ::std::option::Option<::aws_smithy_types::Blob>,
    /// <p>The private key that matches the public key in the certificate.</p>
    pub private_key: ::std::option::Option<::aws_smithy_types::Blob>,
    /// <p>The PEM encoded certificate chain.</p>
    pub certificate_chain: ::std::option::Option<::aws_smithy_types::Blob>,
    /// <p>One or more resource tags to associate with the imported certificate.</p>
    /// <p>Note: You cannot apply tags when reimporting a certificate.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl ImportCertificateInput {
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of an imported certificate to replace. To import a new certificate, omit this field.</p>
    pub fn certificate_arn(&self) -> ::std::option::Option<&str> {
        self.certificate_arn.as_deref()
    }
    /// <p>The certificate to import.</p>
    pub fn certificate(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
        self.certificate.as_ref()
    }
    /// <p>The private key that matches the public key in the certificate.</p>
    pub fn private_key(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
        self.private_key.as_ref()
    }
    /// <p>The PEM encoded certificate chain.</p>
    pub fn certificate_chain(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
        self.certificate_chain.as_ref()
    }
    /// <p>One or more resource tags to associate with the imported certificate.</p>
    /// <p>Note: You cannot apply tags when reimporting a certificate.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
}
impl ::std::fmt::Debug for ImportCertificateInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ImportCertificateInput");
        formatter.field("certificate_arn", &self.certificate_arn);
        formatter.field("certificate", &self.certificate);
        formatter.field("private_key", &"*** Sensitive Data Redacted ***");
        formatter.field("certificate_chain", &self.certificate_chain);
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}
impl ImportCertificateInput {
    /// Creates a new builder-style object to manufacture [`ImportCertificateInput`](crate::operation::import_certificate::ImportCertificateInput).
    pub fn builder() -> crate::operation::import_certificate::builders::ImportCertificateInputBuilder {
        crate::operation::import_certificate::builders::ImportCertificateInputBuilder::default()
    }
}

/// A builder for [`ImportCertificateInput`](crate::operation::import_certificate::ImportCertificateInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct ImportCertificateInputBuilder {
    pub(crate) certificate_arn: ::std::option::Option<::std::string::String>,
    pub(crate) certificate: ::std::option::Option<::aws_smithy_types::Blob>,
    pub(crate) private_key: ::std::option::Option<::aws_smithy_types::Blob>,
    pub(crate) certificate_chain: ::std::option::Option<::aws_smithy_types::Blob>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl ImportCertificateInputBuilder {
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of an imported certificate to replace. To import a new certificate, omit this field.</p>
    pub fn certificate_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.certificate_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of an imported certificate to replace. To import a new certificate, omit this field.</p>
    pub fn set_certificate_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.certificate_arn = input;
        self
    }
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of an imported certificate to replace. To import a new certificate, omit this field.</p>
    pub fn get_certificate_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.certificate_arn
    }
    /// <p>The certificate to import.</p>
    /// This field is required.
    pub fn certificate(mut self, input: ::aws_smithy_types::Blob) -> Self {
        self.certificate = ::std::option::Option::Some(input);
        self
    }
    /// <p>The certificate to import.</p>
    pub fn set_certificate(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
        self.certificate = input;
        self
    }
    /// <p>The certificate to import.</p>
    pub fn get_certificate(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        &self.certificate
    }
    /// <p>The private key that matches the public key in the certificate.</p>
    /// This field is required.
    pub fn private_key(mut self, input: ::aws_smithy_types::Blob) -> Self {
        self.private_key = ::std::option::Option::Some(input);
        self
    }
    /// <p>The private key that matches the public key in the certificate.</p>
    pub fn set_private_key(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
        self.private_key = input;
        self
    }
    /// <p>The private key that matches the public key in the certificate.</p>
    pub fn get_private_key(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        &self.private_key
    }
    /// <p>The PEM encoded certificate chain.</p>
    pub fn certificate_chain(mut self, input: ::aws_smithy_types::Blob) -> Self {
        self.certificate_chain = ::std::option::Option::Some(input);
        self
    }
    /// <p>The PEM encoded certificate chain.</p>
    pub fn set_certificate_chain(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
        self.certificate_chain = input;
        self
    }
    /// <p>The PEM encoded certificate chain.</p>
    pub fn get_certificate_chain(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        &self.certificate_chain
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>One or more resource tags to associate with the imported certificate.</p>
    /// <p>Note: You cannot apply tags when reimporting a certificate.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>One or more resource tags to associate with the imported certificate.</p>
    /// <p>Note: You cannot apply tags when reimporting a certificate.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>One or more resource tags to associate with the imported certificate.</p>
    /// <p>Note: You cannot apply tags when reimporting a certificate.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`ImportCertificateInput`](crate::operation::import_certificate::ImportCertificateInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::import_certificate::ImportCertificateInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::import_certificate::ImportCertificateInput {
            certificate_arn: self.certificate_arn,
            certificate: self.certificate,
            private_key: self.private_key,
            certificate_chain: self.certificate_chain,
            tags: self.tags,
        })
    }
}
impl ::std::fmt::Debug for ImportCertificateInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ImportCertificateInputBuilder");
        formatter.field("certificate_arn", &self.certificate_arn);
        formatter.field("certificate", &self.certificate);
        formatter.field("private_key", &"*** Sensitive Data Redacted ***");
        formatter.field("certificate_chain", &self.certificate_chain);
        formatter.field("tags", &self.tags);
        formatter.finish()
    }
}