aws-sdk-iot 1.113.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 RegisterCACertificate operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RegisterCaCertificateInput {
    /// <p>The CA certificate.</p>
    pub ca_certificate: ::std::option::Option<::std::string::String>,
    /// <p>The private key verification certificate. If <code>certificateMode</code> is <code>SNI_ONLY</code>, the <code>verificationCertificate</code> field must be empty. If <code>certificateMode</code> is <code>DEFAULT</code> or not provided, the <code>verificationCertificate</code> field must not be empty.</p>
    pub verification_certificate: ::std::option::Option<::std::string::String>,
    /// <p>A boolean value that specifies if the CA certificate is set to active.</p>
    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
    pub set_as_active: ::std::option::Option<bool>,
    /// <p>Allows this CA certificate to be used for auto registration of device certificates.</p>
    pub allow_auto_registration: ::std::option::Option<bool>,
    /// <p>Information about the registration configuration.</p>
    pub registration_config: ::std::option::Option<crate::types::RegistrationConfig>,
    /// <p>Metadata which can be used to manage the CA certificate.</p><note>
    /// <p>For URI Request parameters use format: ...key1=value1&amp;key2=value2...</p>
    /// <p>For the CLI command-line parameter use format: &amp;&amp;tags "key1=value1&amp;key2=value2..."</p>
    /// <p>For the cli-input-json file use format: "tags": "key1=value1&amp;key2=value2..."</p>
    /// </note>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the <code>verificationCertificate</code> field is not provided, set <code>certificateMode</code> to be <code>SNI_ONLY</code>. If the <code>verificationCertificate</code> field is provided, set <code>certificateMode</code> to be <code>DEFAULT</code>. When <code>certificateMode</code> is not provided, it defaults to <code>DEFAULT</code>. All the device certificates that are registered using this CA will be registered in the same certificate mode as the CA. For more information about certificate mode for device certificates, see <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_CertificateDescription.html#iot-Type-CertificateDescription-certificateMode"> certificate mode</a>.</p>
    pub certificate_mode: ::std::option::Option<crate::types::CertificateMode>,
}
impl RegisterCaCertificateInput {
    /// <p>The CA certificate.</p>
    pub fn ca_certificate(&self) -> ::std::option::Option<&str> {
        self.ca_certificate.as_deref()
    }
    /// <p>The private key verification certificate. If <code>certificateMode</code> is <code>SNI_ONLY</code>, the <code>verificationCertificate</code> field must be empty. If <code>certificateMode</code> is <code>DEFAULT</code> or not provided, the <code>verificationCertificate</code> field must not be empty.</p>
    pub fn verification_certificate(&self) -> ::std::option::Option<&str> {
        self.verification_certificate.as_deref()
    }
    /// <p>A boolean value that specifies if the CA certificate is set to active.</p>
    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
    pub fn set_as_active(&self) -> ::std::option::Option<bool> {
        self.set_as_active
    }
    /// <p>Allows this CA certificate to be used for auto registration of device certificates.</p>
    pub fn allow_auto_registration(&self) -> ::std::option::Option<bool> {
        self.allow_auto_registration
    }
    /// <p>Information about the registration configuration.</p>
    pub fn registration_config(&self) -> ::std::option::Option<&crate::types::RegistrationConfig> {
        self.registration_config.as_ref()
    }
    /// <p>Metadata which can be used to manage the CA certificate.</p><note>
    /// <p>For URI Request parameters use format: ...key1=value1&amp;key2=value2...</p>
    /// <p>For the CLI command-line parameter use format: &amp;&amp;tags "key1=value1&amp;key2=value2..."</p>
    /// <p>For the cli-input-json file use format: "tags": "key1=value1&amp;key2=value2..."</p>
    /// </note>
    ///
    /// 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()
    }
    /// <p>Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the <code>verificationCertificate</code> field is not provided, set <code>certificateMode</code> to be <code>SNI_ONLY</code>. If the <code>verificationCertificate</code> field is provided, set <code>certificateMode</code> to be <code>DEFAULT</code>. When <code>certificateMode</code> is not provided, it defaults to <code>DEFAULT</code>. All the device certificates that are registered using this CA will be registered in the same certificate mode as the CA. For more information about certificate mode for device certificates, see <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_CertificateDescription.html#iot-Type-CertificateDescription-certificateMode"> certificate mode</a>.</p>
    pub fn certificate_mode(&self) -> ::std::option::Option<&crate::types::CertificateMode> {
        self.certificate_mode.as_ref()
    }
}
impl RegisterCaCertificateInput {
    /// Creates a new builder-style object to manufacture [`RegisterCaCertificateInput`](crate::operation::register_ca_certificate::RegisterCaCertificateInput).
    pub fn builder() -> crate::operation::register_ca_certificate::builders::RegisterCaCertificateInputBuilder {
        crate::operation::register_ca_certificate::builders::RegisterCaCertificateInputBuilder::default()
    }
}

