aws-sdk-iot 1.112.0

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

/// <p>The input to the RegisterCertificate operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RegisterCertificateInput {
    /// <p>The certificate data, in PEM format.</p>
    pub certificate_pem: ::std::option::Option<::std::string::String>,
    /// <p>The CA certificate used to sign the device certificate being registered.</p>
    pub ca_certificate_pem: ::std::option::Option<::std::string::String>,
    /// <p>A boolean value that specifies if the certificate is set to active.</p>
    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
    #[deprecated]
    pub set_as_active: ::std::option::Option<bool>,
    /// <p>The status of the register certificate request. Valid values that you can use include <code>ACTIVE</code>, <code>INACTIVE</code>, and <code>REVOKED</code>.</p>
    pub status: ::std::option::Option<crate::types::CertificateStatus>,
}
impl RegisterCertificateInput {
    /// <p>The certificate data, in PEM format.</p>
    pub fn certificate_pem(&self) -> ::std::option::Option<&str> {
        self.certificate_pem.as_deref()
    }
    /// <p>The CA certificate used to sign the device certificate being registered.</p>
    pub fn ca_certificate_pem(&self) -> ::std::option::Option<&str> {
        self.ca_certificate_pem.as_deref()
    }
    /// <p>A boolean value that specifies if the certificate is set to active.</p>
    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
    #[deprecated]
    pub fn set_as_active(&self) -> ::std::option::Option<bool> {
        self.set_as_active
    }
    /// <p>The status of the register certificate request. Valid values that you can use include <code>ACTIVE</code>, <code>INACTIVE</code>, and <code>REVOKED</code>.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::CertificateStatus> {
        self.status.as_ref()
    }
}
impl RegisterCertificateInput {
    /// Creates a new builder-style object to manufacture [`RegisterCertificateInput`](crate::operation::register_certificate::RegisterCertificateInput).
    pub fn builder() -> crate::operation::register_certificate::builders::RegisterCertificateInputBuilder {
        crate::operation::register_certificate::builders::RegisterCertificateInputBuilder::default()
    }
}

/// A builder for [`RegisterCertificateInput`](crate::operation::register_certificate::RegisterCertificateInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RegisterCertificateInputBuilder {
    pub(crate) certificate_pem: ::std::option::Option<::std::string::String>,
    pub(crate) ca_certificate_pem: ::std::option::Option<::std::string::String>,
    pub(crate) set_as_active: ::std::option::Option<bool>,
    pub(crate) status: ::std::option::Option<crate::types::CertificateStatus>,
}
impl RegisterCertificateInputBuilder {
    /// <p>The certificate data, in PEM format.</p>
    /// This field is required.
    pub fn certificate_pem(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.certificate_pem = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The certificate data, in PEM format.</p>
    pub fn set_certificate_pem(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.certificate_pem = input;
        self
    }
    /// <p>The certificate data, in PEM format.</p>
    pub fn get_certificate_pem(&self) -> &::std::option::Option<::std::string::String> {
        &self.certificate_pem
    }
    /// <p>The CA certificate used to sign the device certificate being registered.</p>
    pub fn ca_certificate_pem(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.ca_certificate_pem = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The CA certificate used to sign the device certificate being registered.</p>
    pub fn set_ca_certificate_pem(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.ca_certificate_pem = input;
        self
    }
    /// <p>The CA certificate used to sign the device certificate being registered.</p>
    pub fn get_ca_certificate_pem(&self) -> &::std::option::Option<::std::string::String> {
        &self.ca_certificate_pem
    }
    /// <p>A boolean value that specifies if the certificate is set to active.</p>
    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
    #[deprecated]
    pub fn set_as_active(mut self, input: bool) -> Self {
        self.set_as_active = ::std::option::Option::Some(input);
        self
    }
    /// <p>A boolean value that specifies if the certificate is set to active.</p>
    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
    #[deprecated]
    pub fn set_set_as_active(mut self, input: ::std::option::Option<bool>) -> Self {
        self.set_as_active = input;
        self
    }
    /// <p>A boolean value that specifies if the certificate is set to active.</p>
    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
    #[deprecated]
    pub fn get_set_as_active(&self) -> &::std::option::Option<bool> {
        &self.set_as_active
    }
    /// <p>The status of the register certificate request. Valid values that you can use include <code>ACTIVE</code>, <code>INACTIVE</code>, and <code>REVOKED</code>.</p>
    pub fn status(mut self, input: crate::types::CertificateStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the register certificate request. Valid values that you can use include <code>ACTIVE</code>, <code>INACTIVE</code>, and <code>REVOKED</code>.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::CertificateStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the register certificate request. Valid values that you can use include <code>ACTIVE</code>, <code>INACTIVE</code>, and <code>REVOKED</code>.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::CertificateStatus> {
        &self.status
    }
    /// Consumes the builder and constructs a [`RegisterCertificateInput`](crate::operation::register_certificate::RegisterCertificateInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::register_certificate::RegisterCertificateInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::register_certificate::RegisterCertificateInput {
            certificate_pem: self.certificate_pem,
            ca_certificate_pem: self.ca_certificate_pem,
            set_as_active: self.set_as_active,
            status: self.status,
        })
    }
}