/// A builder for [`RegisterCaCertificateInput`](crate::operation::register_ca_certificate::RegisterCaCertificateInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RegisterCaCertificateInputBuilder {
    pub(crate) ca_certificate: ::std::option::Option<::std::string::String>,
    pub(crate) verification_certificate: ::std::option::Option<::std::string::String>,
    pub(crate) set_as_active: ::std::option::Option<bool>,
    pub(crate) allow_auto_registration: ::std::option::Option<bool>,
    pub(crate) registration_config: ::std::option::Option<crate::types::RegistrationConfig>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) certificate_mode: ::std::option::Option<crate::types::CertificateMode>,
}
impl RegisterCaCertificateInputBuilder {
    /// <p>The CA certificate.</p>
    /// This field is required.
    pub fn ca_certificate(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.ca_certificate = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The CA certificate.</p>
    pub fn set_ca_certificate(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.ca_certificate = input;
        self
    }
    /// <p>The CA certificate.</p>
    pub fn get_ca_certificate(&self) -> &::std::option::Option<::std::string::String> {
        &self.ca_certificate
    }
    /// <p>The private key verification certificate. If <code>certificateMode</code> is <code>SNI_ONLY</code>, the <code>verificationCertificate</code> field must be empty. If <code>certificateMode</code> is <code>DEFAULT</code> or not provided, the <code>verificationCertificate</code> field must not be empty.</p>
    pub fn verification_certificate(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.verification_certificate = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The private key verification certificate. If <code>certificateMode</code> is <code>SNI_ONLY</code>, the <code>verificationCertificate</code> field must be empty. If <code>certificateMode</code> is <code>DEFAULT</code> or not provided, the <code>verificationCertificate</code> field must not be empty.</p>
    pub fn set_verification_certificate(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.verification_certificate = input;
        self
    }
    /// <p>The private key verification certificate. If <code>certificateMode</code> is <code>SNI_ONLY</code>, the <code>verificationCertificate</code> field must be empty. If <code>certificateMode</code> is <code>DEFAULT</code> or not provided, the <code>verificationCertificate</code> field must not be empty.</p>
    pub fn get_verification_certificate(&self) -> &::std::option::Option<::std::string::String> {
        &self.verification_certificate
    }
    /// <p>A boolean value that specifies if the CA certificate is set to active.</p>
    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
    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 CA certificate is set to active.</p>
    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
    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 CA certificate is set to active.</p>
    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
    pub fn get_set_as_active(&self) -> &::std::option::Option<bool> {
        &self.set_as_active
    }
    /// <p>Allows this CA certificate to be used for auto registration of device certificates.</p>
    pub fn allow_auto_registration(mut self, input: bool) -> Self {
        self.allow_auto_registration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Allows this CA certificate to be used for auto registration of device certificates.</p>
    pub fn set_allow_auto_registration(mut self, input: ::std::option::Option<bool>) -> Self {
        self.allow_auto_registration = input;
        self
    }
    /// <p>Allows this CA certificate to be used for auto registration of device certificates.</p>
    pub fn get_allow_auto_registration(&self) -> &::std::option::Option<bool> {
        &self.allow_auto_registration
    }
    /// <p>Information about the registration configuration.</p>
    pub fn registration_config(mut self, input: crate::types::RegistrationConfig) -> Self {
        self.registration_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>Information about the registration configuration.</p>
    pub fn set_registration_config(mut self, input: ::std::option::Option<crate::types::RegistrationConfig>) -> Self {
        self.registration_config = input;
        self
    }
    /// <p>Information about the registration configuration.</p>
    pub fn get_registration_config(&self) -> &::std::option::Option<crate::types::RegistrationConfig> {
        &self.registration_config
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Metadata which can be used to manage the CA certificate.</p><note>
    /// <p>For URI Request parameters use format: ...key1=value1&amp;key2=value2...</p>
    /// <p>For the CLI command-line parameter use format: &amp;&amp;tags "key1=value1&amp;key2=value2..."</p>
    /// <p>For the cli-input-json file use format: "tags": "key1=value1&amp;key2=value2..."</p>
    /// </note>
    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>Metadata which can be used to manage the CA certificate.</p><note>
    /// <p>For URI Request parameters use format: ...key1=value1&amp;key2=value2...</p>
    /// <p>For the CLI command-line parameter use format: &amp;&amp;tags "key1=value1&amp;key2=value2..."</p>
    /// <p>For the cli-input-json file use format: "tags": "key1=value1&amp;key2=value2..."</p>
    /// </note>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Metadata which can be used to manage the CA certificate.</p><note>
    /// <p>For URI Request parameters use format: ...key1=value1&amp;key2=value2...</p>
    /// <p>For the CLI command-line parameter use format: &amp;&amp;tags "key1=value1&amp;key2=value2..."</p>
    /// <p>For the cli-input-json file use format: "tags": "key1=value1&amp;key2=value2..."</p>
    /// </note>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the <code>verificationCertificate</code> field is not provided, set <code>certificateMode</code> to be <code>SNI_ONLY</code>. If the <code>verificationCertificate</code> field is provided, set <code>certificateMode</code> to be <code>DEFAULT</code>. When <code>certificateMode</code> is not provided, it defaults to <code>DEFAULT</code>. All the device certificates that are registered using this CA will be registered in the same certificate mode as the CA. For more information about certificate mode for device certificates, see <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_CertificateDescription.html#iot-Type-CertificateDescription-certificateMode"> certificate mode</a>.</p>
    pub fn certificate_mode(mut self, input: crate::types::CertificateMode) -> Self {
        self.certificate_mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the <code>verificationCertificate</code> field is not provided, set <code>certificateMode</code> to be <code>SNI_ONLY</code>. If the <code>verificationCertificate</code> field is provided, set <code>certificateMode</code> to be <code>DEFAULT</code>. When <code>certificateMode</code> is not provided, it defaults to <code>DEFAULT</code>. All the device certificates that are registered using this CA will be registered in the same certificate mode as the CA. For more information about certificate mode for device certificates, see <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_CertificateDescription.html#iot-Type-CertificateDescription-certificateMode"> certificate mode</a>.</p>
    pub fn set_certificate_mode(mut self, input: ::std::option::Option<crate::types::CertificateMode>) -> Self {
        self.certificate_mode = input;
        self
    }
    /// <p>Describes the certificate mode in which the Certificate Authority (CA) will be registered. If the <code>verificationCertificate</code> field is not provided, set <code>certificateMode</code> to be <code>SNI_ONLY</code>. If the <code>verificationCertificate</code> field is provided, set <code>certificateMode</code> to be <code>DEFAULT</code>. When <code>certificateMode</code> is not provided, it defaults to <code>DEFAULT</code>. All the device certificates that are registered using this CA will be registered in the same certificate mode as the CA. For more information about certificate mode for device certificates, see <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_CertificateDescription.html#iot-Type-CertificateDescription-certificateMode"> certificate mode</a>.</p>
    pub fn get_certificate_mode(&self) -> &::std::option::Option<crate::types::CertificateMode> {
        &self.certificate_mode
    }
    /// Consumes the builder and constructs a [`RegisterCaCertificateInput`](crate::operation::register_ca_certificate::RegisterCaCertificateInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::register_ca_certificate::RegisterCaCertificateInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::register_ca_certificate::RegisterCaCertificateInput {
            ca_certificate: self.ca_certificate,
            verification_certificate: self.verification_certificate,
            set_as_active: self.set_as_active,
            allow_auto_registration: self.allow_auto_registration,
            registration_config: self.registration_config,
            tags: self.tags,
            certificate_mode: self.certificate_mode,
        })
    }
}